SendGrid
SendGrid is a cloud-based platform intended for delivering transactional and marketing emails.
Data integration: Skyvia supports importing data to and from SendGrid, exporting SendGrid data to CSV files, replicating SendGrid data to relational databases, and synchronizing SendGrid data with other cloud apps and relational databases.
Backup: Skyvia Backup does not support SendGrid.
Query: Skyvia Query supports SendGrid.
Establishing Connection
To create a connection to SendGrid, you need to specify an API Key.
Getting Credentials
To get your API Key, perform the following steps:
- Sign in to SendGrid.
-
Click Settings in the menu on the left.
-
In the drop-down list, click API Keys and copy your API Key.
-
If you don’t have an API Key in your SendGrid account yet, you need to create it and select API Key permissions.
Creating Connection
Paste the obtained API Key to the corresponding box in the Connection Editor.
Additional Connection Parameters
Use Custom Fields
Select this checkbox to make custom fields available in Skyvia.
Connector Specifics
Object Peculiarities
Contact
Due to SendGrid API peculiarities, the INSERT and UPDATE operations work the following way. When you import a record with an existing Email value, the integration updates the corresponding target record. When you import a record with a new Email value, the integration inserts a new record to the target.
It takes several minutes for changes to display in the Contact object.
The ListIds field supports the INSERT operation and does not support the UPDATE operation. To update the ListIds field, you can use the Insert action, map the existing value to the Email field and map the ListId field.
EmailStatistics Objects
To get data from the -EmailStatistics objects (GlobalEmailStatistics, EmailStatisticsByCountry, EmailStatisticsByDeviceType etc.), you must set the filter by StartDate with = (equals) operator only. Optionally, you can add the filter by EndDate. StartDate and EndDate fields are used for filtering only and do not display values when querying.
Suppressions
To import data to the Suppressions object, map the Email field to the values in the array format, for example: ["[email protected]","[email protected]"]
Custom Fields
When you get the data from the CustomFields field of the Contacts object, the data is returned in form of a JSON array with pairs of “custom field name”:”custom field value”.
To successfully import data to custom fields, you must pass the custom field Id instead of name, in the following format: “custom field Id”:”custom field value”.
DML Operations Support
Operation | Objects |
---|---|
INSERT, UPDATE, DELETE | Alerts, API Keys, AuthenticatedDomains, BrandedLinks, Campaign, CancelSheduledSends, ContactLists, Contacts, CustomFields, Designs, Lists, Segments, Senders, SingleSends, Subusers, Templates, TransactionalTemplateVersions, UnsubscribeGroups, VerifiedSenders |
UPDATE, DELETE | CampaignSchedules, Teammates |
INSERT, DELETE | ContactCustomFields, Contacts, ContactSegments, PendingTeammates, ReverseDNS, Suppressions, Unsubscribes |
DELETE | Blocks, Bounces, ContactListRecipients, InvalidEmails, SpamReports |
INSERT | InboundParseSettings, SubuserMonitorSettings |
Incremental Replication and Synchronization
Skyvia supports Replication with Incremental Updates selected for SendGrid objects, which have either the UpdatedDate or CreatedDate field. Thus, such objects as Alerts, Blocks, Bounces, Contacts, ContactListRecipients, Designs, DesignsPre-built, InvalidEmails, Senders, Segments,SingleSends, SpamReports, Suppressions, Templates, TransactionalTemplateVersions, Unsubscribes can be replicated with incremental updates.
Skyvia supports Synchronization for such SendGrid objects as Alerts, Designs, Segments, Senders, SingleSends, Templates, TransactionalTemplateVersions.
Stored Procedures
Skyvia represents part of the supported SendGrid features as stored procedures. You can call a stored procedure, for example, as a text of the command in the ExecuteCommand action in a Target component of a Data Flow or in Query.
If you want to omit the unnecessary parameters, specify the empty value ''
for text or null for numbers.
MailSend
To send emails using SendGrid API, use the command
call MailSend(:Personalizations, :FromEmail, :FromName, :TemplateId, :ReplyToEmail, :ReplyToName, :ReplyToList, :Subject, :Content, :Attachments, :Headers, :CustomArgs, :Categories, :SendAt, :BatchId, :Asm_GroupId, :Asm_GroupsToDisplay, :IPPoolName, :MailSettings_BypassListManagement_Enable, :MailSettings_BypassSpamManagement_Enable, :MailSettings_BypassBounceManagement_Enable, :MailSettings_BypassUnsubscribeManagement_Enable, :MailSettings_Footer_Enable, :MailSettings_Footer_Text, :MailSettings_Footer_HTML, :MailSettings_SandboxMode_Enable, :TrackingSettings_ClickTracking_Enable, :TrackingSettings_ClickTracking_EnableText, :TrackingSettings_OpenTracking_Enable, :TrackingSettings_OpenTracking_SubstitutionTag, :TrackingSettings_SubscriptionTracking_Enable, :TrackingSettings_SubscriptionTracking_Text, :TrackingSettings_SubscriptionTracking_HTML, :TrackingSettings_SubscriptionTracking_SubstitutionTag, :TrackingSettings_GAnalytics_Enable, :TrackingSettings_GAnalytics_UtmSource, :TrackingSettings_GAnalytics_UtmMedium, :TrackingSettings_GAnalytics_UtmTerm, :TrackingSettings_GAnalytics_UtmContent, :TrackingSettings_GAnalytics_UtmCampaign)
PARAMETER NAME | DESCRIPTION |
---|---|
Personalizations | An array of messages and their metadata. Each object within the personalizations array can be thought of as a mail envelope—it defines who should receive an individual message and how that message should be handled. See the examples below. |
FromEmail | The email address from which messages are sent. This address should be a verified sender in your Twilio SendGrid account. |
FromName | A name or title associated with the email address such as “Support” or “Alex”. |
TemplateId | An email template ID. |
ReplyToEmail | An email address to which a message is sent. |
ReplyToName | A name or title associated with the email address such as “Alex”. |
ReplyToList | An array of recipients to whom replies will be sent. Each object in this array must contain a recipient’s email address. |
Subject | The global or message level subject of your email. |
Content | An array of objects, each containing a message body’s content and MIME type. |
Attachments | An array of objects where you can define any attachments to be included with the message. |
Headers | A collection of JSON property name and property value pairs allowing you to specify handling instructions for your email. |
CustomArgs | Values that are specific to the entire send that will be carried along with the email and its activity data. |
Categories | An array of category names assigned to this message. |
SendAt | Date and time that specifies when your email should be sent. |
BatchId | An ID representing a batch of emails to be sent at the same time. |
Asm_GroupId | The unsubscribe group to associate with this email. |
Asm_GroupsToDisplay | An array containing the unsubscribe groups that you would like to be displayed to a recipient on the unsubscribe preferences page. |
IPPoolName | The IP Pool that you would like to send this email from. |
MailSettings_BypassListManagement_Enable | Allows you to bypass all unsubscribe groups and suppressions to ensure that the email is delivered to every single recipient. |
MailSettings_BypassSpamManagement_Enable | Allows you to bypass the spam report list to ensure that the email is delivered to recipients. |
MailSettings_BypassBounceManagement_Enable | Allows you to bypass the bounce list to ensure that the email is delivered to recipients. |
MailSettings_BypassUnsubscribeManagement_Enable | Allows you to bypass the global unsubscribe list to ensure that the email is delivered to recipients. |
MailSettings_Footer_Enable | Indicates if this setting is enabled. |
MailSettings_Footer_Text | The plain text content of your footer. |
MailSettings_Footer_HTML | The HTML content of your footer. |
MailSettings_SandboxMode_Enable | Indicates if this setting is enabled. |
TrackingSettings_ClickTracking_Enable | Indicates if this setting is enabled. |
TrackingSettings_ClickTracking_EnableText | Indicates if this setting should be included in the text/plain portion of your email. |
TrackingSettings_OpenTracking_Enable | Indicates if this setting is enabled. |
TrackingSettings_OpenTracking_SubstitutionTag | Allows you to specify a substitution tag that you can insert in the body of your email at a location that you desire. |
TrackingSettings_SubscriptionTracking_Enable | Indicates if this setting is enabled. |
TrackingSettings_SubscriptionTracking_Text | Text to be appended to the email with the subscription tracking link. |
TrackingSettings_SubscriptionTracking_HTML | HTML to be appended to the email with the subscription tracking link. |
TrackingSettings_SubscriptionTracking_SubstitutionTag | A tag that will be replaced with the unsubscribe URL. |
TrackingSettings_GAnalytics_Enable | Indicates if this setting is enabled. |
TrackingSettings_GAnalytics_UtmSource | Name of the referrer source. |
TrackingSettings_GAnalytics_UtmMedium | Name of the marketing medium. |
TrackingSettings_GAnalytics_UtmTerm | Used to identify any paid keywords. |
TrackingSettings_GAnalytics_UtmContent | Used to differentiate your campaign from advertisements. |
TrackingSettings_GAnalytics_UtmCampaign | The name of the campaign. |
Personalizations value example with template:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
[{
"to": [{
"email": "[email protected]",
"name": "Alex"
},
{
"email": "[email protected]",
"name": "Bola"
}
],
"dynamic_template_data": {
"subject": "Hello, Alex",
"customer_name": "Alex",
"confirmation_number": "123abc456def789hij0"
}
}]
Personalizations value example without template:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
[{
"to": [{
"email": "[email protected]",
"name": "Alex"
},
{
"email": "[email protected]",
"name": "Bola"
}
],
"cc": [{
"email": "[email protected]",
"name": "Charlie"
}],
"bcc": [{
"email": "[email protected]",
"name": "Dana"
}]
},
{
"from": {
"email": "[email protected]",
"name": "Example Sales Team"
},
"to": [{
"email": "[email protected]",
"name": "Ira"
}],
"bcc": [{
"email": "[email protected]",
"name": "Lee"
}]
}
]
Command example:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
call MailSend(
'[
{
"to": [
{
"email": "[email protected]",
"name": "Alex"
},
{
"email": "[email protected]",
"name": "Bola"
}
],
"dynamic_template_data": {
"subject": "Hello, Alex",
"customer_name": "Alex",
"confirmation_number": "123abc456def789hij0"
}
}
]',
'[email protected]', 'DecsCorp',
'd-7c8108b5268e4ac1a4b08ba0aef0a472',
null, null, null, null, null, null,
null, null, null, null, null, null,
null, null, null, null, null, null,
null, null, null, null, null, null,
null, null, null, null, null, null,
null, null, null, null, null, null
)
Supported Actions
Skyvia supports all the common actions for SendGrid.