Integrations and Connectors/Connectors/Setup Guides/Messaging

SendGrid Connector

Using Descope's connectors allows you to use SendGrid, a cloud-based SMTP provider that allows you to send emails without having to maintain email servers, in your authentication flow. This article will go through setting up the connector and including it in your flow.

Configure SendGrid connector

Descope uses your SendGrid API Key and Sender address to integrate with our service. Start at your dashboard. Navigate to the SendGrid connector: Dashboard -> Connectors -> SendGrid

Now, complete the required fields:

  • Connector name: Custom name for your connector. This will come in handy when creating multiple connectors from the same connector template.
  • API Key: The API key used to authenticate with SendGrid services.
  • 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.
  • Connector description: (Optional) Describe what your connector is used for.

Dynamic Value Configuration

You may want to dynamically configure sender details depending on the tenant sending the message.

To do so, configure the value of Sender Address or Sender Name to be {{options_<dynamic-val>}}, replacing <dynamic-val> with the name of the dynamic value you would like to utilize.

Refer to the Template Options doc to learn how to set these dynamic values when using messaging connectors with our Flows or SDKs.

Testing

You can test if your connector's configuration is working properly simply by hitting the Test button and viewing the Test Results panel.

Descope example sendgrid connector configuration

Save your configuration by hitting Create.

Add your SendGrid connector to a flow

Navigate to: Flows, choose your flow. Then, tap the create button (designated via the + icon), select Connector, and choose SendGrid.

Click to set down the connector in your flow editor and fill out the fields:

  • To: Who the email 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.
  • Subject: Enter the subject of the email.
  • Body: Enter the body text of the email.

Descope example sendgrid connector configuration within flow

Now, link your connector at a logical point in your authentication flow, likely at the end of the flow after email has been submitted by the user.

SendGrid connector placement

That's it! Whenever a user goes through your authentication flow, the SendGrid connector will be automatically triggered.

Was this helpful?

On this page