# Custom Email Domains

Use Custom Email Domains to send SureCloud notifications from your organisation's email address.

This helps emails match your branding and look more trustworthy to recipients.

### How it works

When enabled, SureCloud sends platform notifications from the mailbox and domain you provide.

If you use Microsoft Graph API or Office 365, use a licensed mailbox.

Avoid shared mailboxes where possible.

{% hint style="info" %}
This setup requires configuration by SureCloud.
{% endhint %}

### Information to prepare

Before you request setup, make sure you have:

* Azure AD Tenant ID
* Azure AD Client ID or Application ID
* Email address of the mailbox to use

### Configure Azure AD

Follow these steps if you are using Graph API authentication.

{% stepper %}
{% step %}

### Create an Azure Application

1. Open [Azure Portal](https://portal.azure.com).
2. Go to **App registrations**.
3. Select **New registration**.
4. Enter an application name.
5. Select **Accounts in this organizational directory only**.
6. Leave **Redirect URI** blank.
7. Select **Register**.

<figure><img src="/files/UMk7RQNaKRKCZXEoC0TN" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Add email permissions

1. Open **API permissions**.
2. Select **Add a permission**.
3. Choose **Application** permissions.
4. Add `Mail.Send`.
5. Grant admin consent.

<figure><img src="/files/IbBe5n5F8nCaQAzT0C4I" alt=""><figcaption></figcaption></figure>

<figure><img src="/files/yIMZxETSgc0QFDwOoyyH" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Restrict mailbox access

Restrict the application so it can send only from the required mailbox.

You need:

* the App ID or Client ID of the application
* a mail-enabled security group containing the mailbox
* PowerShell access with `Connect-ExchangeOnline`

Follow [Microsoft's guide](https://docs.microsoft.com/en-us/graph/auth-limit-mailbox-access).

Run these commands in PowerShell, replacing the example values.

```powershell
New-ApplicationAccessPolicy -AppId e8f4eefc-046g-4084-9b4b-2ab8f144b59f -PolicyScopeGroupId EvenUsers@contoso.com -AccessRight RestrictAccess -Description "Restrict this app to members of distribution group EvenUsers."
```

Then test the policy:

```powershell
Test-ApplicationAccessPolicy -Identity user1@contoso.com -AppId e8f4eefc-046g-4084-9b4b-2ab8f144b59f
```

{% endstep %}

{% step %}

### Upload the certificate

After we receive your request, we will send you a certificate.

Upload it to your Azure app registration:

1. Open the app registration you created.
2. Go to **Certificates and secrets**.
3. Upload the certificate we provide.

<figure><img src="/files/C6FvNGYiHeIumFIp6C9V" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}

### Request setup

Email [SureCloud Support](mailto:success@surecloud.com) with:

* Tenant name
* Custom email domain or mailbox address
* Azure AD Tenant ID
* Client ID or Application ID
* Mailbox UUID or Directory Object ID

We will review the request and complete the configuration.

<figure><img src="/files/p7h4cl33LH1BVr2uEw8l" alt=""><figcaption></figcaption></figure>

### After setup

After setup, use the standard notification features as normal.

You can still:

* Define the content of your notifications.
* Specify email recipients.
* Schedule or trigger notifications as needed.

For more on notification setup, see [Designer Hub](/surecloud-docs/documentation/designer-hub/getting-started.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://surecloud.gitbook.io/surecloud-docs/documentation/admin/custom-email-domains.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
