Overview

Patterns and guidelines for creating and sending emails to Stack Overflow users & customers.

Introduction

Emails are a great opportunity to showcase the brand’s personality to loyal users or perspective customers who may otherwise only interact with the product itself.

From transactional updates to editorial moments, every email is a chance to strengthen familiarity with the brand and build a more connected experience.

These guidelines are designed to provide a foundation for what those emails can be, while leaving room to evolve and expand over time.

Creating emails

Our documentation is built from components built with MJML – an open-source email framework that abstracts away the need to manually code email HTML. Read the full documentation.

Templates

We have a range of email templates, each serving a distinct purpose while demonstrating how communication can scale from functional to expressive.

Functional Expressive

Transactional email template preview

Transactional

A transactional email is functional. It is triggered by an event and usually is a short single message and call to action.

Newsletter email template preview

Newsletter

A newsletter is a recurring pieces of comms that may contain various items and call to actions.

Promotional email template preview

Promotional

Typically single-message communications - short, punchy, and to the point — designed to quickly capture attention and drive engagement.

Components

Each email is built from reusable component blocks. The set below is the canonical starting library.

Header component preview

Top brand strip and utility nav variations.

Footer component preview

Legal metadata and recipient preference links.

Title component preview

Title

Section title treatments.

Headline component preview

Headline

Large hero headline treatments.

Button component preview

Button

Reusable CTA primitive used across blocks.

Subtitle component preview

Subtitle

Supporting labels and secondary lines.

Text component preview

Text

Body copy plus alert, quote, and highlight component examples.

Cards component preview

Cards

Simple, link, and CTA card layouts.

Graphic component preview

Graphic

Standalone illustration placeholder block.

Dividers component preview

Dividers

Subtle and strong horizontal separators.

Spacers component preview

Spacers

Preset vertical rhythm utilities.

Usage

Warning

Warning: This functionality is experimental and may change.

If you are running the @stackoverflow/stacks-email package, you can compose and render email markup by POSTing a JSON block list to the compile API.

POST /api/compile

Paramaters

  • template: currently supports "transactional".
  • target: one of "preview", "dotnet", or "braze".
  • blocks: ordered array of block definitions.
  • previewText: optional template preheader/inbox snippet text.

Example request:

{
  "template": "transactional",
  "target": "preview",
  "previewText": "Reset your password in one click.",
  "blocks": [
    {
      "type": "headline",
      "variant": "highlight",
      "props": {
        "textContent": "Reset your password",
        "textHighlight": true
      }
    },
    {
      "type": "text",
      "variant": "body",
      "props": {
        "textContent": "Hi [[FIRST_NAME]], click below to continue."
      }
    },
    {
      "type": "button",
      "variant": "primary",
      "props": {
        "href": "[[CTA_URL]]",
        "text": "Reset password"
      }
    }
  ]
}

Response

Successful responses include compiled html, final mjml, renderedMjml, compile errors, and metadata such as template, target, and blockCount.


Target clients

Litmus publishes a regularly updated list of email clients and their observed market share, you can use this as a rough guideline when testing and making decisons about compatability.

ClientShare (%)
Apple45.51
Gmail23.54
Outlook5.67
Yahoo Mail2.06
Google Android1.34
Outlook.com0.40
Thunderbird0.17
Orange.fr0.08
Bell Email0.02
Samsung Mail0.02


Other resources

email.stackoverflow.design

Our own gallery of email designs. These templates are used to build the examples in this section lives along side the email components so feel free to add your templates back in to serve as inspiration for others.

Can I email?

caniemail.com

On occasion you may need to hard code some elements of email, if straying from the components here or implementing something ourside of the scope of MJML. ‘Can I email’ is a great resource for dealing with the eccentricities of email development.

Really Good Emails

reallygoodemails.com

A constantly evolving gallery of email designs from across the web. Espeically useful for designers or product managers planning out a new email.