I found a previous thread related to this, but it ...
# ask-a-descoper
d
I found a previous thread related to this, but it doesn't show if it was ever resolved. I'm trying to use a dynamic Sender Address for the sendgrid connector. The documentation states that it should work, but I haven't been able to get to work. 2. Check Connector Configuration: In your SMTP connector settings, verify the exact format: - Sender Address:
{{options_senderEmail}}
- Sender Name:
{{options_senderName}}
✅ 1
d
SendGrid Connector Dynamic Sender Configuration The
{{options_senderEmail}}
format is correct for dynamic sender addresses . Here's how to troubleshoot and properly configure it: Verify Connector Configuration 1. In your SendGrid connector settings, confirm the exact format: - Sender Address:
{{options_senderEmail}}
- Sender Name:
{{options_senderName}}
2. Ensure the sender address is properly registered in your SendGrid account Set Template Options When using the connector in flows or SDKs, you must provide the dynamic values: In Flows: 1. Select your messaging action 2. Click
+
to add template options 3. Add key-value pairs: - Key:
senderEmail
- Value:
<mailto:your-sender@domain.com|your-sender@domain.com>
In SDKs:
Copy code
await descopeClient.magicLink.signUpOrIn(
  "<mailto:user@example.com|user@example.com>",
  "<https://your-app.com/verify>",
  {
    templateOptions: {
      senderEmail: "<mailto:noreply@yourdomain.com|noreply@yourdomain.com>",
      senderName: "Your Company"
    }
  }
);
Testing Steps 1. Use the Test button in your connector configuration 2. Check the Test Results panel for any errors 3. Verify that template options are being passed correctly when the connector is used • The dynamic value format uses
{{options_<key>}}
where
<key>
matches your template option key • Template options must be set when calling the messaging action Descope SendGrid Connector | Descope Documentation Customize Auth Messaging Templates | Descope Documentation
d
When adding the key-value pair, you show the value as a static email address, not a dynamic one. Shouldn't the value display as SenderEmail?
d
You're absolutely right. I made an error in my example. Correct Template Options Configuration When setting up template options in flows, the value should reference the dynamic source, not a static email address. In Flows: 1. Select your messaging action 2. Click
+
to add template options 3. Add key-value pairs using dynamic values: - Key:
senderEmail
- Value:
{{user.customAttributes.senderEmail}}
or
{{tenant.senderEmail}}
or another dynamic source Common Dynamic Value Sources: •
{{user.email}}
- User's email address •
{{user.customAttributes.companyEmail}}
- Custom user attribute •
{{tenant.senderEmail}}
- Tenant-specific sender •
{{form.senderEmail}}
- From flow input form In SDKs:
Copy code
await descopeClient.magicLink.signUpOrIn(
  "<mailto:user@example.com|user@example.com>",
  "<https://your-app.com/verify>",
  {
    templateOptions: {
      senderEmail: userCompanyEmail, // Variable containing the dynamic email
      senderName: userCompanyName
    }
  }
);
The connector configuration
{{options_senderEmail}}
will then resolve to whatever dynamic value you set in the template options, not a hardcoded email address.