SendGrid

Connect SendGrid to power email triggers in Skrym

SendGrid is the provider used for email triggers in Skrym. Once connected, you can choose SendGrid dynamic templates for milestone-based emails in your order journeys.

Info

This integration currently supports dynamic templates only. Legacy templates are not supported.

Before you start

You will need:

  1. An active SendGrid account
  2. A SendGrid API key with permission to send mail and read templates
  3. At least one dynamic template in SendGrid

For how email triggers work in Skrym, what data is sent to templates, and example payload usage, see the email triggers documentation.

Create a SendGrid API key

To connect Skrym with SendGrid:

  1. Log in to your SendGrid account
  2. Navigate to Settings > API Keys
  3. Click Create API Key
  4. Give the key a descriptive name, for example Skrym Integration
  5. Choose Restricted Access and grant at least:
    • Mail Send: Full Access
    • Template Engine: Read Access
  6. Click Create & View
  7. Copy the API key immediately

If needed, refer to the official SendGrid documentation on API keys.

Warning

Your API key is encrypted before being stored in Skrym. After saving it, you can update or replace it later, but you cannot view the original value again from Skrym.

Connect SendGrid in Skrym

  1. Open Integrations in the Skrym dashboard
  2. Go to the Systems tab
  3. Find SendGrid and click Configure or Connect
  4. Enter:
    • Name: A descriptive label for the integration
    • API Key: The API key you created in SendGrid
  5. Click Save

Test the connection

After saving, use Test Connection to verify the integration.

If the test succeeds, Skrym fetches your dynamic templates from SendGrid and shows:

  • Template preview thumbnails when available
  • Template names
  • Template IDs
  • Number of template versions

This is the easiest way to confirm both API access and template visibility before configuring journey triggers.

Using SendGrid with email triggers

After the integration is connected:

  1. Open your order journey milestone in Skrym
  2. Add or edit an email trigger
  3. Select the SendGrid integration
  4. Map a SendGrid template ID per language where needed

Skrym then sends the trigger payload to SendGrid when that milestone is completed.

SendGrid-specific notes

  • Skrym uses the tracked order's recipientEmail as the recipient when it is available.
  • Template localization is selected from the tracked order's recipientLocalePreference when present. Otherwise, Skrym falls back to the destination location country, then the tracked order destination country code, and finally English.
  • Template IDs are configured per language in the trigger, and Skrym falls back to the default template when no exact locale match is configured.
  • Template authoring in SendGrid uses Handlebars syntax.

Template authoring tips

  • Keep the email structure and branding in SendGrid, not in Skrym.
  • Use the trigger payload from the tracking docs as the source of truth for available variables.
  • Start with a minimal template that renders trigger, order, and localized date fields before adding more advanced conditional content.

Example SendGrid template

SendGrid dynamic templates use Handlebars syntax. The example below focuses on SendGrid-specific template authoring and assumes the payload described in the email triggers documentation.

<h1>Your order is on the move</h1>
<p>
{{#if order.destination.name}}
Hi {{order.destination.name}},
{{else}}
Hi,
{{/if}}
</p>
<p>
Your order reached the milestone <strong>{{trigger.milestoneReference}}</strong>.
</p>
{{#if formattedData.order.dates.orderPromisedDeliveryTimeEnd}}
<p>
Expected delivery: {{formattedData.order.dates.orderPromisedDeliveryTimeEnd.dateOnly}}
</p>
{{/if}}
{{#if formattedData.order.transportMethodName}}
<p>
Shipping method: {{formattedData.order.transporterName}} - {{formattedData.order.transportMethodName}}
</p>
{{/if}}
{{#each formattedData.shipments}}
{{#if this.trackingReference}}
<p>
Tracking number: {{this.trackingReference}}
</p>
{{/if}}
{{#if this.trackingUrl}}
<p>
<a href="{{this.trackingUrl}}">Track your shipment</a>
</p>
{{/if}}
{{/each}}

This kind of example is a good starting point for validating that your SendGrid template can:

  • Read nested values from the Skrym payload
  • Use Handlebars conditionals such as if
  • Iterate collections such as order.shipments
  • Use preformatted values directly from formattedData

Note that the payload uses JSON field names from the API response, so template paths are lowercase like order.order, order.destination, and order.shipments.

For the available template data, example JSON, formatted date fields, and Handlebars examples, continue in the email triggers documentation.