<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Lunea Labs</title>
    <description>The latest articles on DEV Community by Lunea Labs (@lunealabs).</description>
    <link>https://dev.to/lunealabs</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4203983%2Fd93594b3-ae65-4ab9-9da2-10efb4da8515.png</url>
      <title>DEV Community: Lunea Labs</title>
      <link>https://dev.to/lunealabs</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/lunealabs"/>
    <language>en</language>
    <item>
      <title>Team invite email template: what to include and how to send it</title>
      <dc:creator>Lunea Labs</dc:creator>
      <pubDate>Fri, 30 Oct 2026 19:19:35 +0000</pubDate>
      <link>https://dev.to/lunealabs/team-invite-email-template-what-to-include-and-how-to-send-it-96e</link>
      <guid>https://dev.to/lunealabs/team-invite-email-template-what-to-include-and-how-to-send-it-96e</guid>
      <description>&lt;p&gt;A team invite email tells someone who invited them, to which workspace, with which role, and gives them one button to accept. A good subject line is "{{inviterName}} invited you to {{workspaceName}} on {{product}}". Send it from your server the moment the invite is created, from your own authenticated domain. The link should be single-use, tied to the invited address, and expire after a set time (seven days is a common default). Send one reminder at most, and keep promotions out of it.&lt;/p&gt;

&lt;p&gt;Below: what to include, a template you can copy (with reminder and expiry versions), the code to send it, and the security details most invite guides skip.&lt;/p&gt;

&lt;h2&gt;
  
  
  What to include in a team invite email
&lt;/h2&gt;

&lt;p&gt;The person reading it may never have heard of your product. They know the colleague who invited them, and that is the only reason they will trust the email. So lead with the person.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Who invited them&lt;/strong&gt;: the inviter's name &lt;em&gt;and&lt;/em&gt; email address. Anyone can type "Sarah from Finance" as a display name; the address lets the reader check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where&lt;/strong&gt;: the workspace or team name, and your product name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Their role&lt;/strong&gt;: "as an Editor" or "as an Admin". It tells them what they will be able to do.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;One button&lt;/strong&gt;: "Accept invite" or "Join {{workspaceName}}". Nothing else competes with it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The expiry date&lt;/strong&gt;: a real date, not "soon".&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What your product is&lt;/strong&gt;, in one line, for people who don't know it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A way out&lt;/strong&gt;: "Didn't expect this? You can ignore it. Nothing happens unless you accept."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The link as text&lt;/strong&gt;, below the button, for email clients that block buttons.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An optional personal note&lt;/strong&gt; from the inviter, if your invite form has one.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Subject lines
&lt;/h2&gt;

&lt;p&gt;Put the inviter's name first. People open email from people they know.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Good&lt;/th&gt;
&lt;th&gt;Weak&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Sarah Miller invited you to Acme Design on Acme&lt;/td&gt;
&lt;td&gt;You've been invited!&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Join Sarah in Acme Design&lt;/td&gt;
&lt;td&gt;Action required: pending invitation&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Your invite to Acme Design expires on 31 October&lt;/td&gt;
&lt;td&gt;Don't miss out on Acme&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The weak ones say nothing about who or where, and the last one reads like an ad. Bento's &lt;a href="https://bentonow.com/posts/user-invitation-email-best-practices" rel="noopener noreferrer"&gt;guide to invitation emails&lt;/a&gt; makes the same point with "You're invited!" as its bad example.&lt;/p&gt;

&lt;h2&gt;
  
  
  Team invite email template
&lt;/h2&gt;

&lt;p&gt;Copy this and replace the &lt;code&gt;{{double braces}}&lt;/code&gt;. The names match the code further down.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subject:&lt;/strong&gt; {{inviterName}} invited you to {{workspaceName}} on Acme&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preheader&lt;/strong&gt; (the preview text after the subject): Join as {{roleLabel}}. This invite expires on {{expiresOn}}.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Body:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hi,&lt;/p&gt;

&lt;p&gt;{{inviterName}} ({{inviterEmail}}) invited you to join &lt;strong&gt;{{workspaceName}}&lt;/strong&gt; on Acme as {{roleLabel}}.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;"{{note}}"&lt;/em&gt; (only if the inviter wrote a note)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[Accept invite]&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This invite is for {{inviteeEmail}} and expires on {{expiresOn}}.&lt;/p&gt;

