Skip to main content

SendGrid Component

Send emails through SendGrid

Component key: sendgrid

Description#

SendGrid is an email delivery service. This component allows you to send of emails through the SendGrid platform.

SendGrid Connections#

SendGrid API Key#

Information about getting started and creating API keys with SendGrid can be found on their developer documentation site.

InputNotes
Input
API Key
string
/ Required
apiKey
Notes
Provide the API Key obtained from the developer console.

Triggers#

Webhook#

Trigger for handling webhooks from Sendgrid | key: webhook

You can configure a SendGrid event webhook to send information to a Prismatic webhook URL when an email is received.

Output Example Payload#

{  "payload": {    "headers": {      "accept": "*/*",      "Content-Type": "application/json; charset=UTF-8",      "User-Agent": "SendGrid Event API",      "Host": "hooks.example.prismatic.io"    },    "body": {      "data": [        {          "email": "someone@prismatic-example.com",          "timestamp": "1635784924",          "smtp-id": "<example.dfd.64b469@ismtpd-555>",          "event": "processed",          "category": ["Example Email Category"],          "sg_event_id": "WoOMEuhb-Mj_LEKrp8bC4g==",          "sg_message_id": "14c5d75ce93.dfd.64b469.filter0001.16648.5515E0B88.0"        }      ]    },    "rawBody": {      "data": { "type": "Buffer", "data": [69, 120, 97, 109, 112, 108, 101] }    },    "queryParameters": None,    "webhookUrls": {      "Flow 1": "https://hooks.example.prismatic.io/trigger/EXAMPLEGbG93Q29uZmlnOmRlNmNmNDMyLTliNWMtN0005NDMxLTRmYzA4ZjViODgxOA=="    },    "webhookApiKeys": { "Flow 1": ["abc-123"] },    "customer": {      "externalId": "customer-example-external-id",      "name": "John Doe"    }  }}

Actions#

Send Email#

Send a single email to one or more recipients | key: sendEmail

InputDefaultNotesExample
Input
BCC
string
bcc
Default
 
Notes
The recipient's email address, or a comma-separated list of recipient email addresses to BCC
Example
alex.cooper@progix.io,kristin.henry@progix.io
Input
CC
string
cc
Default
 
Notes
The recipient's email address, or a comma-separated list of recipient email addresses to CC
Example
alex.cooper@progix.io,kristin.henry@progix.io
Input
Attachment Content
data
content
Default
 
Notes
Provide attachment data to send with the email.
Example
 
Input
Content Id
string
contentId
Default
 
Notes
Provide the content Id of the attachment. This value is only required when you select 'inline'
Example
12345
Input
Disposition
string
disposition
Default
 
Notes
Specifies how you would like the attachment to be displayed.
Example
 
Input
File Name
string
fileName
Default
 
Notes
Provide a name for the file to attach.
Example
reports.csv
Input
File Type
string
fileType
Default
 
Notes
The MIME type of the content you are attaching
Example
text/plain
Input
From Email
string
/ Required
fromEmail
Default
 
Notes
The sender's email address
Example
susan.smith@progix.io
Input
From Name
string
fromName
Default
 
Notes
The sender's name
Example
John Doe
Input
HTML
text
html
Default
 
Notes
The optional HTML body of the email
Example
Hello from <b>Prismatic!</b>
Input
Personalizations
code
personalizations
Default
[]
Notes
You can use this field to overwrite multiple properties of the email. For examples of which properties to use, checkout the SendGrid docs: https://docs.sendgrid.com/for-developers/sending-email/personalizations
Example
[  {    "to": [      {        "email": "john@example.com"      }    ],    "send_at": 1600188812  },  {    "to": [      {        "email": "jane@example.com"      }    ],    "send_at": 1600275471  }]
Input
Reply To Email
string
replyToEmail
Default
 
Notes
Email To Reply To
Example
susan.smith@progix.io
Input
Reply To Name
string
replyToName
Default
 
Notes
Name to reply to. This field is only required when you provide a value for Reply To Email.
Example
John Doe
Input
Connection
connection
/ Required
sendGridConnection
Default
 
Notes
 
Example
 
Input
Subject
string
/ Required
subject
Default
 
Notes
The email subject line
Example
Hello from Prismatic!
Input
Text
text
/ Required
text
Default
 
Notes
The text body of the email
Example
Here's the body of a notification.
Input
To
string
/ Required
to
Default
 
Notes
The recipient's email address, or a comma-separated list of recipient email addresses
Example
alex.cooper@progix.io,kristin.henry@progix.io

Output Example Payload#

{  "data": [    {      "body": {        "message": "Example"      },      "statusCode": 200,      "headers": {}    },    {}  ]}

Send Multiple Emails#

Send a separate email to each recipient | key: sendMultipleEmails

InputDefaultNotesExample
Input
BCC
string
bcc
Default
 
Notes
The recipient's email address, or a comma-separated list of recipient email addresses to BCC
Example
alex.cooper@progix.io,kristin.henry@progix.io
Input
CC
string
cc
Default
 
Notes
The recipient's email address, or a comma-separated list of recipient email addresses to CC
Example
alex.cooper@progix.io,kristin.henry@progix.io
Input
Attachment Content
data
content
Default
 
Notes
Provide attachment data to send with the email.
Example
 
Input
Content Id
string
contentId
Default
 
Notes
Provide the content Id of the attachment. This value is only required when you select 'inline'
Example
12345
Input
Disposition
string
disposition
Default
 
Notes
Specifies how you would like the attachment to be displayed.
Example
 
Input
File Name
string
fileName
Default
 
Notes
Provide a name for the file to attach.
Example
reports.csv
Input
File Type
string
fileType
Default
 
Notes
The MIME type of the content you are attaching
Example
text/plain
Input
From Email
string
/ Required
fromEmail
Default
 
Notes
The sender's email address
Example
susan.smith@progix.io
Input
From Name
string
fromName
Default
 
Notes
The sender's name
Example
John Doe
Input
HTML
text
html
Default
 
Notes
The optional HTML body of the email
Example
Hello from <b>Prismatic!</b>
Input
Personalizations
code
personalizations
Default
[]
Notes
You can use this field to overwrite multiple properties of the email. For examples of which properties to use, checkout the SendGrid docs: https://docs.sendgrid.com/for-developers/sending-email/personalizations
Example
[  {    "to": [      {        "email": "john@example.com"      }    ],    "send_at": 1600188812  },  {    "to": [      {        "email": "jane@example.com"      }    ],    "send_at": 1600275471  }]
Input
Reply To Email
string
replyToEmail
Default
 
Notes
Email To Reply To
Example
susan.smith@progix.io
Input
Reply To Name
string
replyToName
Default
 
Notes
Name to reply to. This field is only required when you provide a value for Reply To Email.
Example
John Doe
Input
Connection
connection
/ Required
sendGridConnection
Default
 
Notes
 
Example
 
Input
Subject
string
/ Required
subject
Default
 
Notes
The email subject line
Example
Hello from Prismatic!
Input
Text
text
/ Required
text
Default
 
Notes
The text body of the email
Example
Here's the body of a notification.
Input
To
string
/ Required
to
Default
 
Notes
The recipient's email address, or a comma-separated list of recipient email addresses
Example
alex.cooper@progix.io,kristin.henry@progix.io

Output Example Payload#

{  "data": [    {      "body": {        "message": "Example"      },      "statusCode": 200,      "headers": {}    },    {}  ]}