Insites Docs Articles Integrating SendGrid Using API Call Notifications
TECHNOLOGY

Integrating SendGrid Using API Call Notifications

Published on March 27, 2023, updated on September 05, 2023
header image

This document demonstrates creating a SendGrid integration for Insites using API call notifications.

When a user fills out a form on your Insites application, you need to have that user added to the correct SendGrid Segment so you can provide them with the correct marketing campaign. This guide explains how to create an API Call Notification for each form on your site that sends the user’s info to SendGrid and creates a custom (field) attribute in SendGrid to allow the user to be added to the correct segment.


Prerequisites

To understand this tutorial, you must be familiar with creating API call notifications, have access to SendGrid, and understand the SendGrid API. In addition, you must know how to create segments in SendGrid.


Steps

Integrating SendGrid using API Call Notifications is a three-step process:

  • Step 1: Create an API call notification
  • Step 2: Add API call notifications to forms
  • Step 3: Create segments in SendGrid

Step 1: Create an API call notification

Create an API Call Notification:

  • Replace with your SendGrid API key.
  • Add the payload based on the attributes in your form.
  • Create a custom (field) attribute in SendGrid called . Each form on your site provides a unique response that is recorded here.
Note

The documentation concerning Response Headers could be a valuable resource for you.


Step 2: Add API call notifications to forms

Add the following to the front matter on your form:

<ins-code-editor
readonly
auto-height
mode='yaml'
value='api_call_notifications:

  • sendgrid_new_user_homepage'>

Step 3: Create segments in SendGrid

Create segments in SendGrid and filter using the attribute.


Troubleshooting

Use this section to troubleshoot common issues encountered when integrating SendGrid using API call notifications.


Emails getting stuck in spam folders/filters

You can make some tweaks to your DNS records to help ensure that your emails are getting to your users' inboxes and not getting caught up in their spam folders/filters.


Solution 1

Add the sendgrid.net lookup to your current SFP record for your domain.

Example

If your current record (TXT or SPF) is:

You can add:

before the at the end.

This action will result in:

Note

You can learn more about this method by visiting the following documentation: SPF Records Explained.


Solution 2

Add DKIM records to your DNS records as described here: DKIM Records Explained.

Stay up to date with Insites

Subscribe to our newsletter for the latest news and product updates straight to your inbox.