# Configuring Custom Domain

## Custom Domain Configuration

Configuring a custom domain in The Wallet Crew typically takes place in the production environment to ensure a seamless, secure, and branded experience for your customers.

### Domains to Reflect Your Brand

#### Customize Your Wallet Crew URL Domains to Increase Security and Customer Confidence!

The Wallet Crew allows you to redirect your customers to a comprehensive set of prebuilt, hosted web pages optimized for collecting data and distributing cards in mobile Wallets applications. By customizing your URL domains, you can:

* Match your brand identity
* Decrease potential phishing
* Increase customer confidence and conversion

By default, The Wallet Crew uses its own domain to serve pages:

`https://app.neostore.cloud/<tenantId>/<layout>`

Example: `https://register.molia.top/molia/mobile`

However, it is possible to allow your brand to use its own domain, improving security and assuring customers they are communicating directly with your brand rather than falling prey to phishing websites.

All configurations must be done on the brand's DNS server. The Wallet Crew manages the SSL certificate through Auth0, so there is no need for additional configuration on your part.

### Steps to Configure a Custom Domain

#### Step 1: Request Custom Domain Configuration

Inform The Wallet Crew that you wish to use a custom domain name and specify the domain name or subdomain to be used. For example: `register.molia.top`.

#### Step 2: Configure DNS Records

The Wallet Crew will provide you with custom DNS records to configure on your brand's DNS server. After you have made the necessary modifications, The Wallet Crew will check and validate the configuration.

#### Step 3: Additional DNS Records

Once the initial DNS record is validated by The Wallet Crew, additional custom DNS records may be required. The Wallet Crew will send these new records for you to configure on your DNS server.

#### Example of DNS Entries to Modify

Below is an anonymized example of the DNS entries that need to be modified for the web part of The Wallet Crew:

| Type  | Key                                           | Value                                                            | Remarks                                       |
| ----- | --------------------------------------------- | ---------------------------------------------------------------- | --------------------------------------------- |
| CNAME | registration.example.com                      | app.neostore.cloud                                               | Used by end-users to display the app          |
| TXT   | asuid.registration.example.com                | 621ECF9549EAE65BA089A426C8142E089EF4C6916FB9AB9F21C111F30D85E816 | Used by Azure for domain validation           |
| TXT   | \_acme-challenge.registration.example.com     | 7xLnjbponxeyiXkNsdIdrheyHHGouoFmfOXVvO9OAf8                      | Used by Cloudflare for certificate validation |
| TXT   | \_cf-custom-hostname.registration.example.com | cdea2f9a-2a68-48ed-a83d-88403213a690                             | Used by Cloudflare for domain validation      |

By following these steps and configuring the DNS entries as shown in the example, you can ensure that your custom domain is properly configured, enhancing the security and branding of your Wallet Crew hosted pages.

### Configuring a Custom Email Provider in The Wallet Crew

#### Article 1: Using The Wallet Crew's SendGrid Account

**Configuring The Wallet Crew to Use The Wallet Crew's SendGrid Account**

This guide will help you set up The Wallet Crew to use The Wallet Crew's SendGrid account for sending emails.

**Prerequisites**

Before starting, ensure you have the following:

* Access to your DNS settings.
* Access to your Wallet Crew's configuration files.

**Step-by-Step Configuration**

1. **Request Authorization:**

   Contact The Wallet Crew support to request authorization for sending emails on your behalf. Provide your desired subdomain for security reasons. For example, use `registration.yourdomain.com` instead of `yourdomain.com`.
2. **Update DNS Settings:**

   Update your DNS settings with the following records to authorize The Wallet Crew's SendGrid account to send emails on your behalf. Below is an example configuration:

   ```plaintext
   type     | key                                       | value                                      | remarks
   ------------------------------------------------------------------------------------------------------
   CNAME    | em5094.registration.yourdomain.com        | u22547844.wl095.sendgrid.net               | used by SendGrid for domain validation
   CNAME    | neo._domainkey.registration.yourdomain.com| neo.domainkey.u22547844.wl095.sendgrid.net | used by SendGrid for DKIM authentication
   CNAME    | neo2._domainkey.registration.yourdomain.com| neo2.domainkey.u22547844.wl095.sendgrid.net| used by SendGrid for DKIM authentication
   TXT      | _dmarc.registration.yourdomain.com        | v=DMARC1; p=none;                          | DMARC configuration
   ```
3. **Update The Wallet Crew Configuration:**

   Once DNS settings are updated, configure The Wallet Crew to use the provided subdomain for sending emails. Open your Wallet Crew's configuration file and set the email provider section as follows:

   ```yaml
   provider:
     type: sendgrid
     apiKey: # Wallet Crew's SendGrid API key will be used internally
     from:
       email: no-reply@registration.yourdomain.com
       name: yourcompany
   resources:
     - /locales/emails/
   ```
4. **Save and Test Configuration:**

   Save your changes and test the email configuration by sending a test email from The Wallet Crew's admin panel or test endpoint.
5. **Example Email Template:**

   Place your email templates in the specified resources directory (`/locales/emails/`). Example structure:

   * `/locales/emails/welcome_email.html`
   * `/locales/emails/reset_password.html`

**Security Note**

For security reasons, authorizing The Wallet Crew to send emails only from a subdomain limits potential misuse. Ensure your main domain email sending is not affected.
