Dynamic Email Templates for Personalized Communication - MailerSend

Dynamic email templates

Create email templates that populate in real-time with dynamic data unique to each recipient. With variables and dynamic content, you can turn every transactional email into a personalized touchpoint for your user experience.

Try for free

Build once, personalize infinitely

Work more efficiently by creating dynamic email templates once and deploying personalized messages at scale. Minimize repetitive tasks and keep your system clean and free from excessive templates and workflows.

Deliver tailored experiences with personalized content

Enhance the user experience by using variables, filters, conditional logic, and dynamic tables in your templates. Dynamically generate order information, account activity, product recommendations, and more.

Template creation made easy with 3 powerful builders

Drag & drop: No coding needed \ \ Design professional and responsive dynamic templates with 90+ prebuilt blocks, including dynamic tables and products.\ \ Learn more](/content/features/email-template-builder/index.html) HTML: Build your own \ \ Write from scratch or import existing HTML templates. Save time with snippets, automatic CSS formatting, error tagging, and more.\ \ Learn more](/content/features/html-email-template-builder/index.html) Rich-text: Simple formatting power \ \ Create professional plain-text emails with simple inline editing and added HTML formatting in a few clicks.\ \ Learn more](/content/features/rich-text-email-editor/index.html)

Send dynamic email templates quickly with our API

Start sending in minutes with official libraries for your favorite programming language, including PHP, Java and more. Simply use the pre-built code on your template’s page.

Read our API docs

cURL Node.js PHP Laravel Python Ruby Go Java

curl -X POST \
https://api.mailersend.com/v1/email \
    -H 'Content-Type: application/json' \
    -H 'X-Requested-With: XMLHttpRequest' \
    -H 'Authorization: Bearer {place your token here without brackets}' \
    -d '{
        "from": {
            "email": "your@email.com"
        },
            "to": [\
        {\
            "email": "your@client.com"\
        }\
        ],
        "subject": "Hello from MailerSend!",
        "text": "Greetings from the team, you got this message through MailerSend.",
        "html": "Greetings from the team, you got this message through MailerSend."
    }'
import { MailerSend, EmailParams, Sender, Recipient } from "mailersend";

const mailerSend = new MailerSend({
   api_key: "key",
});

const sentFrom = new Sender("you@yourdomain.com", "Your name");

const recipients = [\
  new Recipient("your@client.com", "Your Client")\
];

const emailParams = new EmailParams()
  .setFrom(sentFrom)
  .setTo(recipients)
  .setReplyTo(sentFrom)
  .setSubject("This is a Subject")
  .setHtml("This is the HTML content")
  .setText("This is the text content");

await mailerSend.email.send(emailParams);
$mailersend = new MailerSend();

$recipients = [\
new Recipient('your@client.com', 'Your Client'),\
];

$emailParams = (new EmailParams())
->setFrom('your@email.com')
->setFromName('Your Name')
->setRecipients($recipients)
->setSubject('Subject')
->setHtml('Greetings from the team, you got this message through MailerSend.')
->setText('Greetings from the team, you got this message through MailerSend.');

$mailersend->email->send($emailParams);
php artisan make:mail ExampleEmail

Mail::to('you@client.com')->send(new ExampleEmail());
from mailersend import MailerSendClient, EmailBuilder

ms = MailerSendClient()

email = (EmailBuilder()
         .from_email("sender@domain.com", "Your Name")
         .to_many([{"email": "recipient@domain.com", "name": "Recipient"}])
         .template("template-id")
         .personalize_many([{\
             "email": "recipient@domain.com",\
             "data": {\
                 "name": "John",\
                 "company": "MailerSend"\
             }\
         }])
         .build())

response = ms.emails.send(email)
require "mailersend-ruby"

# Intialize the email class
ms_email = Mailersend::Email.new

# Add parameters
ms_email.add_recipients("email" => "your@client.com", "name" => "Your Client")
ms_email.add_recipients("email" => "your@client.com", "name" => "Your Client")
ms_email.add_from("email" => "your@domain.com", "name" => "Your Name")
ms_email.add_subject("Hello!")
ms_email.add_text("Greetings from the team, you got this message through MailerSend.")
ms_email.add_html("Greetings from the team, you got this message through MailerSend.")

# Send the email
ms_email.send
package main

import (
    "context"
    "os"
    "fmt"
    "time"

"github.com/mailersend/mailersend-go"
)

