@cloudcomponents/cdk-responsive-email-template
v2.3.0
Published
Responsive email template for aws ses
Downloads
257
Maintainers
Readme
@cloudcomponents/cdk-responsive-email-template
Responsive mjml email template for aws ses
Install
TypeScript/JavaScript:
npm i @cloudcomponents/cdk-responsive-email-template
Python:
pip install cloudcomponents.cdk-responsive-email-template
How to use
import { ResponsiveEmailTemplate, TemplatePart } from '@cloudcomponents/cdk-responsive-email-template';
import { Stack, StackProps } from 'aws-cdk-lib';
import { Construct } from 'constructs';
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,
},
});
}
}
API Reference
See API.md.
Example
See more complete examples.