SUPPORT.TWILIO.COM END OF LIFE NOTICE: This site, support.twilio.com, is scheduled to go End of Life on February 27, 2024. All Twilio Support content has been migrated to help.twilio.com, where you can continue to find helpful Support articles, API docs, and Twilio blog content, and escalate your issues to our Support team. We encourage you to update your bookmarks and begin using the new site today for all your Twilio Support needs.

Customizing SendGrid API Functionality in Segment Destinations

Issue

You want to use the SendGrid API from Segment, but the native SendGrid Actions Destination only supports sending emails with Dynamic Templates. You need a way to use other SendGrid API functionality.

 

Product

Segment

 

Environment

Segment Console

 

Cause

The native SendGrid Actions Destination sends emails only through its Send Email with Dynamic Template action. It doesn't give direct access to other SendGrid API endpoints or features. To use those, you need to call the SendGrid API yourself from a Segment Destination Function.

 

Resolution

Use a Segment Destination Function to call the SendGrid API directly. Destination Functions let you write custom JavaScript that runs when Segment receives an event, so you can send requests to any SendGrid API endpoint your use case needs.

To learn how to create, test, and deploy a Destination Function, see Destination Functions.

 

Additional Information 

If you only need to send emails with SendGrid Dynamic Templates, use the native SendGrid Actions Destination instead. It requires no custom code.

Have more questions? Submit a request
Powered by Zendesk