Responsive mjml email template for aws ses
TypeScript/JavaScript:
npm i @cloudcomponents/cdk-responsive-email-template
Python:
pip install cloudcomponents.cdk-responsive-email-template
import { Construct, Stack, StackProps } from '@aws-cdk/core';
import { ResponsiveEmailTemplate, TemplatePart } from '@cloudcomponents/cdk-responsive-email-template';
export class ResponsiveEmailTemplateStack extends Stack {
constructor(scope: Construct, id: string, props: StackProps) {
super(scope, id, props);
new ResponsiveEmailTemplate(this, 'EmailTemplate', {
templateName: 'demo',
subjectPart: 'cloudcomponents - {{ title }}',
textPart: TemplatePart.fromInline('text message'),
htmlPart: TemplatePart.fromInline(`<mjml>
<mj-head>
<mj-title>cloudcomponents - {{ title }}</mj-title>
</mj-head>
<mj-body>
<mj-section>
<mj-column>
<mj-text>
Hello {{ name }}!
</mj-text>
</mj-column>
</mj-section>
</mj-body>
</mjml>`),
parsingOptions: {
beautify: true,
},
});
}
}
See API.md.
See more complete examples.