&lt;p&gt;Acme is a shared workspace for design reviews. &lt;em&gt;(One line on what your product does.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Didn't expect this? You can ignore this email. Nobody gets access unless you accept.&lt;/p&gt;

&lt;p&gt;Button not working? Paste this link into your browser: {{acceptUrl}}&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Reminder (one, after about three days)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Subject:&lt;/strong&gt; Your invite to {{workspaceName}} expires on {{expiresOn}}&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;{{inviterName}} invited you to {{workspaceName}} on Acme a few days ago. The invite is still open until {{expiresOn}}.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;[Accept invite]&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Expired (to the inviter, not the invitee)
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Subject:&lt;/strong&gt; Your invite to {{inviteeEmail}} expired&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;{{inviteeEmail}} didn't accept your invite to {{workspaceName}} before it expired. You can send a new one from Settings › Members.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Telling the inviter is more useful than a third email to someone who hasn't answered twice. &lt;a href="https://www.courier.com/recipes/team-invite-reminder-email" rel="noopener noreferrer"&gt;Courier's invite recipe&lt;/a&gt; uses the same pattern: reminder on day 3, note to the inviter on day 7.&lt;/p&gt;

&lt;h2&gt;
  
  
  Send it from your app
&lt;/h2&gt;

&lt;p&gt;With &lt;a href="https://luneamail.com/transactional-email" rel="noopener noreferrer"&gt;LuneaMail's transactional API&lt;/a&gt;, the template lives in your workspace and your app sends the data. Templates use Handlebars: &lt;code&gt;{{workspaceName}}&lt;/code&gt; inserts a value, &lt;code&gt;{{#if note}}…{{/if}}&lt;/code&gt; shows a block only when the data has it. In the visual builder, a section set to "show only if role is admin" becomes &lt;code&gt;{{#if (eq role "admin")}}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;The template body:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;{{inviterName}} ({{inviterEmail}}) invited you to join
  &lt;span class="nt"&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;{{workspaceName}}&lt;span class="nt"&gt;&amp;lt;/strong&amp;gt;&lt;/span&gt; on Acme as {{roleLabel}}.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

{{#if note}}
  &lt;span class="nt"&gt;&amp;lt;blockquote&amp;gt;&lt;/span&gt;{{note}}&lt;span class="nt"&gt;&amp;lt;/blockquote&amp;gt;&lt;/span&gt;
{{/if}}

{{#if (eq role "admin")}}
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;As an admin you can invite people and manage billing.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
{{/if}}

&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{{acceptUrl}}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Accept invite&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This invite is for {{inviteeEmail}} and expires on {{expiresOn}}.
  Didn't expect it? Ignore this email. Nothing happens unless you accept.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Creating the invite and sending it (Node.js):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;node:crypto&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;APP_URL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://app.example.com&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// fixed, never from the request's Host header&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;WEEK&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;24&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;inviteMember&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="nx"&gt;workspace&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;inviter&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;note&lt;/span&gt; &lt;span class="p"&gt;})&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;randomBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;base64url&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;expiresAt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;WEEK&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;invite&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;workspaceId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;workspace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;().&lt;/span&gt;&lt;span class="nf"&gt;toLowerCase&lt;/span&gt;&lt;span class="p"&gt;(),&lt;/span&gt;
      &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;tokenHash&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createHash&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;sha256&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;update&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;digest&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;expiresAt&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://app.luneamail.com/api/v1/send&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;LUNEAMAIL_API_KEY&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;templateId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;INVITE_TEMPLATE_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;{{inviterName}} invited you to {{workspaceName}} on Acme&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;inviterName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;inviter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;inviterEmail&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;inviter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;workspaceName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;workspace&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;roleLabel&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;ROLE_LABELS&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="nx"&gt;role&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt;
        &lt;span class="na"&gt;note&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;note&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="kc"&gt;undefined&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// optional: only used inside {{#if note}}&lt;/span&gt;
        &lt;span class="na"&gt;inviteeEmail&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;acceptUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;APP_URL&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/invite/&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;expiresOn&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;expiresAt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;toLocaleDateString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;en-GB&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;day&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;numeric&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;month&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;long&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;}),&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;!==&lt;/span&gt; &lt;span class="mi"&gt;202&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// e.g. SUPPRESSED: this address bounced before&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A success returns &lt;code&gt;202&lt;/code&gt; with &lt;code&gt;{ status: "queued", messageId }&lt;/code&gt;. If a required variable is missing, the API refuses with &lt;code&gt;MISSING_VARIABLE&lt;/code&gt; instead of sending an invite with an empty button. If the address bounced or reported spam before, it returns &lt;code&gt;SUPPRESSED&lt;/code&gt;; show that to the inviter ("We couldn't deliver to this address") rather than failing silently. The full list of errors is in our &lt;a href="https://luneamail.com/blog/license-key-emails" rel="noopener noreferrer"&gt;license key email guide&lt;/a&gt; and on the &lt;a href="https://luneamail.com/developers" rel="noopener noreferrer"&gt;developers page&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  The invite link: tokens and link scanners
&lt;/h2&gt;

&lt;p&gt;The accept link is the part that needs care. It gives access to someone's workspace.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Random and long.&lt;/strong&gt; Generate the token with a cryptographically secure generator, as &lt;a href="https://cheatsheetseries.owasp.org/cheatsheets/Forgot_Password_Cheat_Sheet.html" rel="noopener noreferrer"&gt;OWASP recommends&lt;/a&gt; for reset tokens. Don't use IDs or anything guessable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Store a hash, not the token.&lt;/strong&gt; Then a leaked database doesn't leak working invite links.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single use, with an expiry.&lt;/strong&gt; Accepting, revoking or expiring the invite kills the link.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Build the URL from a fixed base,&lt;/strong&gt; never from the incoming request's host. OWASP warns about Host header injection for exactly this kind of link.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Set &lt;code&gt;Referrer-Policy: no-referrer&lt;/code&gt; on the accept page,&lt;/strong&gt; so the token in the URL isn't sent to other sites the page loads.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't accept on the first click.&lt;/strong&gt; Company mail filters open links to check them. &lt;a href="https://stytch.com/docs/b2b/guides/magic-links/protected-eml" rel="noopener noreferrer"&gt;Stytch's documentation&lt;/a&gt; says "most security scanners will inspect and click on any links present in emails", which can use up a one-time token before the person sees it. Make the link open a page that says "Join Acme Design as Editor" with a button, and accept the invite only when that button is pressed (a POST request, not the page load).&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Expiry, reminders, resend and revoke
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Expiry:&lt;/strong&gt; seven days is the usual default. Bento calls 24 hours too short and 30 days too long; &lt;a href="https://www.sequenzy.com/blog/how-to-create-team-invitation-emails-saas" rel="noopener noreferrer"&gt;Sequenzy suggests&lt;/a&gt; 48 to 72 hours for sensitive products.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reminder:&lt;/strong&gt; one, around day three, only if the invite is still open. Cancel it when the invite is accepted or revoked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resend:&lt;/strong&gt; create a new token and a new expiry, and invalidate the old link. Then a resent invite is never already expired.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Revoke:&lt;/strong&gt; let admins cancel pending invites in the members list. A mistyped address should not hold a working link for a week.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expired link page:&lt;/strong&gt; say it expired, name the inviter, and offer to ask them for a new invite. Don't show a bare error.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;From the LuneaMail team:&lt;/strong&gt; Invites are the reason LuneaMail exists. We needed to send highly customised invite emails from our own product, and there was no way to do it without a lot of research. Gmail meant workarounds that never looked right. A marketing suite like HubSpot meant paying more than the job was worth, many steps for one styled email, and templates that limited what we could do. Product teams we worked with had the same problem: they only wanted to send a few branded emails, and building sending properly, so the emails actually arrive, is a huge undertaking for a small team. An invite should be one template and one API call.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  New users and existing users
&lt;/h2&gt;

&lt;p&gt;The same email reaches two kinds of people.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;New to your product:&lt;/strong&gt; the accept page goes to sign-up with the email already filled in. Ask for as little as possible; they came to see their colleague's work.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Already has an account:&lt;/strong&gt; send them to sign in, then straight into the workspace. Don't make them create a second account.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can handle both in one template with &lt;code&gt;{{#if hasAccount}}Sign in to join{{else}}Create your account to join{{/if}}&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Also decide what happens when someone signed in as &lt;code&gt;ana@gmail.com&lt;/code&gt; opens an invite sent to &lt;code&gt;ana@company.com&lt;/code&gt;. The safe default is to accept only for the invited address and say so: "This invite is for &lt;a href="mailto:ana@company.com"&gt;ana@company.com&lt;/a&gt;. Sign in with that address, or ask Sarah to invite this one."&lt;/p&gt;

&lt;h2&gt;
  
  
  Stop invites being used for spam
&lt;/h2&gt;

&lt;p&gt;Invites let your users send email, with text they control, to any address. That makes them attractive to spammers: sign up, name the workspace "Claim your prize at …", invite a few thousand strangers. Your domain takes the damage.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Require a verified email&lt;/strong&gt; before a user can invite anyone.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Rate-limit invites&lt;/strong&gt; per user and per workspace, and alert on spikes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Limit the length&lt;/strong&gt; of workspace names and notes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Escape user text.&lt;/strong&gt; Handlebars escapes HTML in &lt;code&gt;{{note}}&lt;/code&gt; by default. Never use the triple-brace form &lt;code&gt;{{{note}}}&lt;/code&gt; for text a user typed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Watch bounces and spam complaints&lt;/strong&gt; after invite sends. A run of either from one workspace is a signal.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Transactional, not marketing
&lt;/h2&gt;

&lt;p&gt;An invite is app email, not marketing: one message to one person, sent because a teammate asked for it. It needs no marketing consent. In LuneaMail it carries no marketing footer and still reaches people who unsubscribed from your newsletter; addresses that bounced or reported spam are refused.&lt;/p&gt;

&lt;p&gt;That only holds while the email stays about the invite. The &lt;a href="https://www.ftc.gov/business-guidance/resources/can-spam-act-compliance-guide-business" rel="noopener noreferrer"&gt;FTC's CAN-SPAM guide&lt;/a&gt; judges a mixed email by its primary purpose: a subject that reads like an ad, or promotional content above the invite, can make it commercial. And the invitee never signed up for anything. Don't add them to your newsletter until they join and opt in.&lt;/p&gt;

&lt;p&gt;For delivery, send from your own domain. Gmail &lt;a href="https://support.google.com/a/answer/81126" rel="noopener noreferrer"&gt;requires SPF or DKIM from every sender&lt;/a&gt; (DNS records that prove a server may send for your domain). LuneaMail sends from your domain once you add its DKIM records. Click tracking wraps links in a redirect; you can switch it off per workspace if you'd rather keep invite links untouched.&lt;/p&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Inviter's name and email, workspace name, role&lt;/li&gt;
&lt;li&gt;[ ] One "Accept invite" button, plus the link as text&lt;/li&gt;
&lt;li&gt;[ ] Expiry date written out&lt;/li&gt;
&lt;li&gt;[ ] "Didn't expect this?" line&lt;/li&gt;
&lt;li&gt;[ ] Token random, hashed, single-use, expiring&lt;/li&gt;
&lt;li&gt;[ ] Accept on a button press, not on page load&lt;/li&gt;
&lt;li&gt;[ ] Existing users go to sign-in, new users to sign-up&lt;/li&gt;
&lt;li&gt;[ ] One reminder, then tell the inviter&lt;/li&gt;
&lt;li&gt;[ ] Resend issues a new link; admins can revoke&lt;/li&gt;
&lt;li&gt;[ ] Invites rate-limited; user text escaped&lt;/li&gt;
&lt;li&gt;[ ] Sent from your domain with SPF and DKIM; no promotions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;"You've been invited!"&lt;/strong&gt; as the subject, with no name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Only the inviter's display name.&lt;/strong&gt; Easy to fake; show the address.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Links that never expire,&lt;/strong&gt; or expire before the reminder arrives.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accepting on GET.&lt;/strong&gt; A mail scanner joins the workspace before your user does.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Batching invites.&lt;/strong&gt; Send immediately; the inviter is often waiting.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Adding invitees to marketing lists.&lt;/strong&gt; They didn't sign up.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sending invites with LuneaMail
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://luneamail.com/transactional-email" rel="noopener noreferrer"&gt;LuneaMail&lt;/a&gt; sends invites, license keys and other app email with one &lt;code&gt;POST /send&lt;/code&gt; call, from templates your team designs in the same editor as your campaigns. App email uses the same monthly allowance as campaigns on every plan, including Free; see &lt;a href="https://luneamail.com/pricing" rel="noopener noreferrer"&gt;pricing&lt;/a&gt;. If you also sell licenses, our guide to &lt;a href="https://luneamail.com/blog/license-key-emails" rel="noopener noreferrer"&gt;license key emails&lt;/a&gt; covers the email that goes out after a purchase.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://luneamail.com/blog/team-invite-emails" rel="noopener noreferrer"&gt;LuneaMail blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>saas</category>
      <category>security</category>
      <category>softwaredevelopment</category>
    </item>
    <item>
      <title>SPF, DKIM and DMARC setup for SaaS founders: a 10-minute guide</title>
      <dc:creator>Lunea Labs</dc:creator>
      <pubDate>Thu, 29 Oct 2026 19:36:42 +0000</pubDate>
      <link>https://dev.to/lunealabs/spf-dkim-and-dmarc-setup-for-saas-founders-a-10-minute-guide-52d</link>
      <guid>https://dev.to/lunealabs/spf-dkim-and-dmarc-setup-for-saas-founders-a-10-minute-guide-52d</guid>
      <description>&lt;p&gt;SPF, DKIM and DMARC are three DNS records that prove your emails really come from your domain. For most startups the setup is short. Your email provider gives you a few CNAME records (DKIM and a return path) and you add them at your DNS host. You leave your existing root SPF record alone. You publish one DMARC record at &lt;code&gt;_dmarc.yourdomain.com&lt;/code&gt;. Then you send a test email to a Gmail address and check that SPF, DKIM and DMARC all say PASS.&lt;/p&gt;

&lt;p&gt;The typing takes about ten minutes. DNS can take longer to update. This guide shows each step with example records, the mistakes we made while launching LuneaMail this month, and a checklist to confirm it works.&lt;/p&gt;

&lt;h2&gt;
  
  
  What each record does
&lt;/h2&gt;

&lt;p&gt;A few terms first. &lt;strong&gt;DNS&lt;/strong&gt; is the public address book for your domain. An &lt;strong&gt;ESP&lt;/strong&gt; (email service provider) is the service that sends your app and marketing email, such as SendGrid, Postmark or Amazon SES.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SPF&lt;/strong&gt; (Sender Policy Framework) lists the servers allowed to send mail for a domain. Receivers check it against the hidden "return path" address, not the From address people see.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DKIM&lt;/strong&gt; (DomainKeys Identified Mail) adds a signature to every email. The receiver checks the signature with a public key published in your DNS. If the email was changed on the way, the check fails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DMARC&lt;/strong&gt; tells receivers what to do when an email fails, and asks them to send you reports. It also checks &lt;strong&gt;alignment&lt;/strong&gt;: the domain in the visible From address must match the domain that passed SPF or DKIM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Alignment is the part most people miss. An email can pass SPF and DKIM for your provider's domain and still fail DMARC for yours.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before you start: list everything that sends as your domain
&lt;/h2&gt;

&lt;p&gt;Write down every service that sends email with your domain in the From address. A typical early-stage SaaS has two or three:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Sender&lt;/th&gt;
&lt;th&gt;Example&lt;/th&gt;
&lt;th&gt;How it authenticates&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Team mailboxes&lt;/td&gt;
&lt;td&gt;Google Workspace&lt;/td&gt;
&lt;td&gt;MX records, an &lt;code&gt;include:&lt;/code&gt; in the root SPF, its own DKIM key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;App and marketing email&lt;/td&gt;
&lt;td&gt;SendGrid, Postmark, SES&lt;/td&gt;
&lt;td&gt;CNAME records the provider gives you&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Support or CRM tool&lt;/td&gt;
&lt;td&gt;Help desk, sales tool&lt;/td&gt;
&lt;td&gt;Varies; check its docs&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;Every sender on this list needs DKIM for your domain. If one is missing, DMARC will fail for its emails once you enforce a policy.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 1: Check your root SPF record (and usually leave it alone)
&lt;/h2&gt;

&lt;p&gt;Look up the TXT records on your root domain. If you use Google Workspace, you probably have something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;example.com.  TXT  "v=spf1 include:_spf.google.com ~all"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two rules matter here. A domain must have only &lt;strong&gt;one&lt;/strong&gt; SPF record, and SPF evaluation stops after &lt;strong&gt;10 DNS lookups&lt;/strong&gt;. Breaking either rule gives a "permerror", which counts as a fail (&lt;a href="https://www.rfc-editor.org/rfc/rfc7208" rel="noopener noreferrer"&gt;RFC 7208&lt;/a&gt;, sections 3.2 and 4.6.4).&lt;/p&gt;

&lt;p&gt;Many older guides tell you to add your ESP to this record, for example &lt;code&gt;include:sendgrid.net&lt;/code&gt;. With modern setups you often don't need to. When we connected SendGrid with "automated security" turned on, SendGrid's SPF lived on its own subdomain (the return path, &lt;code&gt;em1234.example.com&lt;/code&gt; in the example below). Receivers check SPF on that subdomain, not on the root. So our root SPF record for Google Workspace stayed exactly as it was. One fewer lookup, and nothing to break for the team's mailboxes.&lt;/p&gt;

&lt;p&gt;If your provider does ask you to edit the root SPF, merge its &lt;code&gt;include:&lt;/code&gt; into the existing record. Never add a second &lt;code&gt;v=spf1&lt;/code&gt; record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 2: Add your provider's DKIM and return-path records
&lt;/h2&gt;

&lt;p&gt;In your ESP's dashboard, find "domain authentication" (the name varies). Enter your domain and it shows the records to add. In SendGrid with automated security, you get CNAME records like these (placeholder values; copy yours exactly):&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Name / Host&lt;/th&gt;
&lt;th&gt;Value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;CNAME&lt;/td&gt;
&lt;td&gt;&lt;code&gt;em1234.example.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;u1234567.wl123.sendgrid.net&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CNAME&lt;/td&gt;
&lt;td&gt;&lt;code&gt;s1._domainkey.example.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;s1.domainkey.u1234567.wl123.sendgrid.net&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;CNAME&lt;/td&gt;
&lt;td&gt;&lt;code&gt;s2._domainkey.example.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;s2.domainkey.u1234567.wl123.sendgrid.net&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;The &lt;code&gt;em1234&lt;/code&gt; record is the return path, used for SPF and bounces. The two &lt;code&gt;_domainkey&lt;/code&gt; records point to DKIM keys that SendGrid manages. A CNAME means you never paste a long key yourself.&lt;/p&gt;

&lt;h3&gt;
  
  
  The GoDaddy mistake (and Route 53, Namecheap...)
&lt;/h3&gt;

&lt;p&gt;This is the mistake we made. GoDaddy adds your domain to whatever you type in the Name field. If you paste the full host name &lt;code&gt;em1234.example.com&lt;/code&gt;, GoDaddy saves &lt;code&gt;em1234.example.com.example.com&lt;/code&gt;. The record exists, but at the wrong name, so verification fails.&lt;/p&gt;

&lt;p&gt;Type only the part before your domain:&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;You want&lt;/th&gt;
&lt;th&gt;Type in the Name field&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;em1234.example.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;em1234&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;s1._domainkey.example.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;s1._domainkey&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;_dmarc.example.com&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;_dmarc&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;SendGrid's own docs warn that &lt;a href="https://www.twilio.com/docs/sendgrid/ui/account-and-settings/how-to-set-up-domain-authentication" rel="noopener noreferrer"&gt;GoDaddy, Amazon Route 53 and Namecheap append your domain&lt;/a&gt; in this way. Other hosts, like Cloudflare, accept either form. When in doubt, look up the record after saving (see Step 5).&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 3: Publish a DMARC record
&lt;/h2&gt;

&lt;p&gt;DMARC is one TXT record at &lt;code&gt;_dmarc.yourdomain.com&lt;/code&gt;. If you don't have one yet, start with a policy that only monitors:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.example.com.  TXT  "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;p=none&lt;/code&gt; means "don't block anything, just report". Gmail and Yahoo accept it as the minimum for bulk senders.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rua=&lt;/code&gt; is where receivers send daily summary reports. Without it, &lt;a href="https://www.rfc-editor.org/info/rfc9989" rel="noopener noreferrer"&gt;you get no reports&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Later, after the reports show all your real email passing, move to &lt;code&gt;p=quarantine&lt;/code&gt; (failures go to spam) and then &lt;code&gt;p=reject&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Our domain already had a DMARC record:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_dmarc.example.com.  TXT  "v=DMARC1; p=quarantine; adkim=r; aspf=r"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It worked as-is. The DKIM signature was for our own domain, so DKIM was aligned. &lt;code&gt;adkim=r&lt;/code&gt; and &lt;code&gt;aspf=r&lt;/code&gt; mean &lt;strong&gt;relaxed&lt;/strong&gt; alignment: a subdomain like &lt;code&gt;em1234.example.com&lt;/code&gt; counts as a match for &lt;code&gt;example.com&lt;/code&gt;. Relaxed is the default in the DMARC standard. Some guides suggest strict alignment (&lt;code&gt;s&lt;/code&gt;). Don't copy that blindly. With &lt;code&gt;aspf=s&lt;/code&gt;, a return path on &lt;code&gt;em1234.example.com&lt;/code&gt; no longer aligns with &lt;code&gt;example.com&lt;/code&gt;, so SPF stops counting for DMARC.&lt;/p&gt;

&lt;p&gt;One more note. Older guides use &lt;code&gt;pct=10&lt;/code&gt; to roll out a policy gradually. The current DMARC standard, &lt;a href="https://www.rfc-editor.org/info/rfc9989" rel="noopener noreferrer"&gt;RFC 9989&lt;/a&gt;, removed the &lt;code&gt;pct&lt;/code&gt; tag and added a &lt;code&gt;t=y&lt;/code&gt; test flag instead.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 4: Brand your links (optional, but do it)
&lt;/h2&gt;

&lt;p&gt;Most ESPs rewrite links to count clicks. By default the tracked links use the provider's domain. With link branding, they use a subdomain of yours, like &lt;code&gt;url1234.example.com&lt;/code&gt;. SendGrid gives you two more CNAME records for this.&lt;/p&gt;

&lt;p&gt;Turn on SSL for those links too. In SendGrid this is the "Auto provision SSL Certificate" option. Without it, your tracked links may load over plain &lt;code&gt;http&lt;/code&gt;. We enabled it at launch so every tracked link uses our own subdomain over &lt;code&gt;https&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5: Verify that it works
&lt;/h2&gt;

&lt;p&gt;First, check that the records exist at the right names. On macOS or Linux:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;dig +short TXT example.com
dig +short TXT _dmarc.example.com
dig +short CNAME em1234.example.com
dig +short CNAME s1._domainkey.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;On Windows, use &lt;code&gt;nslookup -type=TXT _dmarc.example.com&lt;/code&gt;. An empty result usually means a typo or a doubled domain name.&lt;/p&gt;

&lt;p&gt;Then click "Verify" in your ESP. Next, send a real email to a Gmail address you can read. Open it, click the three-dot &lt;strong&gt;More&lt;/strong&gt; menu next to Reply, and choose &lt;strong&gt;&lt;a href="https://support.google.com/mail/answer/29436" rel="noopener noreferrer"&gt;Show original&lt;/a&gt;&lt;/strong&gt;. You want to see:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SPF:   PASS with IP 203.0.113.10
DKIM:  'PASS' with domain example.com
DMARC: 'PASS'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Back in the message, click the small arrow under the sender's name. &lt;strong&gt;mailed-by&lt;/strong&gt; and &lt;strong&gt;signed-by&lt;/strong&gt; should both show your domain. There should be no "via sendgrid.net" next to the sender's name. Gmail shows &lt;a href="https://support.google.com/mail/answer/1311182" rel="noopener noreferrer"&gt;"via"&lt;/a&gt; when the sending domain doesn't match the From domain, so its absence is a good sign.&lt;/p&gt;

&lt;h3&gt;
  
  
  Verification checklist
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Exactly one &lt;code&gt;v=spf1&lt;/code&gt; record on the root domain&lt;/li&gt;
&lt;li&gt;[ ] DKIM records resolve at &lt;code&gt;selector._domainkey.yourdomain.com&lt;/code&gt;, not at a doubled name&lt;/li&gt;
&lt;li&gt;[ ] Return-path CNAME resolves&lt;/li&gt;
&lt;li&gt;[ ] DMARC TXT record at &lt;code&gt;_dmarc.yourdomain.com&lt;/code&gt; with a &lt;code&gt;rua&lt;/code&gt; address&lt;/li&gt;
&lt;li&gt;[ ] Gmail "Show original": SPF, DKIM and DMARC all PASS&lt;/li&gt;
&lt;li&gt;[ ] DKIM passes &lt;strong&gt;with your domain&lt;/strong&gt;, not the provider's&lt;/li&gt;
&lt;li&gt;[ ] mailed-by and signed-by show your domain; no "via"&lt;/li&gt;
&lt;li&gt;[ ] Branded links open over &lt;code&gt;https&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;From the LuneaMail team:&lt;/strong&gt; Our first plan was simple: send straight from our own Gmail account. That didn't survive spam filters and the risk of misuse, so we moved to authenticated sending from our own domain through a reputable provider. Nobody thinks about SPF, DKIM and DMARC until they send an important email and the customer never receives it. Set them up before your first send, not after your first support ticket.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Common mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Two SPF records.&lt;/strong&gt; Adding a new &lt;code&gt;v=spf1&lt;/code&gt; record instead of editing the existing one. Both fail.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Full host names at GoDaddy-style hosts.&lt;/strong&gt; You end up with &lt;code&gt;em1234.example.com.example.com&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Editing the root SPF when you don't need to.&lt;/strong&gt; With CNAME-based setups, the ESP's SPF is on the return-path subdomain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DKIM for the wrong domain.&lt;/strong&gt; "DKIM: PASS with domain sendgrid.net" is not aligned. DMARC needs your domain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Jumping to &lt;code&gt;p=reject&lt;/code&gt; on day one.&lt;/strong&gt; If a forgotten tool (a help desk, an invoicing app) sends as your domain without DKIM, its email disappears. Start with &lt;code&gt;p=none&lt;/code&gt;, read the reports, then tighten.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Strict alignment by copy-paste.&lt;/strong&gt; &lt;code&gt;adkim=s; aspf=s&lt;/code&gt; can fail mail that would pass under relaxed alignment.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sending from a free mailbox.&lt;/strong&gt; A From address at &lt;code&gt;gmail.com&lt;/code&gt; or &lt;code&gt;yahoo.com&lt;/code&gt; sent through an ESP can't pass DMARC for that domain. Use an address on your own domain.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These records are also the base of the rules Gmail and Yahoo apply to anyone sending in volume. We cover those in &lt;a href="https://luneamail.com/blog/gmail-yahoo-bulk-sender-rules" rel="noopener noreferrer"&gt;Gmail and Yahoo's bulk-sender rules&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  How LuneaMail handles this
&lt;/h2&gt;

&lt;p&gt;If you send with LuneaMail, you don't need a separate SendGrid account. In &lt;strong&gt;Settings › Domains&lt;/strong&gt;, you add your domain and LuneaMail lists the records to publish: the return path, two DKIM records and the branded-link records, each with a copy button. It also shows whether you already have a DMARC record. If you don't, it suggests a monitor-only one (&lt;code&gt;v=DMARC1; p=none;&lt;/code&gt;). Click &lt;strong&gt;Check DNS&lt;/strong&gt;, and the domain is verified once the required records pass. Branded links are optional and don't block sending.&lt;/p&gt;

&lt;p&gt;Until your domain is verified, campaigns go out from LuneaMail's own sender address, with your address as Reply-To, so they still pass DMARC. Every send also gets a spam and delivery check that looks at your domain's SPF and DMARC. See the full list on the &lt;a href="https://luneamail.com/features" rel="noopener noreferrer"&gt;features page&lt;/a&gt;. If you send app email like receipts or license keys, the same domain covers your &lt;a href="https://luneamail.com/transactional-email" rel="noopener noreferrer"&gt;transactional email&lt;/a&gt; through the &lt;a href="https://luneamail.com/developers" rel="noopener noreferrer"&gt;API&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://luneamail.com/blog/spf-dkim-dmarc-setup" rel="noopener noreferrer"&gt;LuneaMail blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>startup</category>
      <category>cybersecurity</category>
      <category>saas</category>
      <category>security</category>
    </item>
    <item>
      <title>Mailchimp alternatives for SaaS teams in 2026: honest comparison</title>
      <dc:creator>Lunea Labs</dc:creator>
      <pubDate>Wed, 28 Oct 2026 15:55:17 +0000</pubDate>
      <link>https://dev.to/lunealabs/mailchimp-alternatives-for-saas-teams-in-2026-honest-comparison-3ih0</link>
      <guid>https://dev.to/lunealabs/mailchimp-alternatives-for-saas-teams-in-2026-honest-comparison-3ih0</guid>
      <description>&lt;p&gt;Most lists of Mailchimp alternatives are written for newsletters and online stores. A SaaS company has a different problem: it sends two kinds of email. There are campaigns (launch announcements, onboarding tips, a monthly update) and there is app email (password resets, receipts, trial reminders, license keys) triggered by your product. Mailchimp handles the first well. For the second, &lt;a href="https://mailchimp.com/features/transactional-email/" rel="noopener noreferrer"&gt;Mailchimp Transactional&lt;/a&gt; is a separately billed add-on, available on Standard, Premium and legacy plans, starting at $20 per block of 25,000 emails.&lt;/p&gt;

&lt;p&gt;So the real question is whether you want one tool for both kinds of email or two tools that each do one job well. This comparison is built around that question. Every competitor price and plan detail below links to the vendor's own page, checked on 24 October 2026. We make LuneaMail, which is one of the options, so we have said where it fits and where it doesn't.&lt;/p&gt;

&lt;h2&gt;
  
  
  The short answer
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Newsletter or content-led growth, little app email:&lt;/strong&gt; &lt;a href="https://kit.com/pricing" rel="noopener noreferrer"&gt;Kit&lt;/a&gt; or &lt;a href="https://www.mailerlite.com/pricing" rel="noopener noreferrer"&gt;MailerLite&lt;/a&gt;. Both are cheaper and simpler than Mailchimp for this job.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Product-led SaaS that sends app email and campaigns, small team:&lt;/strong&gt; &lt;a href="https://loops.so/pricing" rel="noopener noreferrer"&gt;Loops&lt;/a&gt; is the established pick, with paid plans that don't cap sends. &lt;a href="https://www.brevo.com/pricing/" rel="noopener noreferrer"&gt;Brevo&lt;/a&gt; is the budget pick if you also want SMS. LuneaMail is a newer option in this group.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Developer-first, mostly app email:&lt;/strong&gt; &lt;a href="https://resend.com/pricing" rel="noopener noreferrer"&gt;Resend&lt;/a&gt; or &lt;a href="https://postmarkapp.com/pricing" rel="noopener noreferrer"&gt;Postmark&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Event-driven lifecycle across email, push and SMS, with a budget for it:&lt;/strong&gt; &lt;a href="https://customer.io/pricing" rel="noopener noreferrer"&gt;Customer.io&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Side-by-side comparison
&lt;/h2&gt;

&lt;p&gt;Prices are entry points in US dollars, checked 24 October 2026. They change often, so follow the links before you decide.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Tool&lt;/th&gt;
&lt;th&gt;Entry point&lt;/th&gt;
&lt;th&gt;Marketing campaigns&lt;/th&gt;
&lt;th&gt;Transactional API&lt;/th&gt;
&lt;th&gt;Visual builder&lt;/th&gt;
&lt;th&gt;Automations&lt;/th&gt;
&lt;th&gt;AI features&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Mailchimp&lt;/td&gt;
&lt;td&gt;Free: 250 contacts, 500 sends a month. Essentials shown at $13/mo for the first 12 months (50% intro offer), then priced by contacts&lt;/td&gt;
&lt;td&gt;Yes, every plan&lt;/td&gt;
&lt;td&gt;Paid add-on (Standard, Premium)&lt;/td&gt;
&lt;td&gt;Drag-and-drop&lt;/td&gt;
&lt;td&gt;4 flow steps on Essentials; up to 200 flows on Standard and Premium&lt;/td&gt;
&lt;td&gt;Generative AI on Standard and Premium only&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Brevo&lt;/td&gt;
&lt;td&gt;Free: 300 emails a day. Starter $9/mo&lt;/td&gt;
&lt;td&gt;Yes, every plan&lt;/td&gt;
&lt;td&gt;Yes, every plan&lt;/td&gt;
&lt;td&gt;Drag-and-drop&lt;/td&gt;
&lt;td&gt;Limited to 2,000 contacts on Free and Starter&lt;/td&gt;
&lt;td&gt;AI content generator, MCP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Loops&lt;/td&gt;
&lt;td&gt;Free: 4,000 sends per 30 days. Growth $49/mo for 5,000 contacts&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Yes, included&lt;/td&gt;
&lt;td&gt;Block editor&lt;/td&gt;
&lt;td&gt;Workflows on every plan&lt;/td&gt;
&lt;td&gt;Translation; MCP server&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Customer.io&lt;/td&gt;
&lt;td&gt;No free plan (14-day trial). Essentials from $100/mo&lt;/td&gt;
&lt;td&gt;Yes (broadcasts)&lt;/td&gt;
&lt;td&gt;Yes, every plan&lt;/td&gt;
&lt;td&gt;Drag-and-drop&lt;/td&gt;
&lt;td&gt;Visual workflow builder&lt;/td&gt;
&lt;td&gt;AI Agent, MCP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Resend&lt;/td&gt;
&lt;td&gt;Free tiers. Transactional Pro $20/mo; Marketing Pro $40/mo&lt;/td&gt;
&lt;td&gt;Yes (Broadcasts, separate plan)&lt;/td&gt;
&lt;td&gt;Yes, core product&lt;/td&gt;
&lt;td&gt;No-code editor (slash commands, Markdown)&lt;/td&gt;
&lt;td&gt;10,000 runs a month included&lt;/td&gt;
&lt;td&gt;AI credits in editor, MCP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Kit&lt;/td&gt;
&lt;td&gt;Free up to 10,000 subscribers. Creator $390/yr for 1,000&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Not mentioned on pricing page&lt;/td&gt;
&lt;td&gt;Email designer, custom HTML templates&lt;/td&gt;
&lt;td&gt;Paid plans only&lt;/td&gt;
&lt;td&gt;MCP on paid plans&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;MailerLite&lt;/td&gt;
&lt;td&gt;Free: 250 subscribers, 2,500 emails. Comfort from $12/mo&lt;/td&gt;
&lt;td&gt;Yes&lt;/td&gt;
&lt;td&gt;Separate product (MailerSend)&lt;/td&gt;
&lt;td&gt;Drag-and-drop, HTML, simple editors&lt;/td&gt;
&lt;td&gt;3 active on Free&lt;/td&gt;
&lt;td&gt;AI writing assistant on Comfort, MCP&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Postmark&lt;/td&gt;
&lt;td&gt;100 emails/mo free. Basic $15/mo for 10,000&lt;/td&gt;
&lt;td&gt;Via a separate broadcast stream&lt;/td&gt;
&lt;td&gt;Yes, core product&lt;/td&gt;
&lt;td&gt;Template editor&lt;/td&gt;
&lt;td&gt;None listed&lt;/td&gt;
&lt;td&gt;None listed&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;LuneaMail&lt;/td&gt;
&lt;td&gt;Free: 500 contacts, 2,000 emails. Pro $39/mo&lt;/td&gt;
&lt;td&gt;Yes, every plan&lt;/td&gt;
&lt;td&gt;Yes, every plan, same allowance&lt;/td&gt;
&lt;td&gt;Drag-and-drop plus HTML code mode&lt;/td&gt;
&lt;td&gt;Welcome emails on Pro and Team&lt;/td&gt;
&lt;td&gt;AI drafts with fact-check, built-in agent, MCP&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Each tool, briefly
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Mailchimp
&lt;/h3&gt;

&lt;p&gt;Mailchimp's &lt;a href="https://mailchimp.com/pricing/marketing/compare-plans/" rel="noopener noreferrer"&gt;Free plan&lt;/a&gt; covers 250 contacts and 500 sends a month (250 a day). Paid plans are priced by contacts; on 24 October 2026 the &lt;a href="https://mailchimp.com/pricing/marketing/" rel="noopener noreferrer"&gt;pricing page&lt;/a&gt; showed Essentials at $13 a month for the first 12 months under a 50%-off introductory offer. Its builders use &lt;a href="https://mailchimp.com/help/about-mailchimps-email-builders/" rel="noopener noreferrer"&gt;drag-and-drop content blocks&lt;/a&gt;, and its integration marketplace is a real strength. The catches for SaaS: automation flows are capped at 4 steps on Essentials, generative AI is only on Standard and Premium, and transactional email is the &lt;a href="https://mailchimp.com/features/transactional-email/" rel="noopener noreferrer"&gt;separate add-on&lt;/a&gt; mentioned above.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if&lt;/strong&gt; your team already knows it, you rely on its integrations, and your app email already goes through another provider. &lt;strong&gt;Skip it if&lt;/strong&gt; you want product email and campaigns on one bill. See our &lt;a href="https://luneamail.com/compare/mailchimp" rel="noopener noreferrer"&gt;Mailchimp comparison&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Brevo
&lt;/h3&gt;

&lt;p&gt;Brevo prices by email volume rather than contacts. The free plan sends &lt;a href="https://www.brevo.com/pricing/" rel="noopener noreferrer"&gt;up to 300 emails a day&lt;/a&gt; and includes 100,000 contacts, and &lt;a href="https://www.brevo.com/pricing.md" rel="noopener noreferrer"&gt;Starter is $9 a month&lt;/a&gt; with the first 5,000 emails included. Brevo says every plan includes &lt;a href="https://www.brevo.com/pricing/" rel="noopener noreferrer"&gt;transactional features: REST APIs, SMTP and outbound webhooks&lt;/a&gt;. It also covers SMS and WhatsApp. Marketing automation is &lt;a href="https://www.brevo.com/pricing/see-all-features/" rel="noopener noreferrer"&gt;limited to 2,000 contacts on Free and Starter&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if&lt;/strong&gt; you have a large list you email occasionally, or you want SMS in the same tool. &lt;strong&gt;Skip it if&lt;/strong&gt; you need automations for a bigger audience but only want to pay for Starter. See our &lt;a href="https://luneamail.com/compare/brevo" rel="noopener noreferrer"&gt;Brevo comparison&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Loops
&lt;/h3&gt;

&lt;p&gt;Loops was built for SaaS, and it appears on nearly every SaaS-focused list we read. Growth costs &lt;a href="https://loops.so/pricing" rel="noopener noreferrer"&gt;$49 a month for up to 5,000 contacts&lt;/a&gt;, and paid plans don't cap sends. Campaigns, workflows and transactional email live in one account, with all features on every plan. The free plan allows 4,000 sends per rolling 30 days to your first 1,000 contacts, with Loops branding. The &lt;a href="https://loops.so/docs/creating-emails/editor" rel="noopener noreferrer"&gt;editor is block-based&lt;/a&gt; with drag handles, and there is an &lt;a href="https://loops.so/docs/mcp-server" rel="noopener noreferrer"&gt;official MCP server&lt;/a&gt;. We found no AI copywriting in its docs; there is a one-click &lt;a href="https://loops.so/docs/creating-emails/translating-emails-with-ai" rel="noopener noreferrer"&gt;translation feature&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if&lt;/strong&gt; you send a lot of email to a modest list and want predictable pricing. &lt;strong&gt;Skip it if&lt;/strong&gt; you need pixel-level layout control in a classic drag-and-drop canvas. See our &lt;a href="https://luneamail.com/compare/loops" rel="noopener noreferrer"&gt;Loops comparison&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Customer.io
&lt;/h3&gt;

&lt;p&gt;Customer.io is the heavyweight for behaviour-driven messaging. Essentials &lt;a href="https://customer.io/pricing" rel="noopener noreferrer"&gt;starts at $100 a month&lt;/a&gt; with 5,000 profiles and 1 million emails a month; Premium starts at $1,000 a month billed yearly. Every plan includes transactional email, a visual workflow builder, a drag-and-drop editor, an AI Agent and an MCP server. There is no free plan, only a &lt;a href="https://docs.customer.io/accounts/billing/plan-features/" rel="noopener noreferrer"&gt;14-day trial&lt;/a&gt; with up to 5,000 messages, though its pricing page offers a year free to startups that have raised under $10M.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if&lt;/strong&gt; you have clean event data, someone to own journeys, and channels beyond email. &lt;strong&gt;Skip it if&lt;/strong&gt; you are pre-revenue and mostly need a welcome email and a monthly update. See our &lt;a href="https://luneamail.com/compare/customer-io" rel="noopener noreferrer"&gt;Customer.io comparison&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Resend
&lt;/h3&gt;

&lt;p&gt;Resend is a sending API built for developers. Its &lt;a href="https://resend.com/pricing" rel="noopener noreferrer"&gt;free transactional plan&lt;/a&gt; allows 3,000 emails a month (100 a day); Transactional Pro is $20 a month for 50,000 emails. Marketing Broadcasts are a separate plan, from $40 a month for 5,000 contacts. Automations are included with 10,000 runs a month. The &lt;a href="https://resend.com/docs/dashboard/broadcasts/editor" rel="noopener noreferrer"&gt;Broadcast editor&lt;/a&gt; is no-code, using slash commands, Markdown and a styling sidebar, and AI credits let you generate or edit content in the editor. There is also an &lt;a href="https://resend.com/docs/mcp-server" rel="noopener noreferrer"&gt;official MCP server&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if&lt;/strong&gt; engineers own email and you build templates in React Email or HTML. &lt;strong&gt;Skip it if&lt;/strong&gt; marketers need a drag-and-drop canvas, or you'd rather not run two plans. See our &lt;a href="https://luneamail.com/compare/resend" rel="noopener noreferrer"&gt;Resend comparison&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Kit
&lt;/h3&gt;

&lt;p&gt;Kit (formerly ConvertKit) is built for creators. The &lt;a href="https://kit.com/pricing" rel="noopener noreferrer"&gt;free Newsletter plan&lt;/a&gt; covers up to 10,000 subscribers with unlimited broadcasts. Visual automations and sequences start on Creator, which is $390 billed yearly for 1,000 subscribers. Its pricing page doesn't mention transactional email.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if&lt;/strong&gt; your growth runs on a newsletter. &lt;strong&gt;Skip it if&lt;/strong&gt; your product needs to send receipts or account email.&lt;/p&gt;

&lt;h3&gt;
  
  
  MailerLite
&lt;/h3&gt;

&lt;p&gt;MailerLite is simple and inexpensive. The &lt;a href="https://www.mailerlite.com/pricing" rel="noopener noreferrer"&gt;free plan&lt;/a&gt; covers 250 subscribers and 2,500 emails a month, with drag-and-drop, HTML and simple editors and up to 3 active automations; Comfort starts at $12 a month. Transactional email is a separate product, MailerSend.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if&lt;/strong&gt; you want a clean campaign tool on a small budget. &lt;strong&gt;Skip it if&lt;/strong&gt; you want app email in the same account.&lt;/p&gt;

&lt;h3&gt;
  
  
  Postmark
&lt;/h3&gt;

&lt;p&gt;Postmark is a transactional specialist. The &lt;a href="https://postmarkapp.com/pricing" rel="noopener noreferrer"&gt;Basic plan&lt;/a&gt; is $15 a month for 10,000 emails, with extra emails at $1.80 per 1,000, and a free developer plan of 100 emails a month for testing. It supports bulk email through a separate broadcast message stream, so transactional and marketing traffic never mix.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Pick it if&lt;/strong&gt; app email (password resets, receipts) is most of what you send and you want a tool that specialises in it. &lt;strong&gt;Skip it if&lt;/strong&gt; you want a marketing tool with automations and a visual builder.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to choose
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;You mostly send a newsletter.&lt;/strong&gt; Kit or MailerLite. You don't need a transactional API, and both free plans are generous for this use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You're a product-led SaaS sending app email and campaigns.&lt;/strong&gt; This is where most of the list matters. Decide whether you want one tool or two. One tool (Loops, Brevo, LuneaMail) means one contact list, one place for unsubscribes and one bill. Two tools (for example Postmark or Resend for app email, plus Kit or Mailchimp for campaigns) means each piece is best in class, but you keep two systems in sync. Then compare on price at your contact count: Loops at $49 for 5,000 contacts with no send cap is a strong benchmark.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Developers own email.&lt;/strong&gt; Resend or Postmark for the API. Add Resend's Broadcasts, or a separate marketing tool, when marketing starts asking for campaigns.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;You run lifecycle marketing across channels.&lt;/strong&gt; Customer.io. It costs more, but branching, event-driven journeys across email, push and SMS are what it is built for.&lt;/p&gt;

&lt;h2&gt;
  
  
  Where LuneaMail fits
&lt;/h2&gt;

&lt;p&gt;LuneaMail is new: it launched in October 2026. It doesn't have the years of track record, integration library or customer base that the tools above have, and you should weigh that.&lt;/p&gt;

&lt;p&gt;What it does: one plan covers campaigns and app email. The &lt;a href="https://luneamail.com/transactional-email" rel="noopener noreferrer"&gt;transactional API&lt;/a&gt; is on every plan and shares the same monthly allowance as campaigns, so there is no second product to buy. You design emails in a drag-and-drop builder with a brand kit, or switch to code mode and edit the HTML with Handlebars variables, conditions and loops. Campaigns get subject-line A/B tests that send the winner to the rest of the list, and every send gets a spam and deliverability check first. Signed webhooks report subscribes, unsubscribes, bounces, complaints and campaign events.&lt;/p&gt;

&lt;p&gt;On AI, LuneaMail writes a first draft from the facts you give it, then fact-checks the draft against your brief and flags anything it can't trace back. AI emails are capped on every plan: 15 a month on Free and 75 on Pro. A built-in marketing agent plans and runs tasks in your workspace and asks before it sends (25 messages a month on Free). An MCP connector lets agents in clients like Claude Code or Cursor read results and draft emails, and a real send needs your confirmation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://luneamail.com/pricing" rel="noopener noreferrer"&gt;Pricing&lt;/a&gt;: Free is $0 for 500 contacts and 2,000 emails a month. Pro is $39 a month ($32 billed yearly) for 2,500 contacts and 15,000 emails, with Pro 5× at $129 and Pro 20× at $329. Team is $35 per seat a month with at least 5 seats. Every account starts with a 14-day Pro trial with no card.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;When another tool is the better choice:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Price per contact.&lt;/strong&gt; Pro at $39 for 2,500 contacts costs more per contact than Loops at $49 for 5,000. If your list is large and your needs are simple, Loops or Brevo will cost less.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automations.&lt;/strong&gt; LuneaMail's automations are welcome emails when someone joins a list, on Pro and Team only. If you need multi-step, event-triggered sequences, Loops, Customer.io or Mailchimp Standard do more today.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Channels.&lt;/strong&gt; LuneaMail is email only. Brevo covers SMS and WhatsApp; Customer.io covers push and in-app.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pure transactional at volume.&lt;/strong&gt; If you only send app email, Postmark or Resend are more focused and cost less per email.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;LuneaMail is a reasonable pick if you're a small SaaS team that wants app email and campaigns in one place, wants both a visual builder and real HTML templates, and wants AI that checks its own drafts instead of inventing details.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;From the LuneaMail team:&lt;/strong&gt; Most email tools are built for marketers, and developers are left working around them: limited templates, limited access, and many steps to send one styled email. We wanted the opposite: a few simple steps to send a branded email, and the flexibility to change anything when needed, whether you're a developer pasting HTML or a marketer using the visual builder. AI assistants make that even easier, which is why LuneaMail can be run by AI agents too.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Before you switch
&lt;/h2&gt;

&lt;p&gt;Whichever tool you pick, do three things before you move a list. Check the price at the contact count you expect in a year, not today. Send a real receipt or password reset through the free tier to see how the API and templates feel. And confirm that unsubscribes and bounces flow into the same place your app email checks, so you never email someone who opted out.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://luneamail.com/blog/mailchimp-alternatives-for-saas" rel="noopener noreferrer"&gt;LuneaMail blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to send license key emails from your SaaS</title>
      <dc:creator>Lunea Labs</dc:creator>
      <pubDate>Tue, 27 Oct 2026 19:56:56 +0000</pubDate>
      <link>https://dev.to/lunealabs/how-to-send-license-key-emails-from-your-saas-4o4e</link>
      <guid>https://dev.to/lunealabs/how-to-send-license-key-emails-from-your-saas-4o4e</guid>
      <description>&lt;p&gt;A license key email is the message your app sends right after a purchase, with the key the buyer needs to activate your software. Send it from your server when your payment provider confirms the payment, not from the checkout page. Put the key in the body (never the subject line), in a format that is easy to copy. Add the product, the number of seats, the download links and a way to find the key again. Send it from your own authenticated domain, record that you sent it so it never goes out twice, and keep promotions out of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  What a license key email must contain
&lt;/h2&gt;

&lt;p&gt;Buyers' "where is my key?" threads show what goes wrong: keys land in spam, addresses are mistyped, keys get lost. A good email prevents those questions. Include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;The key itself&lt;/strong&gt;, on its own line, in a monospace font, with nothing else on that line.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;What it covers&lt;/strong&gt;: product name, plan, number of seats, and the expiry or renewal date if there is one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;How to activate it&lt;/strong&gt;: two or three short steps, or one link to your activation docs.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Download links&lt;/strong&gt;, if the product is installed software.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Where to find the key later&lt;/strong&gt;: a link to the account or billing page where the key is also shown.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Who to contact&lt;/strong&gt;: a reply-to address that a person reads, not &lt;code&gt;no-reply@&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An order reference&lt;/strong&gt;, so support can find the purchase quickly.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Sketch's keys start with &lt;code&gt;SK3&lt;/code&gt;, so buyers can &lt;a href="https://www.sketch.com/support/mac-only-licenses/license-key/" rel="noopener noreferrer"&gt;search their inbox for it&lt;/a&gt;. A fixed prefix on your keys saves support tickets.&lt;/p&gt;

&lt;h2&gt;
  
  
  When to send it: after the payment is confirmed
&lt;/h2&gt;

&lt;p&gt;Send the email from your backend when your payment provider confirms the payment. With Stripe Checkout, that is the &lt;code&gt;checkout.session.completed&lt;/code&gt; webhook (a webhook is an HTTP request the provider sends to your server when something happens), plus &lt;code&gt;checkout.session.async_payment_succeeded&lt;/code&gt; for slower payment methods such as bank transfers.&lt;/p&gt;

&lt;p&gt;Two rules from &lt;a href="https://docs.stripe.com/checkout/fulfillment" rel="noopener noreferrer"&gt;Stripe's fulfilment guide&lt;/a&gt; apply to every provider:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Don't rely on the thank-you page.&lt;/strong&gt; A buyer can pay and lose their connection before it loads. The webhook goes to your server directly and is retried if delivery fails.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expect to be called more than once.&lt;/strong&gt; Stripe says your fulfilment function "might be called multiple times, possibly concurrently, for the same Checkout Session." Send on every call and some buyers get two keys.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;So: confirm the payment, assign the key, save it with the order, then send the email and record the send. If the email fails, retry it without creating a new key.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;From the LuneaMail team:&lt;/strong&gt; We built LuneaMail because we needed to send highly customised emails from our own product, and there was no simple way to do it. With Gmail we ended up rendering templates in Google Sheets and trying plugins, and the result was far from what we wanted. HubSpot took many steps to send one styled email, and its templates limited what we could build. So we built the tool we wanted as developers: paste your HTML, make it dynamic with Handlebars, send your data as JSON, and the email goes out looking exactly as designed. A license key email is that idea in its simplest form: one person, one moment, their own data.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  A license key email template you can copy
&lt;/h2&gt;

&lt;p&gt;Replace the parts in &lt;code&gt;{{double braces}}&lt;/code&gt; with your data. The same names are used in the API example below.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Subject:&lt;/strong&gt; Your {{product}} license key&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Preheader&lt;/strong&gt; (the grey preview text after the subject in most inboxes): Your key, {{seats}} seats, and how to activate it.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Body:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Hi {{firstName}},&lt;/p&gt;

&lt;p&gt;Thanks for buying {{product}}. Here is your license key:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;{{licenseKey}}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;It includes {{seats}} seats.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;To activate:&lt;/strong&gt; open {{product}}, go to Settings › License, and paste the key. &lt;em&gt;(Use your product's real steps.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Download:&lt;/strong&gt; macOS · Windows&lt;/p&gt;

&lt;p&gt;You can see this key at any time in your account: {{accountUrl}}&lt;/p&gt;

&lt;p&gt;Order reference: {{orderId}}&lt;/p&gt;

&lt;p&gt;Questions? Reply to this email and a person will answer.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Keep the plain-text version the same. For several keys in one order, repeat a block with &lt;code&gt;{{#each}}&lt;/code&gt;, as the download links do below.&lt;/p&gt;

&lt;h2&gt;
  
  
  Send it with one API call
&lt;/h2&gt;

&lt;p&gt;With &lt;a href="https://luneamail.com/transactional-email" rel="noopener noreferrer"&gt;LuneaMail's transactional API&lt;/a&gt;, the template lives in your workspace, designed in the visual builder or written in HTML, and your server sends only the data. Variables use Handlebars: &lt;code&gt;{{licenseKey}}&lt;/code&gt; inserts a value, &lt;code&gt;{{#if seats}}…{{/if}}&lt;/code&gt; shows a section only when the data has it, and &lt;code&gt;{{#each downloads}}…{{/each}}&lt;/code&gt; repeats a block for each item in a list. In the visual builder, a section's "Show this section" condition becomes the same &lt;code&gt;{{#if}}&lt;/code&gt; block.&lt;/p&gt;

&lt;p&gt;The template body:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Hi {{firstName}}, thanks for buying {{product}}.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Your license key: &lt;span class="nt"&gt;&amp;lt;strong&amp;gt;&lt;/span&gt;{{licenseKey}}&lt;span class="nt"&gt;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

{{#if seats}}
  &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;It includes {{seats}} team seats.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
{{/if}}

{{#each downloads}}
  &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{{url}}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;Download for {{name}}&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;
{{/each}}

&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Find this key any time in &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"{{accountUrl}}"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;your account&lt;span class="nt"&gt;&amp;lt;/a&amp;gt;&lt;/span&gt;.&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;Order reference: {{orderId}}&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The call from your fulfilment code (Node.js):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;async&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;sendLicenseEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://app.luneamail.com/api/v1/send&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;method&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;POST&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;Authorization&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Bearer &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;LUNEAMAIL_API_KEY&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Content-Type&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;application/json&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;JSON&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;stringify&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
      &lt;span class="na"&gt;templateId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;LICENSE_TEMPLATE_ID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Your {{product}} license key&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;data&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;product&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Pro&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;licenseKey&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;licenseKey&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;seats&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;seats&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;orderId&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;accountUrl&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://example.com/account/licenses&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
        &lt;span class="na"&gt;downloads&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;macOS&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://example.com/download/mac&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
          &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Windows&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;url&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;https://example.com/download/windows&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="p"&gt;},&lt;/span&gt;
        &lt;span class="p"&gt;],&lt;/span&gt;
      &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="p"&gt;}),&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;202&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;messageId&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt; &lt;span class="c1"&gt;// { status: "queued", messageId }&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;markLicenseEmailSent&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;order&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;messageId&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`License email not sent: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The subject takes the same variables as the body. &lt;code&gt;to&lt;/code&gt; is one address per call.&lt;/p&gt;

&lt;h3&gt;
  
  
  What the API can answer
&lt;/h3&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Status&lt;/th&gt;
&lt;th&gt;Error&lt;/th&gt;
&lt;th&gt;What it means&lt;/th&gt;
&lt;th&gt;What to do&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;202&lt;/td&gt;
&lt;td&gt;–&lt;/td&gt;
&lt;td&gt;Accepted and queued&lt;/td&gt;
&lt;td&gt;Save the &lt;code&gt;messageId&lt;/code&gt; with the order&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;&lt;code&gt;MISSING_VARIABLE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The template uses a variable you didn't send&lt;/td&gt;
&lt;td&gt;Fix the data; nothing was sent&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;400&lt;/td&gt;
&lt;td&gt;&lt;code&gt;INVALID_TEMPLATE&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Wrong template ID, or the template is empty&lt;/td&gt;
&lt;td&gt;Check the ID&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;401&lt;/td&gt;
&lt;td&gt;&lt;code&gt;UNAUTHORIZED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Missing or wrong API key&lt;/td&gt;
&lt;td&gt;Check the key&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;422&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SUPPRESSED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The address bounced or reported spam before&lt;/td&gt;
&lt;td&gt;Don't retry; show the key in the app and ask for another address&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;429&lt;/td&gt;
&lt;td&gt;&lt;code&gt;RATE_LIMITED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;More than 600 sends a minute on this key&lt;/td&gt;
&lt;td&gt;Wait for the &lt;code&gt;Retry-After&lt;/code&gt; header&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;429&lt;/td&gt;
&lt;td&gt;&lt;code&gt;QUOTA_EXCEEDED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Your monthly email allowance is used up&lt;/td&gt;
&lt;td&gt;Top up or upgrade&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;502&lt;/td&gt;
&lt;td&gt;&lt;code&gt;SEND_FAILED&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;The send failed downstream&lt;/td&gt;
&lt;td&gt;Retry later&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;MISSING_VARIABLE&lt;/code&gt; is the useful one. Variables outside &lt;code&gt;{{#if}}&lt;/code&gt; and &lt;code&gt;{{#each}}&lt;/code&gt; are required, so if your code forgets &lt;code&gt;licenseKey&lt;/code&gt;, the API refuses instead of sending "Your license key:" with nothing after it. More on the &lt;a href="https://luneamail.com/developers" rel="noopener noreferrer"&gt;developers page&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  Don't send it twice
&lt;/h3&gt;

&lt;p&gt;With two webhook deliveries at the same moment, "check if sent, then send" can pass twice. Claim the order first with one atomic update, for example &lt;code&gt;UPDATE orders SET license_email = 'sending' WHERE id = $1 AND license_email IS NULL&lt;/code&gt;, and only send if a row changed.&lt;/p&gt;

&lt;h2&gt;
  
  
  Format the key so people can copy it
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Monospace, on its own line,&lt;/strong&gt; with no full stop after it to copy by mistake.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Groups with dashes&lt;/strong&gt;, like &lt;code&gt;ABCD-1234-EFGH&lt;/code&gt;, so it can be read aloud to support.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No look-alike characters&lt;/strong&gt; in your key alphabet: &lt;code&gt;0&lt;/code&gt; and &lt;code&gt;O&lt;/code&gt;, &lt;code&gt;1&lt;/code&gt;, &lt;code&gt;I&lt;/code&gt; and &lt;code&gt;l&lt;/code&gt;. Someone will type it from a screenshot.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Accept the key with or without dashes and spaces&lt;/strong&gt; when activating. Pasted text often has a trailing space.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Security: what not to put in the email
&lt;/h2&gt;

&lt;p&gt;A license key is a credential: whoever has it can use what the buyer paid for. Email is the expected way to deliver it, so limit the damage.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Not in the subject line.&lt;/strong&gt; Subjects appear in phone notifications, on lock screens and in inbox lists. "Your Pro license key" is fine; the key itself is not.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Show the key in the account too,&lt;/strong&gt; and let the owner replace it. A leaked email then has a fix.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;For high-value keys, send a link instead.&lt;/strong&gt; The email says "Your key is ready" and links to the account page behind a login.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Don't log the request body.&lt;/strong&gt; If your app logs every outgoing API call, your logs now hold every key you've sold.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resend only to the address on the order.&lt;/strong&gt; A "send my key again" form that accepts any address lets anyone collect keys.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Make sure it arrives
&lt;/h2&gt;

&lt;p&gt;A key in the spam folder becomes a support ticket, or a refund request.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Send from your own domain, authenticated.&lt;/strong&gt; Gmail &lt;a href="https://support.google.com/a/answer/81126" rel="noopener noreferrer"&gt;requires SPF or DKIM from every sender&lt;/a&gt; (SPF and DKIM are DNS records that prove a mail server may send for your domain). In LuneaMail you add your domain and its DKIM records once. Until the domain is verified, mail goes out from LuneaMail's address with replies going to yours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use a reply-to someone reads.&lt;/strong&gt; Buyers reply to license emails with real problems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Handle bounces.&lt;/strong&gt; If an address bounced before, the API returns &lt;code&gt;SUPPRESSED&lt;/code&gt; and sends nothing. Show the key in the account too, so a bad address never blocks a buyer.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Transactional, not marketing
&lt;/h2&gt;

&lt;p&gt;A license key email is transactional: it delivers what someone just paid for. The &lt;a href="https://www.ftc.gov/business-guidance/resources/can-spam-act-compliance-guide-business" rel="noopener noreferrer"&gt;FTC's CAN-SPAM guide&lt;/a&gt; counts messages that "deliver goods or services as part of a transaction that the recipient already has agreed to" as transactional, so you need no marketing consent and no unsubscribe link. In LuneaMail, people who unsubscribed from your newsletter still get their license emails.&lt;/p&gt;

&lt;p&gt;The catch: the FTC judges mixed emails by their primary purpose. A subject that reads like an ad, or a promotion above the key, can make the whole email commercial. So no discount banner, no newsletter sign-up, no "you might also like". Upsell in a separate marketing email, to people who agreed to receive one.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resends, wrong addresses and refunds
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Resend:&lt;/strong&gt; add an "Email my key again" button in the account. It calls the same function with the same template and the same key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrong address:&lt;/strong&gt; buyers mistype emails. Let support change the address on an order, then resend. The key should never be emailed to the new address without that check.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Refund or chargeback:&lt;/strong&gt; revoke the key on your license server. A short, factual notice is transactional too.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Checklist
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Email sent from the payment webhook, not the thank-you page&lt;/li&gt;
&lt;li&gt;[ ] One email per order, even if the webhook arrives twice&lt;/li&gt;
&lt;li&gt;[ ] Key in the body, monospace, on its own line; not in the subject&lt;/li&gt;
&lt;li&gt;[ ] Product, plan, seats, activation steps and order reference&lt;/li&gt;
&lt;li&gt;[ ] Link to the account page where the key is also shown&lt;/li&gt;
&lt;li&gt;[ ] A reply-to address a person reads&lt;/li&gt;
&lt;li&gt;[ ] Sent from your own domain with SPF and DKIM&lt;/li&gt;
&lt;li&gt;[ ] No promotions anywhere in the email&lt;/li&gt;
&lt;li&gt;[ ] Resend button that only sends to the order's address&lt;/li&gt;
&lt;li&gt;[ ] Key revoked on refund&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Common mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sending from the checkout success page.&lt;/strong&gt; Some buyers never reach it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;No idempotency.&lt;/strong&gt; Duplicate webhooks mean duplicate keys.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The key in the subject line.&lt;/strong&gt; Visible on every lock screen.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A blank key.&lt;/strong&gt; A missing variable rendered as an empty string. Fail loudly instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An upsell above the key.&lt;/strong&gt; It can turn a transactional email into a marketing one.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The key only in email.&lt;/strong&gt; Lose the email and the buyer has to contact support.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Sending license keys with LuneaMail
&lt;/h2&gt;

&lt;p&gt;LuneaMail's transactional API is one &lt;code&gt;POST /send&lt;/code&gt; call with a template ID, an address and your data. Your team designs the template in the same editor as your newsletters, so license emails match your brand without a second tool, and they use the same monthly allowance as campaigns on every plan, including Free (&lt;a href="https://luneamail.com/pricing" rel="noopener noreferrer"&gt;pricing&lt;/a&gt;). The same pattern works for other app email; see our guide to &lt;a href="https://luneamail.com/blog/team-invite-emails" rel="noopener noreferrer"&gt;team invite emails&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://luneamail.com/blog/license-key-emails" rel="noopener noreferrer"&gt;LuneaMail blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>backend</category>
      <category>saas</category>
      <category>startup</category>
    </item>
    <item>
      <title>Gmail and Yahoo bulk sender requirements for your app emails</title>
      <dc:creator>Lunea Labs</dc:creator>
      <pubDate>Mon, 26 Oct 2026 20:23:11 +0000</pubDate>
      <link>https://dev.to/lunealabs/gmail-and-yahoo-bulk-sender-requirements-for-your-app-emails-2pgj</link>
      <guid>https://dev.to/lunealabs/gmail-and-yahoo-bulk-sender-requirements-for-your-app-emails-2pgj</guid>
      <description>&lt;p&gt;Gmail and Yahoo have applied stricter rules to bulk senders since February 2024. Google calls you a bulk sender if you send close to 5,000 or more messages to personal Gmail accounts in 24 hours. Bulk senders must:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;authenticate with &lt;strong&gt;SPF and DKIM&lt;/strong&gt;, and publish a &lt;strong&gt;DMARC&lt;/strong&gt; record (&lt;code&gt;p=none&lt;/code&gt; is the minimum),&lt;/li&gt;
&lt;li&gt;make sure the visible From domain &lt;strong&gt;aligns&lt;/strong&gt; with the SPF or DKIM domain,&lt;/li&gt;
&lt;li&gt;add &lt;strong&gt;one-click unsubscribe&lt;/strong&gt; to marketing emails and honor opt-outs within two days,&lt;/li&gt;
&lt;li&gt;keep the &lt;strong&gt;spam complaint rate below 0.3%&lt;/strong&gt;, and aim for under 0.1%.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Smaller senders still need SPF or DKIM, valid reverse DNS, TLS and a spam rate below 0.3%.&lt;/p&gt;

&lt;p&gt;This article explains each rule as Google and Yahoo state it today, with links. It also covers what the rules mean for app emails like password resets and receipts, and a few launch problems we hit at LuneaMail that no rule mentions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Who counts as a bulk sender
&lt;/h2&gt;

&lt;p&gt;Google's &lt;a href="https://support.google.com/a/answer/14229414" rel="noopener noreferrer"&gt;sender guidelines FAQ&lt;/a&gt; defines a bulk sender as one that "sends close to 5,000 messages or more to personal Gmail accounts" within 24 hours. Two details in that FAQ matter for startups:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;"Messages sent from the same primary domain count toward the 5,000 limit."&lt;/strong&gt; Your app emails, newsletter and product updates all add up if they share &lt;code&gt;example.com&lt;/code&gt;, even when they use different subdomains.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;"Senders who meet the above criteria at least once are permanently considered bulk senders."&lt;/strong&gt; One busy launch day is enough. You don't go back.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Yahoo's &lt;a href="https://senders.yahooinc.com/best-practices/" rel="noopener noreferrer"&gt;Sender Hub&lt;/a&gt; does not publish a volume number. Treat the bulk rules as your baseline from the first email. They are not hard to meet, and an early-stage SaaS can cross the line in a single launch.&lt;/p&gt;

&lt;h2&gt;
  
  
  The rules side by side
&lt;/h2&gt;

&lt;p&gt;These are the requirements as Google's &lt;a href="https://support.google.com/a/answer/81126" rel="noopener noreferrer"&gt;email sender guidelines&lt;/a&gt; and Yahoo's &lt;a href="https://senders.yahooinc.com/best-practices/" rel="noopener noreferrer"&gt;best practices&lt;/a&gt; state them on 24 October 2026.&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Requirement&lt;/th&gt;
&lt;th&gt;All senders&lt;/th&gt;
&lt;th&gt;Bulk senders&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Authentication&lt;/td&gt;
&lt;td&gt;SPF &lt;strong&gt;or&lt;/strong&gt; DKIM&lt;/td&gt;
&lt;td&gt;SPF &lt;strong&gt;and&lt;/strong&gt; DKIM&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;DMARC&lt;/td&gt;
&lt;td&gt;Not required&lt;/td&gt;
&lt;td&gt;Required; policy can be &lt;code&gt;p=none&lt;/code&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;From alignment&lt;/td&gt;
&lt;td&gt;Not required&lt;/td&gt;
&lt;td&gt;From domain aligned with the SPF or DKIM domain&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Forward and reverse DNS (PTR)&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;td&gt;Required&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;TLS connection&lt;/td&gt;
&lt;td&gt;Required (Google)&lt;/td&gt;
&lt;td&gt;Required (Google)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Message format&lt;/td&gt;
&lt;td&gt;RFC 5322 (Yahoo also lists RFC 5321)&lt;/td&gt;
&lt;td&gt;Same&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Spam rate&lt;/td&gt;
&lt;td&gt;Below 0.3%&lt;/td&gt;
&lt;td&gt;Below 0.3%&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;One-click unsubscribe&lt;/td&gt;
&lt;td&gt;Not required&lt;/td&gt;
&lt;td&gt;Marketing and subscribed messages&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Honor unsubscribes&lt;/td&gt;
&lt;td&gt;Not stated&lt;/td&gt;
&lt;td&gt;Within 2 days (Yahoo), 48 hours (Google)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;A few terms. &lt;strong&gt;PTR&lt;/strong&gt; (reverse DNS) maps the sending server's IP address back to a name. Your email provider handles PTR and TLS for you, so as a SaaS team you mostly own the other rows. &lt;strong&gt;Alignment&lt;/strong&gt; means the domain people see in the From address matches the domain that passed SPF or DKIM. Yahoo says "relaxed alignment is acceptable", so &lt;code&gt;mail.example.com&lt;/code&gt; can align with &lt;code&gt;example.com&lt;/code&gt;. Google judges it at the organizational-domain level and only needs SPF or DKIM to align, not both.&lt;/p&gt;

&lt;p&gt;Google adds one more DKIM detail: sending to personal Gmail accounts "requires a DKIM key of 1024 bits or longer". Any current ESP meets this.&lt;/p&gt;

&lt;p&gt;If you haven't set up the records yet, our &lt;a href="https://luneamail.com/blog/spf-dkim-dmarc-setup" rel="noopener noreferrer"&gt;SPF, DKIM and DMARC setup guide&lt;/a&gt; walks through it with example DNS records.&lt;/p&gt;

&lt;h2&gt;
  
  
  What the rules mean for app emails
&lt;/h2&gt;

&lt;p&gt;Your SaaS sends two kinds of email:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Transactional&lt;/strong&gt;: password resets, verification links, receipts, license keys, security alerts. One person triggered them.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Marketing or subscribed&lt;/strong&gt;: newsletters, product announcements, onboarding drips, promotions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The authentication rules, the alignment rule and the spam-rate limit apply to &lt;strong&gt;both&lt;/strong&gt;. The volume counts both too.&lt;/p&gt;

&lt;p&gt;The unsubscribe rule is different. Google's FAQ says: "One-click unsubscribe is required only for marketing and promotional messages." It gives password resets and reservation confirmations as examples of transactional messages that don't need it. So your password reset email doesn't need an unsubscribe header. Your weekly product update does.&lt;/p&gt;

&lt;p&gt;Be honest about the line. A "receipt" that is half promotion is a marketing email. If you're unsure, add the header. It costs nothing.&lt;/p&gt;

&lt;h2&gt;
  
  
  One-click unsubscribe (RFC 8058)
&lt;/h2&gt;

&lt;p&gt;One-click unsubscribe means the mail app shows an "Unsubscribe" button next to your sender name. One click, no login, no "are you sure" page. It works through two email headers defined in &lt;a href="https://www.rfc-editor.org/rfc/rfc8058" rel="noopener noreferrer"&gt;RFC 8058&lt;/a&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;List-Unsubscribe: &amp;lt;https://example.com/unsubscribe/one-click/abc123&amp;gt;
List-Unsubscribe-Post: List-Unsubscribe=One-Click
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The URL must be &lt;code&gt;https&lt;/code&gt;. When the person clicks, their mail provider sends a &lt;code&gt;POST&lt;/code&gt; request to it, with no cookies or login. Your server must unsubscribe them from that request alone. RFC 8058 says the URL should contain a hard-to-forge identifier, so use a unique token per recipient, not their email address in plain text.&lt;/p&gt;

&lt;p&gt;Google also requires "a clearly visible unsubscribe link in the message body". The header and the link work together. Yahoo calls the RFC 8058 POST method "highly recommended" and asks you to honor unsubscribes within 2 days. Google recommends 48 hours.&lt;/p&gt;

&lt;p&gt;According to Google's FAQ, a missing one-click header does not cause automatic rejection. But people who can't unsubscribe easily press "Report spam" instead, and that hurts the next rule.&lt;/p&gt;

&lt;h2&gt;
  
  
  Spam rate: aim for 0.1%, never reach 0.3%
&lt;/h2&gt;

&lt;p&gt;The spam rate is the share of your emails that recipients mark as spam. Google says to "keep spam rates reported in Postmaster Tools below 0.10% and avoid ever reaching a spam rate of 0.30% or higher". That is 1 complaint per 1,000 emails as a target, and 3 per 1,000 as the hard limit. Google calculates it daily. Yahoo calculates its rate "based on mail delivered to the inbox".&lt;/p&gt;

&lt;p&gt;To watch your Gmail numbers, add your domain to &lt;a href="https://postmaster.google.com/" rel="noopener noreferrer"&gt;Google Postmaster Tools&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;What keeps the rate low:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Email only people who signed up, and send what they signed up for.&lt;/li&gt;
&lt;li&gt;Make unsubscribing easier than reporting spam.&lt;/li&gt;
&lt;li&gt;Stop emailing addresses that bounce or complain. Automatically, forever.&lt;/li&gt;
&lt;li&gt;Don't judge engagement by open rates alone (see below).&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Opens can lie
&lt;/h3&gt;

&lt;p&gt;Apple Mail Privacy Protection loads every email automatically, including the tracking pixel. Those "opens" are not people reading. If you count them, inactive contacts look engaged and you keep emailing them, which pushes up complaints. When we built LuneaMail's analytics, we stored those opens separately as machine opens. We also stopped counting clicks on unsubscribe and other footer links as engagement. A click on "Unsubscribe" is not interest.&lt;/p&gt;

&lt;h2&gt;
  
  
  What happens if you don't comply
&lt;/h2&gt;

&lt;p&gt;Google's FAQ says: "Starting November 2025, Gmail is ramping up its enforcement on non-compliant traffic." Enforcement is "gradual and progressive", and faster for new domains. In practice:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Temporary errors (&lt;code&gt;4.7.x&lt;/code&gt;)&lt;/strong&gt;: Gmail delays the message. The error code tells you which requirement failed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permanent errors (&lt;code&gt;5.7.x&lt;/code&gt;)&lt;/strong&gt;: the message is blocked.&lt;/li&gt;
&lt;li&gt;Messages may also go straight to spam.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If your spam rate spikes, Google only offers mitigation once it stays below 0.3% for 7 consecutive days. Microsoft announced &lt;a href="https://techcommunity.microsoft.com/blog/outlook/strengthening-email-ecosystem-outlook%E2%80%99s-new-requirements-for-high%E2%80%90volume-senders/4399730" rel="noopener noreferrer"&gt;its own requirements for high-volume senders to Outlook&lt;/a&gt; in 2025. Read that post too if many of your users have Outlook.com addresses.&lt;/p&gt;

&lt;h2&gt;
  
  
  The launch problem no rule mentions: your provider's plan
&lt;/h2&gt;

&lt;p&gt;You can pass every rule above and still send nothing. This happened to us during LuneaMail's launch.&lt;/p&gt;

&lt;p&gt;We sent through SendGrid. The account was on a free trial. The trial ended without us noticing, and SendGrid started refusing mail with a "Maximum credits exceeded" error. Every email stopped, including the ones that matter most: password resets and sign-up verification links. That means a new user can't confirm their account, and a locked-out user can't get back in.&lt;/p&gt;

&lt;p&gt;Before launch, check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Your email provider's plan, its monthly and daily limits, and when any trial ends&lt;/li&gt;
&lt;li&gt;[ ] What happens at the limit: a hard stop or overage billing&lt;/li&gt;
&lt;li&gt;[ ] An alert when sending fails, not just when the provider emails you&lt;/li&gt;
&lt;li&gt;[ ] That a password reset and a sign-up email arrive in a real Gmail and Yahoo inbox&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;From the LuneaMail team:&lt;/strong&gt; When you build your own email sending, you also take on the job of making sure it actually gets delivered. Authentication, unsubscribes, spam rates and your provider's limits all become your problem, and you usually find a gap only when someone doesn't get an email they were waiting for. That's a huge undertaking for a team that just wants to send a few branded emails, and a large part of why we built LuneaMail.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Common mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sending from &lt;code&gt;@gmail.com&lt;/code&gt; through an ESP.&lt;/strong&gt; Google's guidelines say "Don't impersonate Gmail From: headers" and point to Gmail's DMARC quarantine policy. Use an address on your own domain.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Unsubscribe link with no header.&lt;/strong&gt; The body link alone doesn't give the one-click button.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;An unsubscribe page that needs a login.&lt;/strong&gt; It is not one click, and people report spam instead.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Treating onboarding drips as transactional.&lt;/strong&gt; If it promotes features or upgrades, it's marketing.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Not suppressing bounces and complaints.&lt;/strong&gt; Every repeat send to a complainer adds to your spam rate.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trusting open rates.&lt;/strong&gt; Apple's automatic opens make dead lists look alive.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How LuneaMail handles this
&lt;/h2&gt;

&lt;p&gt;We built these rules into LuneaMail's send path, so a campaign can't go out without them:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Every campaign and automation email carries &lt;code&gt;List-Unsubscribe&lt;/code&gt; and &lt;code&gt;List-Unsubscribe-Post: List-Unsubscribe=One-Click&lt;/code&gt; headers, plus a visible unsubscribe link in the footer.&lt;/li&gt;
&lt;li&gt;The footer includes your postal address. LuneaMail won't send a campaign until you add one in &lt;strong&gt;Settings › Brand kit&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;From addresses at free mailbox providers like Gmail, Yahoo or Outlook are refused for campaigns. You send from your own domain, which you can authenticate in &lt;strong&gt;Settings › Domains&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;The workspace owner must confirm their email address before sending to a list.&lt;/li&gt;
&lt;li&gt;Unsubscribes, bounces and spam complaints are suppressed automatically.&lt;/li&gt;
&lt;li&gt;Apple's automatic opens are counted as machine opens, not real opens, and footer-link clicks don't count as engagement.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;App emails like receipts and license keys go through the same authenticated domain with the &lt;a href="https://luneamail.com/transactional-email" rel="noopener noreferrer"&gt;transactional email API&lt;/a&gt;. See the &lt;a href="https://luneamail.com/features" rel="noopener noreferrer"&gt;features page&lt;/a&gt; and the &lt;a href="https://luneamail.com/developers" rel="noopener noreferrer"&gt;developer docs&lt;/a&gt; for details.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;Originally published on the &lt;a href="https://luneamail.com/blog/gmail-yahoo-bulk-sender-rules" rel="noopener noreferrer"&gt;LuneaMail blog&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
