# ApexExceptionEmail

**ApexExceptionEmail** template sets the email addresses that will receive notifications when the Apex code encounters unhandled exceptions. Emails can be sent to the Salesforce org’s users and external email addresses. Additionally, delete the Salesforce user who no longer exists.

To create this template, follow the below steps:

1. Login to your AutoRABIT account.
2. Click on **Env. Pro.** module.
3. Click on **Create New Template**.
4. Go to the **Create Unsupported Metadata Template** tab.
5. Give the template a **name** and a **short description** of it.
6. Select the **ApexExceptionalEmail** checkbox available under **Add Apex Exception Email.**
7. Click **Add**.&#x20;
8. On the next screen, a **Test Case Name** appears automatically by default. To add the custom test data, click on **Add** button.
9. Users can add the required details in the fields of **Salesforce User, External Email Addresses, and Delete Salesforce User.** To add further details, click on![](https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FG0H6kancddrxeIYGnFt0%2Fimage.png?alt=media\&token=3075ef51-5848-443a-9798-46055bff6a73)icon.

   * You can even add multiple pages for the above-generated test cases. Click on the **+** symbol and fill in the fields mentioned in the earlier steps.&#x20;
   * Click **OK**.&#x20;
   * Once done, click on the **Save** button to save this page.

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FCeg09TZFZk1a6knMGB8u%2Fimage.png?alt=media&#x26;token=56f4dafa-a59b-4aa7-9cec-9b076f755cb0" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2F72WUEdoXGw9RK5nMz04I%2Fimage.png?alt=media&#x26;token=f42240e5-cd11-432f-a1d5-6e4c57f71a8b" alt=""><figcaption></figcaption></figure>

   <figure><img src="https://1912836914-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9vAxMuDrkUkB4OXlH9CL%2Fuploads%2FXPqG6SzmDFRXOR6N0uui%2Fimage.png?alt=media&#x26;token=7dc5796d-a274-4903-ba42-ca095bcc07cc" alt=""><figcaption></figcaption></figure>
10. Next, Click **Save** to save the template.
11. Once the template is successfully created, you'll be redirected to the **Environment Provisioning History** screen.
12. Click the **Run** button to run the template on your destination org.
13. Select your **destination org** from the dropdown and enter the **email address(es)** to receive an email notification whenever the template is run.
14. In the **Post Deployment Steps**, select the test cases that you have recently created.&#x20;
15. Please check the **View History** page for a detailed summary report of the operation carried out.
