I’ve been working on a few updates to my Markdown to Sendy script that add some nice quality-of-life improvements for creating email campaigns. The main additions are support for greeting/salutation customization and a new button liquid tag that makes it easier to create styled call-to-action buttons.

Greetings and Salutations

The script now supports customizable greetings that can be set in your template configuration. You can define a default greeting in your config.yml:

template:
  greeting: 'Hey [Name,fallback=there],'
  # or use the alias:
  salutation: 'Hey [Name,fallback=there],'

The salutation key takes precedence if both are defined, which is useful if you want to keep things semantic. The greeting will automatically appear after the header image and before the first paragraph in your email.

You can also override it in the YAML frontmatter of individual emails:

title: My Email
greeting: 'Hello everyone,'

Or use a liquid tag to place it anywhere in your markdown:

{% greeting %}

This is the email content.

You can even provide a custom greeting directly in the tag:

{% greeting "Hi there" %}

The greeting text can contain Markdown or HTML and will be processed accordingly. The [Name,fallback=there] syntax is a Sendy merge tag that gets replaced when the email is sent.

Button Liquid Tags

One of the more tedious parts of creating email buttons has been remembering the exact syntax for applying classes. The new {% button %} liquid tag makes this much easier.

You can use it with named attributes:

{% button class="primary" text="Click Here" url="https://example.com" %}
{% button text="Click Here" url="https://example.com" %}

Or with positional arguments:

{% button "Click Here" https://example.com %}
{% button alt "Click Here" https://example.com %}

The second example uses the alt class, which maps to the secondary button style. You can also use alt2 for tertiary buttons. These classes (alt and alt2) are aliases for secondary and tertiary, making it quick to type common variants.

Button tags also support markdown reference-style links, which is great for keeping your markdown clean:

[Forum]: https://forum.brettterpstra.com
[Markdown Web]: https://forum.brettterpstra.com/t/how-about-a-markdown-web/4412/12

{% button "Join the Conversation!" [Forum] %}
{% button alt "How about a Markdown Web?" [Markdown Web] %}

Reference matching is case-insensitive, so [Forum], [forum], and [FORUM] all work the same way.

Note that button creation and styling requires a Markdown processor that handles IALs, such as Kramdown or Apex. I recommend installing Apex for this tool.

I know this is a project with a niche audience, but I’m aware of a few people are already getting some use out of this. I know I personally love it. If you publish a newsletter or send marketing emails, let me know what you’d need to see before it was useful in your own situation.

Check the script out on GitHub.