CAI + SendGrid Quick Start Guide

Version 2

    Overview

    This a guide that will walk through setting up an integration between Informatica’s Cloud Application Integration (CAI) service with the SendGrid platform to send simple and Templated Emails. There are several pre-built CAI assets included in this guide to get you started quickly.

     

    What is SendGrid?

    SendGrid is a popular cloud communications platform as a service that enables you to programmatically send emails via APIs.

     

    Why use SendGrid?

    This communications method is a powerful tool for many integration scenarios and is a great fit for App modernization using CAI. Some examples in our daily lives include things like:

    • Getting email alerts from banking transactions
    • Getting food delivery updates via email
    • Receiving two factor authentication codes
    • And many more
    • An IICS Trial or production account
    • A SendGrid Trial or production account
      • Have your Bearer API Token when setting up the configuration in CAI.
      • Create a Dynamic Template and dynamic tags that can be used with the Templates API.

     

    Pre-Requisites

    • An IICS Trial or production account
    • A SendGrid Trial or production account
      • Have your Bearer API Token when setting up the configuration in CAI.
      • Create a Dynamic Template and dynamic tags that can be used with the Templates API.

     

    Importing the Assets

    Import the assets attached below.

    Click here for a video guide on how to import assets into IICS.

     

    Assets included in the Import Package

    1. SendGridSrcConnector
      • Type: Service Connector
      • Details: This asset defines the actions available with the SendGrid API service to send a basic email. SendEmail  and SendEmailTempate are the actions available for this Service Connector.
    2. SendGridAppConnection
      • Type: App Connection
      • Details: This asset defines the connection details (authentication credentials) needed for the SendGridSrcConnector.
    3. SendGridBasicProcess
      • Type: Process
      • Details: A simple process that calls the SendGridAppConnection to send a basic email using the SendGrid API.
    4. SendGridTemplateProcess
      • Type: Process
      • Details: A simple process that calls the SendGridAppConnection to send a templated email using the SendGrid API.

     

    Configuring the assets

    Once the assets are imported, you should configure and publish the assets in the following order:

    1. SendGridSrcConnector
      1. Inputs:
        1. Add/Update/remove the DynamicTag field names with the dynamic tags you are using in your SendGrid Dynamic Template.
        2. Update the appropriate “test with” fields with the values you will use.
      2. Publish the connector
    2. SendGridAppConnection:
        1. Select the SendGridSrcConnector asset we just published.
      1. Connection Properties
        1. Update the BearerToken value with the Bearer Token for your SendGrid account.
      2. Save and test the connection.
      3. Verify that the appropriate actions available in the Metadata tab.
      4. Publish the App Connection.
    3. SendGrid_Basic_Process:
      1. Verify the process is using the published SendGridAppConnection and the appropriate inputs are matched to the needed input in the “Basic Email API Call” Service step.
      2. Save and Publish the process.
    4. SendGrid_Template_Process:
      1. Start:
        1. Input Fields:
          1. Remove place holder Dynamic_Tag input fields
          2. Add the input field names you wish to use for your Dynamic Tags in your SendGrid template(s).
      2. Verify the process is using the published SendGridAppConnection and the appropriate inputs are matched to the needed input in the “Template Email API Call” Service step.
      3. Save and Publish the process.

     

    Using the Assets

    The assets provided here offer some basic examples of how you could send an Email via SendGrid using a process built in CAI.

     

    Sending a Basic Email:

    1. Run the SendGrid_Basic_Process directly in the process, or via the API generated. The inputs required are:
      • EmailTo: The Email address it’s being sent to.
        Note: For Testing, try sending the email to a Mailinator public inbox. Most email addresses will see the email as suspicious unless you’ve set up a DMARC record from your SendGrid account in the domain the email will be sent from).
      • EmailFrom: The Email address it’s being sent from.
      • Subject: The Subject line of the Email.
      • MessageType: The format of the message.  (Using “text/plain” is fine if you don’t want to send images)
      • MessageBody: The body of the email being sent.
    2. You should receive an email with the provided subject and body in the defined inbox.
    3. Run the SendGrid_Template_Process directly in the process, or via the API generated. The inputs required are:
      • EmailTo: The Email address it’s being sent to.
        Note: For Testing, try sending the email to a Mailinator public inbox. Most email addresses will see the email as suspicious unless  you’ve set up a DMARC record from your SendGrid account in the domain the email will be sent from).
      • EmailFrom: The Email address it’s being sent from.
      • TemplateID: The Template ID that can be found on the Dynamic Templates page you created in SendGrid that you wish to use.
      • {Your_Dynamic_Tag}: The dynamic tags you added to be used as variables in your SendGrid Dynamic Template.
    4. You should receive a template email using the dynamic tag inputs you submitted in the defined inbox.

     

    Sending a Template Email:

    1. Run the SendGrid_Template_Process directly in the process, or via the API generated. The inputs required are:
      • EmailTo: The Email address it’s being sent to.
        Note: For Testing, try sending the email to a Mailinator public inbox. Most email addresses will see the email as suspicious unless  you’ve set up a DMARC record from your SendGrid account in the domain the email will be sent from).
      • EmailFrom: The Email address it’s being sent from.
      • TemplateID: The Template ID that can be found on the Dynamic Templates page you created in SendGrid that you wish to use.
      • {Your_Dynamic_Tag}: The dynamic tags you added to be used as variables in your SendGrid Dynamic Template.
    2. You should receive a template email using the dynamic tag inputs you submitted in the defined inbox.