Skip to main content

Responsive email template for aws ses

Project description

cloudcomponents Logo

@cloudcomponents/cdk-responsive-email-template

Build Status cdkdx typescript python

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.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Built Distribution

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page