Issues with Branded Emails | MuleSoft Documentation
# Issues with Branded Emails
Where possible, we changed noninclusive terms to align with our company value of Equality. We maintained certain terms to avoid any effect on customer implementations.  
---  
Anypoint API Community Manager sends notification emails when an API contract is approved or revoked. By default, these emails use Anypoint platform addresses and branding.
The following information includes symptoms and instructions for troubleshooting branded emails.
## Data Capture Process Fails
When the change data capture is enabled, Salesforce starts polling the ACM Community Bridge for contract updates. If the data capture process job fails, Salesforce stops polling.
Check the status of the data capture process to confirm that the change data capture failed.
To check the status, execute the following SOQL in the Developer Console:
```
SELECT Id, Name, SubmittedAt, StartedAt, FinishedAt, ProcessAfter, Status, Error
FROM BackgroundOperation WHERE Name = 'acm_pkg__AnypointContracts__x' ORDER by SubmittedAt DESC LIMIT 15
```

To resolve this error, the administrator should resume the data capture process.
## Not Receiving Emails
API Community Manager sends notification emails when an API contract is approved or revoked. A common issue occurs when the user who set up the change data capture is not an organization administrator. The user must be an organizational administrator of the master organization to view all available applications and contracts in the organization. It is possible to receive no errors using SOQL since the job step could end successfully, but contract updates are not returned.
The first step of the change data capture job is to retrieve all available contracts with updates. The trigger that is set as part of the branded emails configuration runs if there are contract updates. If the trigger is not executed by the same user as the change data capture, Salesforce uses a user named Automated Process. This user is created in Anypoint Platform the first time that the user tries to use the ACM Community Bridge. As result, no email notifications are received.
To resolve this issue, follow these steps:
  1. To determine if the Apex trigger is running, use the following code to add a log in the Apex trigger from the Developer Console:
```
trigger AnypointEmailNotificationsTrigger on acm_pkg__AnypointContracts__ChangeEvent (after insert) {
  System.debug('AnypointEmailNotificationsTrigger is running :)');
  List<acm_pkg__AnypointContracts__ChangeEvent> events = Trigger.new;
  acm_pkg__.AnypointEmailNotifications.notifyOnContractUpdates(events);
}
```

  2. In Anypoint, add the organization administrator role to the user that was used to set up the change data capture.
  3. Create a test application and request API access to any available API instance in Exchange.
  4. From **Access Management** , search for the **Automated Process** user and assign the **organization administrator** role in the **master organization**.
  5. From **API Manager** , revoke the test contract previously created to generate changes in the change data capture process.
  6. Wait for the next change data capture to occur.


See the Optionally Configure Branded Emails topic for complete instructions to set up branded emails.
## Change Data Capture Process Displays Errors
An unexpected error occurs when getting contracts in the ACM Community Bridge. For example, an internal Anypoint service is unavailable due to an outage.
```
Problem querying for changes. An error occurred while connecting to the external system. Please try again, or contact your administrator.
```

To resolve this error:
  1. Restart the change data capture process by removing the `AnypointContracts`` entity from **Setup > Integrations > Change Data Capture**.
  2. Click **Save**.
  3. Add the `AnypointContracts` entity from **Setup > Integrations > Change Data Capture** again.
  4. Click **Save**.


## Timeout Error is Too Long or OData Query Result is Too Large
If you receive any of the following errors, your organization might have too many client applications or contracts. Having more than 2000 applications and contracts causes a timeout. The timeout occurs because the amount of time that the ACM Community Bridge takes to get this information is greater than the Salesforce timeout of less than two minutes.
```
Error is too long
Problem querying for changes. The OData query result was too large, so the external data didn't load. If the error persists, contact Salesforce Customer Support.
Problem querying for changes. The remote operation timed out. Try again later. If the error persists, contact Salesforce Customer Support.
```

To resolve these errors:
  1. Use the following curl command with a token from an organization administrator of the master organization to check the number of applications that your organization contains.
```
curl --location --request GET "https://anypoint.mulesoft.com/apiplatform/repository/v2/organizations/${MASTER_ORGANIZATION_ID}/applications?targetAdminSite=true" --header "Authorization: bearer ${TOKEN}"
```

  2. Replace `MASTER_ORGANIZATION_ID` with your organization ID.
  3. If there are more than 2000 applications, delete any unnecessary applications.