Insites Documentation

Learn how to leverage the Insites platform to create amazing web applications.

Helpful Resources

Recent Articles

Integrating SendGrid Using API Call Notifications


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 <ins-tag label="&lt;&lt;YOUR_API_KEY&gt;&gt;" color="blue"></ins-tag> with your SendGrid API key.
  • Add the payload based on the attributes in your form.
  • Create a custom (field) attribute in SendGrid called <ins-tag label="contact_via" color="blue"></ins-tag>. Each form on your site provides a unique response that is recorded here.
<ins-code-editor readonly mode="yaml" value="--- name: sendgrid_new_user_homepage delay: '0' format: http request_headers: &gt; { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Authorization&quot;: &quot;Bearer &lt;&lt;YOUR_API_KEY&gt;&gt;&quot; } request_type: POST to: https://api.sendgrid.com/v3/contactdb/recipients --- [ { &quot;email&quot;: &quot;&quot;, &quot;first_name&quot;: &quot;&quot;, &quot;last_name&quot;: &quot;&quot;, &quot;contact_via&quot;: &quot;Home Page Contact Form&quot; } ]"> </ins-code-editor> <doc-quote type="note"> <div> <span class="icon-notepad-1"></span> <span class="box-title">Note</span> </div> <p> The documentation concerning <a href="https://docs.insites.io/developers-guide/response-headers">Response Headers</a> could be a valuable resource for you. </p> </doc-quote>

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"> </ins-code-editor>

Step 3: Create segments in SendGrid

Create segments in SendGrid and filter using the <ins-tag label="contact_via" color="blue"></ins-tag> 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: <ins-tag label='"v=spf1 a mx include:_spf.google.com include:spf.protection.outlook.com ~all"' color="blue"></ins-tag>

You can add: <ins-tag label="include:sendgrid.net" color="blue"></ins-tag>

before the <ins-tag label="~all" color="blue"></ins-tag> at the end.

This action will result in: <ins-tag label='"v=spf1 a mx include:_spf.google.com include:spf.protection.outlook.com include:sendgrid.net ~all"' color="blue"></ins-tag>

<doc-quote type="note"> <div> <span class="icon-notepad-1"></span> <span class="box-title">Note</span> </div> <p> You can learn more about this method by visiting the following documentation: <a href="https://docs.sendgrid.com/ui/account-and-settings/spf-records" target="_blank" rel="external noopener" onclick='return confirm("This link will open in new tab.")'>SPF Records Explained</a>.</p> </doc-quote>

Solution 2

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

Integrating Mailchimp Using API Call Notifications

This document helps you create a Mailchimp integration for Insites using API Call Notifications.


Prerequisites

To follow this tutorial, you must be able to create API Call Notifications. In addition, you must know how to manage integrations and have a Mailchimp account where you can find your API key.


Steps

Integrating Mailchimp using API Call Notifications is a two-step process:

  • Step 1: Create an API call notification
  • Step 2: Add API call notifications to forms

Step 1: Create an API call notification

Create an API Call Notification:

  • Replace <ins-tag label="&lt;&lt;YOUR_API_KEY&gt;&gt;" color="blue"></ins-tag> with your Mailchimp API key
  • Replace <ins-tag label="&lt;&lt;YOUR_DC_KEY&gt;&gt;" color="blue"></ins-tag> with the last part of your Mailchimp API key (the part after the <ins-tag label="-" color="blue"></ins-tag>, for example, <ins-tag label="xxxxxxxxxxxxxxxxxxxxxxxxxx-us3" color="blue"></ins-tag> where <ins-tag label="us3" color="blue"></ins-tag> is the DC_KEY)
  • Replace <ins-tag label="&lt;&lt;YOUR_AUDIENCE_ID&gt;&gt;" color="blue"></ins-tag> with your Mailchimp Audience ID. Follow the steps outlined in Mailchimp: Find your Audience ID.
  • Add the payload based on the attributes in your form.
<ins-code-editor readonly mode="yaml" value="--- name: mailchimp_new_host to: 'https://&lt;&lt;YOUR_DC_KEY&gt;&gt;.api.mailchimp.com/3.0/lists/&lt;&lt;YOUR_AUDIENCE_ID&gt;&gt;/members/' format: http request_type: POST request_headers: &gt; { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Authorization&quot;: &quot;apikey &lt;&lt;YOUR_API_KEY&gt;&gt;&quot; } --- { &quot;email_address&quot;:&quot;&quot;, &quot;status&quot;:&quot;subscribed&quot;, &quot;merge_fields&quot;: { &quot;FNAME&quot;: &quot;&quot;, &quot;LNAME&quot;: &quot;&quot; } }"> </ins-code-editor>

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: - mailchimp_new_host"> </ins-code-editor>

Integrating ActiveCampaign Using API Call Notifications

This guide demonstrates creating an ActiveCampaign integration for Insites using API call notifications.


Prerequisites

To understand this tutorial, you must be able to create API Call Notifications. In addition, you must know how to manage third-party systems and have an ActiveCampaign account where you can find your API key.


Steps

Integrating ActiveCampaign using API call notifications is a two-step process:

  • Step 1: Create an API call notification
  • Step 2: Add the API call notification to forms

Step 1: Create an API call notification

Create an API Call Notification:

  • Obtain your ActiveCampaign API URL and API Key by following the steps outlined in How to obtain your ActiveCampaign API URL and Key.
  • Replace <ins-tag label="&lt;&lt;YOUR_API_KEY&gt;&gt;" color="blue"></ins-tag> with your ActiveCampaign API key.
  • Replace <ins-tag label="&lt;&lt;YOUR_ACCOUNT_URL&gt;&gt;" color="blue"></ins-tag> with your account URL.
  • Add the payload based on the attributes in your form.
<ins-code-editor readonly mode="yaml" value="--- name: active_campaign_new_host to: &lt;&lt;YOUR_ACCOUNT_URL&gt;&gt;/api/3/contacts delay: '0' format: http request_type: POST request_headers: &gt; { &quot;Content-Type&quot;: &quot;application/json&quot;, &quot;Api-Token&quot;: &quot;&lt;&lt;YOUR_API_KEY&gt;&gt;&quot; } --- { &quot;contact&quot;: { &quot;email&quot;: &quot;&quot;, &quot;firstName&quot;: &quot;&quot;, &quot;lastName&quot;: &quot;&quot; } }"> </ins-code-editor>

Step 2: Add the API call notification to forms

Add the following to the front matter on your form:

<ins-code-editor readonly auto-height mode="yaml" value="api_call_notifications: - active_campaign_new_host"> </ins-code-editor>