Lodol Docs

SendGrid

API actions for the SendGrid integration.

SendGrid

Send emails and manage your marketing contacts in SendGrid.


Add contact to list

Add contacts to a SendGrid marketing list.

Parameters

ParameterTypeRequiredDescription
emailstringYesContact email address to add.
list_idsarrayYesMarketing list IDs to add the contact to.

Response

{
  "job_id": "job_987"
}

Create marketing list

Create a marketing list for SendGrid contacts.

Parameters

ParameterTypeRequiredDescription
namestringYesList name.

Response

{
  "contact_count": 0,
  "id": "list_789",
  "name": "My List"
}

Get email stats

Retrieve SendGrid email statistics for a date range.

Parameters

ParameterTypeRequiredDescription
start_datestringYesStart date (YYYY-MM-DD).
end_datestringYesEnd date (YYYY-MM-DD).

Response

{
  "stats": [
    {
      "date": "2024-01-01",
      "stats": [
        {
          "metrics": {
            "clicks": 10,
            "delivered": 95,
            "opens": 50,
            "requests": 100
          }
        }
      ]
    }
  ]
}

List templates

List SendGrid email templates.

Response

{
  "result": [
    {
      "id": "tmpl_123",
      "name": "Welcome Email"
    }
  ]
}

Send email

Send an email through SendGrid.

Parameters

ParameterTypeRequiredDescription
from_emailstringYesSender email address.
to_emailstringYesRecipient email address.
subjectstringYesEmail subject.
text_contentstringYesPlain text email content.
html_contentstringNoOptional HTML email content.
ccarrayNoOptional CC email addresses.
bccarrayNoOptional BCC email addresses.

Response

{
  "status_code": 202
}

Send template email

Send an email built from a saved SendGrid template.

Parameters

ParameterTypeRequiredDescription
from_emailstringYesSender email address.
to_emailstringYesRecipient email address.
template_idstringYesThe ID of the SendGrid template to use.
dynamic_dataobjectNoValues to fill into the template's placeholders.

Response

{
  "status_code": 202
}

On this page