惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
Martin Fowler
Martin Fowler
N
Netflix TechBlog - Medium
WordPress大学
WordPress大学
罗磊的独立博客
H
Help Net Security
MongoDB | Blog
MongoDB | Blog
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
D
Docker
云风的 BLOG
云风的 BLOG
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
P
Proofpoint News Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
I
InfoQ
J
Java Code Geeks
博客园 - 聂微东
大猫的无限游戏
大猫的无限游戏
Engineering at Meta
Engineering at Meta
美团技术团队
小众软件
小众软件
Stack Overflow Blog
Stack Overflow Blog
C
Check Point Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Build personalized email campaigns per customer
Rishi Raj Ja · 2026-05-19 · via DEV Community

This guide walks through a workflow I used recently i.e. connect Orshot to Cursor, turn a reference image into a parameterized template, render a unique hero image per customer, and send it through your email provider. You stay in the editor for design and exploration and production sends use the API the same way any other integration would.

By the end of this guide, you will have a studio template with named parameters (customer_name, headline, hero_image, and so on), a render call that returns a hosted image URL per row of customer data, and a small script that combines that URL with an email send.

Prerequisites

  • An Orshot account
  • A Cursor setup
  • Whatever you already use for transactional email (Resend, AutoSend, etc.). A CSV or database of customers is enough for the last step.

What I was actually trying to do

Before the steps, it helps to be explicit about the loop, because each section maps to one part of it.

You start with a reference image (a newsletter you liked, a competitor layout, a crop from a mood board). In Cursor you ask the agent to build something similar in Orshot and to mark which layers should change per recipient. Those marks become API parameters. For each customer you pass different values into the same template, get back an image URL, and embed that URL in the email body.

Getting the MCP connected

I love being in Cursor all day and so I set up Orshot's MCP server to avoid interacting with the console manually for updation, deletion and other functions. These are the steps I followed:

  • Sign in at orshot.com.
  • Go to Generate → Agents & MCP → Cursor → Install in Cursor. That adds the Orshot MCP server to Cursor’s configuration.
  • In Cursor, click "Connect" the MCP server when prompted, then complete authorization in the Orshot dashboard in the browser tab that opens.

  • Verify the install: open Cursor’s MCP settings and confirm tools are listed, including orshot_create_template_design, orshot_generate_image, orshot_batch_render, and orshot_get_studio_template_modifications, etc.

Turning a reference image into a template

You do not need to open Orshot Studio first. The flow below is what worked for me - reference in chat, create a simple layout, refine, then parameterize.

Step 1. Bring the reference into Cursor

Paste or attach your inspiration image in the chat. In the same message, describe the layout and the output size. Email heroes are often around 600px wide so pick a width and height you will keep for the whole campaign to avoid re-rendering at multiple sizes later.

The prompt that works for me always:

Here is a reference for an email hero. Build an Orshot template in the same spirit. Canvas 600×400. Keep the first version simple — background, headline, image area, CTA only.

Step 2. Let the agent create, refine and parameterize

The agent will typically call orshot_create_template_design for a first pass, then orshot_update_template_design for spacing, type, and polish. Asking for a perfect layout in a single call often produces a muddier result than create-then-refine so treat the second pass as a normal step.

Here's a prompt that worked for me:

Mark headline, hero_image, customer_name, and cta_label as parameters. List all modification keys for this template and give me the template ID.

Once you are through with the changes, look at the parameters summarized by Cursor to ensure that it's the way you want them to be for your template.

Step 3. Render a test image

Here'a a prompt that allows me to render my template for custom values:

Render template [ID] with customer_name "Alex", headline "Hi, Alex", hero_image [public URL], cta_label "View account". Return a PNG URL.

Open the URL in a browser. If the layout is wrong, iterate in chat (orshot_patch_template_elements for small text or style tweaks, or another orshot_update_template_design for bigger changes). The template also appears in Orshot Studio if you want to adjust pixels by hand.

Once the template exists, the rest is mostly data

After the design is stable, each send is the same operation with different modifications. Keys must match the parameterId values from the previous section.

For dozens or hundreds of customers, loop in your own code against the REST API instead of pushing everything through chat. Keep the same modifications object per row and add a queue, retries, and logging as you would for any outbound job.

Step 1. Prepare customer data

Each row needs at least an email address and the values for your template parameters (name, plan, image URL, etc.). A CSV, database export, or CRM webhook all work as long as you can map columns to modification keys.

Step 2. Render, then send

The pattern is always to render → image URL → HTML body → send. Example with the Node SDK (swap in your email client):

import { Orshot } from "orshot";

const orshot = new Orshot(process.env.ORSHOT_API_KEY);

const TEMPLATE_ID = 12345;

type Customer = {
  email: string;
  name: string;
  plan: string;
  heroUrl: string;
};

async function sendPersonalizedHero(customer: Customer) {
  const { url: imageUrl } = await orshot.renderFromTemplate({
    templateId: TEMPLATE_ID,
    modifications: {
      customer_name: customer.name,
      headline: `${customer.name}, your ${customer.plan} summary`,
      hero_image: customer.heroUrl,
      cta_label: "View dashboard",
    },
    responseType: "url",
    responseFormat: "png"
  });

  await emailProvider.send({
    to: customer.email,
    subject: `Your ${customer.plan} update`,
    html: `
      <p>Hi ${customer.name},</p>
      <img src="${imageUrl}" width="600" alt="" style="display:block;max-width:100%;" />
      <p><a href="https://app.example.com">Open your account</a></p>
    `,
  });
}

Enter fullscreen mode Exit fullscreen mode

Step 3. Verify end to end

Run one real row, pull name and plan from your spreadsheet, render, send to your own inbox, and confirm the image loads in Gmail (or whatever client your audience uses).

What I would change if I did it again

These are not requirements, but they would have saved me time on a second run.

I would decide which fields are dynamic before the layout is final, so parameter names never diverge from what I expect. I would pick canvas dimensions once and avoid re-rendering at multiple scales unless a second channel really needs it.

For work where brand fidelity is non-negotiable, you will still want a designer in the loop!

Ending Thoughts

What helped me most was dropping the repetitive export step of settling the layout, marking what should change (name, headline, image, CTA), and after that you only pass in different values and paste the URL into the message, same structure every time without opening a design file for each person. You do not need to be a designer for that part either, you can describe what you want in plain language and work from a screenshot you like, the agent and MCP handle the layout work well enough for onboarding emails, renewals, and other campaigns where “good enough and consistent” beats hand-polishing every asset.