func main() {
    // Create an instance of the mailersend client
    ms := mailersend.NewMailersend(os.Getenv("MAILERSEND_API_KEY"))

ctx := context.Background()
    ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
    defer cancel()

subject := "Subject"
    text := "This is the text content"
    html := "This is the HTML content"

from := mailersend.From{
        Name:  "Your Name",
        Email: "your@domain.com",
    }

recipients := []mailersend.Recipient{
        {
            Name:  "Your Client",
            Email: "your@client.com",
        },
    }

// Send in 5 minute
    sendAt := time.Now().Add(time.Minute * 5).Unix()

tags := []string{"foo", "bar"}

message := ms.Email.NewMessage()

message.SetFrom(from)
    message.SetRecipients(recipients)
    message.SetSubject(subject)
    message.SetHTML(html)
    message.SetText(text)
    message.SetTags(tags)
    message.SetSendAt(sendAt)
    message.SetInReplyTo("client-id")

res, _ := ms.Email.Send(ctx, message)

fmt.Printf(res.Header.Get("X-Message-Id"))

}
import com.mailersend.sdk.Email;
import com.mailersend.sdk.MailerSend;
import com.mailersend.sdk.MailerSendResponse;
import com.mailersend.sdk.exceptions.MailerSendException;

public void sendEmail() {

Email email = new Email();

email.setFrom("name", "your email");
    email.addRecipient("name", "your@recipient.com");

// you can also add multiple recipients by calling addRecipient again
    email.addRecipient("name 2", "your@recipient2.com");

// there's also a recipient object you can use
    Recipient recipient = new Recipient("name", "your@recipient3.com");
    email.AddRecipient(recipient);

email.setSubject("Email subject");

email.setPlain("This is the text content");
    email.setHtml("This is the HTML content");

MailerSend ms = new MailerSend();

ms.setToken("Your API token");

try {
        MailerSendResponse response = ms.emails().send(email);
        System.out.println(response.messageId);
    } catch (MailerSendException e) {
        e.printStackTrace();
    }
}

Optimize templates with data-driven insights

Create up to 5 versions of a template and use email split testing to find which performs the best. Analyze the insights to improve your designs, boost engagement, and increase conversions.

Monitor performance with in-depth analytics

Access key metrics such as opens, clicks, bounces, unsubscribes, and more in the analytics dashboard. Filter data for your account, domains, or individual email templates and create custom reports.

Send content in each subscriber's language

Translate your emails in a click and manage multiple languages from one template. Subscribers always get emails they can read, and you don't get bogged down with separate templates for each language.

Email delivery you can count on

Fast, reliable delivery \ \ Built for the maximum deliverability of high volumes of email, MailerSend helps you to reach more inboxes and avoid spam folders.\ \ Learn more](/content/features/email-delivery/index.html) Simple, robust email API \ \ Our dev-friendly email API is simple to implement and advanced in functionality. No/low-code options and integrations available.\ \ Learn more](/content/features/email-api/index.html) Award-winning support \ \ Starting out or leveling up: get help when you need it most from our friendly, award-winning, customer support team.\ \ Learn more](/content/contact-us/index.html)

What our customers have to say

High Performer\ Small Business\ \ Spring 2025 High\ \ Performer\ Spring 2025 High Performer\ Europe\ \ Winter 2025

A well-designed, easy-to-use interface. Snappy mail delivery without any backlogs like SendInBlue. WordPress site works far better & API documentation is very clean and understandable.

Pekka G.Freelance art director & web developer

MailerSend is extremely easy to use and super fast to set up. I was able to send the first email via the API in minutes. With the predefined templates and drag and drop editor, you're able to get started really quickly.

Tobias R.IT company owner

The drag and drop email builder has way more pre-built blocks than any competitor and the templates are really good-looking and practical.

Jason P.Co-founder/Managing Director

Frequently Asked Questions

What is a dynamic email template?

A dynamic email template is a type of email that includes variables to personalize the content for each individual recipient. A simple example of this is using the {{name}} variable to add the recipient’s name.

What is a dynamic email used for?

In transactional emails, dynamic templates are used to send emails with account or transaction-specific content (such as account details, password reset link or order confirmation) to recipients. Dynamic email email content can also be used to personalize messaging in order to build relationships and increase engagement, for example, by translating strings of text and adjusting it to the recipient’s locale.

How can I create dynamic email?

You can create a dynamic email by adding personalization variables into your API call. Learn how to use variables.

More features to explore

MailerSend is packed full of features that help you save time and grow your business.

Send emails

