Stencil Documentation
  • General
  • API
    • Authentication
      • Account
    • Pagination
    • Status Code and Throttling
    • Endpoints
      • Projects
      • Templates
      • Images
      • Collections
      • PDFs
      • Airtable
    • Charts
  • Using Stencil
    • Template Editor (New)
    • Template Editor (Legacy)
      • Limited Markdown Supports
      • Anchoring Element
      • Using Custom Font
      • Circular Text Positioning
    • White Label for Business
      • Setting Up Your First Client
      • DNS Setup with Cloudflare
  • Guides
    • Airtable Integration
      • Basic
    • Integromat Integration
      • Connection
      • Instant Trigger
    • Zapier Integration
      • Authentication
      • Trigger - New Image
      • Action - Create Image
    • Secure Signed Image
      • Basic
    • Query String Integration
      • Basic
      • Cache
    • Forms Integration
    • Case Studies
      • Generate Instagram Post from WooCommerce
      • Generate Open Graph Image for WordPress
      • Generate Personalized SendGrid Email Campaigns
      • Sending Charts to Twitter
      • Generate Instagram Post from Shopify
      • Automating Webflow Open Graph Image
      • Generate certificate of accomplishment
      • Automate Candidate's Certificate Generation
  • LINKS
    • Back to Stencil
    • Got bug?
    • Need feature?
    • Blog
Powered by GitBook
On this page
  • Design
  • Guides
  • 1. Setting up our query string
  • 2. Embedding the URL in SendGrip template
  • 3. Sending a test email

Was this helpful?

  1. Guides
  2. Case Studies

Generate Personalized SendGrid Email Campaigns

Use query string URL to create a personalized email header in SendGrid

PreviousGenerate Open Graph Image for WordPressNextSending Charts to Twitter

Last updated 3 years ago

Was this helpful?

Personalized email feels more personal and engaging to users. It builds trust between you and the user.

In this guide we will utilize query string URL to generate image with our intended recipient's name in the email header image. The link can then be embedded in the email.

Design

Our design will look like this. You can find this template in our list of preset templates.

Guides

Query string URL is the easiest integrations to use and it should take less than 5 minutes to everything up.

1. Setting up our query string

For this template, we are only interested in customizing the recipient name.

We create a query string called name that maps to our template's object user (field text).

2. Embedding the URL in SendGrip template

You can either create a new design or edit your existing design. In this example, we are going to create a new simple design.

Once your template is loaded, then drag the Image module to the top of your template. Leave the image empty for now because we are going to generate the image dynamically with our query string URL.

Add any other additional modules that fits your requirement.

Edit the image module's HTML to include our query string URL. Please ensure that the SendGrid template variable is corrrect.

<img src="https://images.usestencil.com/qs/34aacb1e-a7e4-4b4d-bb64-2bffc3c930a4/j3D8rXYRGfGhP5CntrkymX.png?name={{First_Name}}">

You're set!

3. Sending a test email

Send a test email to see this in action.

The variable name has been changed to our user's first name.

Use JPEG to load the image faster due to its smaller size. Stencil also caches the generated image, so any subsequent requests will be faster.

It's really easy and the amount of time saved is simply amazing.

You can build similar workflow in any other email providers like Mailchimp, Mailgun etc.

We also set the allowed origins to *. This allows the image to be requested from any origins. For more information about query string, please read the .

documentation here
Hana is our intended recipient which we will customize
Creating a custom design
Our email viewed inside Gmail