Skip to content

Use MJML to generate email templates for AWS Simple Email Service

Notifications You must be signed in to change notification settings

maddijoyce/serverless-ses-mjml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Serverless-SES-MJML

Serverless plugin that allows you to build responsive email templates in mjml.


Installation

Install the plugin via Yarn (recommended)

yarn add serverless-ses-mjml

or via NPM

npm install serverless-ses-mjml

Configuring the plugin

Add serverless-ses-mjml to the plugins section of serverless.yml

plugins:
   - serverless-ses-mjml

Add the following example config to the custom section of serverless.yml

custom:
  sesTemplates:
    location: # defaults to email-templates
    templates:
      - name: # template name
        subject: # subject line
        mjml: # mjml file name
        text: # text file name

Usage

serverless deploy

This command will deploy all SES template resources in the same CloudFormation template used by the other serverless resources.

serverless preview-template --template Template

This command will convert your mjml template to html and open it in your browser.

Issues

SES is only available in a limited number of regions. If you receive this uninformative error The CloudFormation template is invalid: Template format error: Unrecognized resource types: [AWS::SES::Template], it possibly means you're trying to deploy an SES template in a region where it's not possible.

Credits

Thanks to sid88in and everyone else who built the serverless-appsync-plugin. Your code was consulted often while I made this one. Cheers!

About

Use MJML to generate email templates for AWS Simple Email Service

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published