\ \ Email delivery \ \ Enjoy the flexibility of sending a few emails or scaling quickly to send a few million.](/content/features/email-delivery/index.html) \ \ Transactional emails \ \ Intuitively-designed tools allow anyone to contribute, while an advanced infrastructure lets you scale fast.](/content/features/transactional-emails/index.html) \ \ SMTP relay \ \ Use Simple Mail Transfer Protocol when you want to quickly send emails using a reliable Internet standard.](/content/features/smtp-relay/index.html) \ \ Email API \ \ Start sending and tracking your emails with our easy API integration process and clean documentation.](/content/features/email-api/index.html) \ \ Email verification \ \ Verify a single email address or upload an entire email list to verify in bulk.](/content/features/email-verification-tool/index.html) \ \ Email address validation API \ \ Keep your recipient list clean and maintain great deliverability by automatically verifying incoming email addresses with the email address validation API.](/content/features/email-address-validation-api/index.html) \ \ Mailerlite](/content/features/marketing-emails/index.html)

Control your sendings

\ \ Webhooks \ \ Get notified as email events happen so your integration can automatically trigger reactions.](/content/features/webhooks/index.html) \ \ Advanced email tracking \ \ Every email is a learning experience. Monitor your email performance to find what works best.](/content/features/email-tracking/index.html) \ \ Manage the unsubscribe page \ \ Whether people are unsubscribing, give them a compelling reason to stay.](/content/features/manage-unsubscribe-page-builder/index.html) \ \ Email suppression list management \ \ Protect your sending reputation by adding email addresses and domains that you should not send to.](/content/features/suppression-list-management/index.html) \ \ Activity and performance logs \ \ Easy access to detailed API and SMTP activity data and template error logs.](/content/features/logs/index.html)

Track the results

\ \ Email activity \ \ Search your activity feed to troubleshoot sending and understand the behavior of your recipients.](/content/features/email-activity/index.html) \ \ Email analytics \ \ Access a wide range of metrics to learn how to improve email deliverability and engagement.](/content/features/email-analytics/index.html)

Create emails

\ \ Custom HTML email builder \ \ Interested in writing your own HTML code? Our HTML email template editor gives you the flexibility to build exactly what you want.](/content/features/html-email-template-builder/index.html) \ \ Drag & drop email template builder \ \ Our drag & drop email editor empowers you to create professionally-designed transactional emails.](/content/features/email-template-builder/index.html) \ \ Rich-text email editor \ \ Create plain text emails with the formatting capabilities of HTML. Add links, images, bullet points and style text with ease.](/content/features/rich-text-email-editor/index.html) \ \ Email split testing \ \ Email split testing will improve engagement with your transactional emails by helping you learn what your customers want more.](/content/features/email-split-testing/index.html) \ \ Send surveys \ \ Understand your customers and users on a deeper level and gain valuable insights to help you improve your product and customer experience with surveys.](/content/features/survey-emails/index.html)

Control your account

\ \ User management \ \ Invite your team members to collaborate on projects by assigning roles and granting permissions.](/content/features/user-management/index.html) \ \ File manager \ \ Streamline your workflow by organizing and keeping all your files in one place in the cloud.](/content/features/manage-files/index.html) \ \ Multiple domains \ \ Use multiple domains to manage different brands or products with one MailerSend account.](/content/features/multiple-domains/index.html) \ \ Dedicated IP \ \ Take control of your sending reputation with your own dedicated IP address and optimize your sendings for improved deliverability.](/content/features/dedicated-ip-email/index.html) \ \ Email MCP server \ \ Connect your AI tool to the MailerSend email MCP server to effortlessly send, track, and manage your transactional emails.](/content/features/mcp/index.html) \ \ DMARC monitoring \ \ Get insights into your domain’s email sending activity so you can identify authentication issues and unauthorized senders, and protect your domain reputation.](/content/features/dmarc-monitoring/index.html) \ \ Blocklist monitoring \ \ Set up automated blocklist checks to catch listed domains and IPs in real-time, so you can get delisted quickly before sender reputation is affected.](/content/features/blocklist-monitoring/index.html)

Start conversations

\ \ Inbound email routing \ \ Automatically parse incoming emails. Inbound email routes enable MailerSend to receive emails on your behalf, integrating them into your application.](/content/features/inbound-emails/index.html)

Transactional SMS

\ \ WhatsApp transactional messaging API \ \ Send critical transactional notifications via the official WhatsApp Business API.](/content/features/whatsapp/index.html)

Start sending dynamic emails

Test MailerSend with a 2-week free trial of our Professional plan. Access all our features, integrate your app, and get 24/7 Support.

Try for free