Mandrill Connector
Using Descope's connectors allows you to use Mandrill to send email messages with your own Mandrill account and trigger these actions within the authentication flow. This article will guide you through setting up and using the Mandrill connector.
Configure Mandrill connector
Descope uses your Mandrill API key and sender details for integration.
To configure a Mandrill connector, go to the Connectors page within the Descope Console, search for Mandrill, and select the connector tile.
Settings
Below is a list of applicable settings for the Mandrill connector.
- Connector name: Custom name for your connector. This will come in handy when creating multiple connectors from the same connector template.
- Connector Description: (Optional) Describe what your connector is used for.
- API Key: Mandrill API Key. To obtain this, go to the Mandrill "SMTP & API Info" Page.
- Sender address: The email address from which the emails are going to be sent. Make sure those are registered properly in your server.
- Sender name: (Optional) The name of the sender to be added to sender address.
- Email: Use this email for testing.
You can test if your connector's configuration is working properly simply by hitting the Test
button and viewing the Test Results
panel.
Save your configuration by hitting Create.
Add your Mandrill connector to a flow
Configure Mandrill as the Default OTP Connector
To configure Mandrill as your default connector for the various OTP auth methods for email, navigate to OTP within Authentication Methods, and select the configured Mandrill connector. You can further configure the default OTP template for your Mandrill messages; for more details, see our guide for Using Email and SMS Templates.
Once you have configured Mandrill as the default connector within the OTP Auth method, Descope flows and any OTP calls via the API/SDK will utilize Mandrill for OTP verification.
Using Mandrill Explicitly in Flows
To override the default OTP connector within your flow to utilize Mandrill, navigate to
Flows and choose your flow. Once you are in the flow that you'd like to use Mandrill, select
and edit the action that starts the OTP process, such as Sign In, Sign Up, or Sign Up or In with OTP via Email. If you have not yet added the OTP action, you can do so by clicking the blue +
icon at the top left, searching and
selecting the OTP action, and then selecting and editing the initiating action.
In this example, we will update the Sign Up or In / OTP / Email
action to utilize the Mandrill connector and override the
configured default for the OTP auth method.
Once in edit mode for the initiating OTP action, select the dropdown for the connector and choose your Mandrill connector. After selecting the Mandrill connector, click done, and save your flow. You can also select a customized template; for more details, see our guide for Using Email and SMS Templates. This action within your flow will utilize the Mandrill connector and override the configured default OTP connector.
Sending Custom Messages via Mandrill in Flows
There may be a use case where you want to send an email message as part of your Descope flow that is not directly related to the OTP Auth flow; this section will describe how to use Mandrill to send custom messages.
Navigate to: Flows, choose your flow. Then, tap the create button
(designated via the +
icon), select Connector, and choose Mandrill.
Click to set down the connector in your flow editor and double click the action to add required fields:
- To: Who the message should be sent to. Setting this dynamically based on previous attributes is recommended (eg.
{{user.email}}
). As you type in the input field, options appear. - Message content: Enter the content of the email.
Now, link your connector at a logical point in your authentication flow, likely at the end of the flow after the email has been submitted by the user.
That's it! Whenever a user goes through your authentication flow, the Mandrill connector will be automatically triggered.