Configure an email provider Action using the Auth0 Dashboard
To use the Auth0 Dashboard to configure your tenant with a custom email provider Action:- Go to Auth0 Dashboard > Branding > Email Provider.
- Enable the Use my own email provider toggle.
- In the Email Provider Section, select Custom Provider.
- In the From field, enter the default email address from which emails are sent.
- In the code editor, write your Action code to deliver messages to your email provider. Use your provider’s documentation on their API or SMTP connection details. In the left menu of the code editor, you can click the key icon to add secrets (for example, to authenticate with an API) and click the box to add dependencies.
- When you’re finished writing the Action, click Save to deploy it.
Configure an email provider Action using Terraform
The Terraform Auth0 provider uses the Auth0 Management API to perform actions on the Auth0 platform. You can use the Terraform Auth0 provider to create a custom email provider Action and configure your tenant to use it.1. Unbind or delete conflicting Actions
You can have at most one Action bound to thecustom-email-provider trigger.
If your tenant is already configured with a custom email provider Action, reset it before creating a new email provider Action with Terraform:
- Go to Auth0 Dashboard > Branding > Email Provider.
- In the Email Provider section, click Custom Provider.
- Below the Actions code editor, click Reset.
custom-email-provider trigger using the Management API:
- List your Actions to identify any duplicate Actions.
- Update their trigger bindings or delete the Actions.
2. Create a new email provider Action
Use the Terraformauth0_action resource to create an Action that supports the custom-email-provider trigger. Set deploy = true to immediately create a new version of the Action.
3. Bind the Action to the email provider trigger
Use the Terraformauth0_trigger_action resource to bind the Action to the custom-email-provider trigger:
4. Configure your tenant’s email provider with the Action
Use the Terraformauth0_email_provider resource to configure your tenant to use the email provider Action:
custom-email-provider trigger. To troubleshoot and fix this issue, follow the first step of this article to unbind or delete conflicting Actions.
Example Email Provider Action
This is an example Action for thecustom-email-provider trigger.
In this code sample, the function onExecuteCustomEmailProvider takes two arguments from the custom-email-provider event object: event, which contains information about the user and the context of the notification, and api, which provides helper methods for custom behavior while sending notifications.