scope
| constructs.Construct
| *No description.* |
+| id
| string
| *No description.* |
+| props
| MjmlTemplateProps
| *No description.* |
+
+---
+
+##### `scope`Required
+
+- *Type:* constructs.Construct
+
+---
+
+##### `id`Required
+
+- *Type:* string
+
+---
+
+##### `props`Required
+
+- *Type:* MjmlTemplateProps
+
+---
+
+#### Methods
+
+| **Name** | **Description** |
+| --- | --- |
+| toString
| Returns a string representation of this construct. |
+
+---
+
+##### `toString`
+
+```typescript
+public toString(): string
+```
+
+Returns a string representation of this construct.
+
+#### Static Functions
+
+| **Name** | **Description** |
+| --- | --- |
+| isConstruct
| Checks if `x` is a construct. |
+
+---
+
+##### ~~`isConstruct`~~
+
+```typescript
+import { MjmlTemplate } from 'cloudstructs'
+
+MjmlTemplate.isConstruct(x: any)
+```
+
+Checks if `x` is a construct.
+
+###### `x`Required
+
+- *Type:* any
+
+Any object.
+
+---
+
+#### Properties
+
+| **Name** | **Type** | **Description** |
+| --- | --- | --- |
+| node
| constructs.Node
| The tree node. |
+| templateName
| string
| The name of the template. |
+
+---
+
+##### `node`Required
+
+```typescript
+public readonly node: Node;
+```
+
+- *Type:* constructs.Node
+
+The tree node.
+
+---
+
+##### `templateName`Required
+
+```typescript
+public readonly templateName: string;
+```
+
+- *Type:* string
+
+The name of the template.
+
+---
+
+
### SamlIdentityProvider
Create a SAML identity provider.
@@ -2014,6 +2130,65 @@ A regular expression to whitelist source email addresses.
---
+### MjmlTemplateProps
+
+Properties for a MjmlTemplate.
+
+#### Initializer
+
+```typescript
+import { MjmlTemplateProps } from 'cloudstructs'
+
+const mjmlTemplateProps: MjmlTemplateProps = { ... }
+```
+
+#### Properties
+
+| **Name** | **Type** | **Description** |
+| --- | --- | --- |
+| mjml
| string
| The MJML for the email. |
+| subject
| string
| The subject line of the email. |
+| templateName
| string
| The name of the template. |
+
+---
+
+##### `mjml`Required
+
+```typescript
+public readonly mjml: string;
+```
+
+- *Type:* string
+
+The MJML for the email.
+
+---
+
+##### `subject`Required
+
+```typescript
+public readonly subject: string;
+```
+
+- *Type:* string
+
+The subject line of the email.
+
+---
+
+##### `templateName`Optional
+
+```typescript
+public readonly templateName: string;
+```
+
+- *Type:* string
+- *Default:* a CloudFormation generated name
+
+The name of the template.
+
+---
+
### SamlIdentityProviderProps
Properties for a SamlProvider.
diff --git a/README.md b/README.md
index 7bdd3126..e862e969 100644
--- a/README.md
+++ b/README.md
@@ -18,6 +18,8 @@ Version >= 0.2.0 requires AWS CDK v2.
* [`EmailReceiver`](src/email-receiver) Receive emails through SES, save them to S3
and invoke a Lambda function
+* ['MjmlTemplate`](src/mjml-template) SES email template from [MJML](https://mjml.io/)
+
* [`SlackApp`](src/slack-app) Deploy Slack apps from manifests
* [`SlackEvents`](src/slack-events) Send Slack events to Amazon EventBridge
diff --git a/package.json b/package.json
index 2811eaa4..0af03085 100644
--- a/package.json
+++ b/package.json
@@ -42,6 +42,11 @@
"docgen": "npx projen docgen",
"eject": "npx projen eject",
"eslint": "npx projen eslint",
+ "integ:mjml-template:assert": "npx projen integ:mjml-template:assert",
+ "integ:mjml-template:deploy": "npx projen integ:mjml-template:deploy",
+ "integ:mjml-template:destroy": "npx projen integ:mjml-template:destroy",
+ "integ:mjml-template:snapshot": "npx projen integ:mjml-template:snapshot",
+ "integ:mjml-template:watch": "npx projen integ:mjml-template:watch",
"integ:slack-app:assert": "npx projen integ:slack-app:assert",
"integ:slack-app:deploy": "npx projen integ:slack-app:deploy",
"integ:slack-app:destroy": "npx projen integ:slack-app:destroy",
@@ -99,6 +104,7 @@
"@aws-sdk/lib-dynamodb": "^3.600.0",
"@types/aws-lambda": "^8.10.140",
"@types/jest": "^29",
+ "@types/mjml": "^4.7.4",
"@types/node": "^18",
"@types/tsscmp": "^1.0.2",
"@typescript-eslint/eslint-plugin": "^7",
@@ -132,11 +138,13 @@
},
"dependencies": {
"@slack/web-api": "^6.12.0",
- "got": "^11.8.6"
+ "got": "^11.8.6",
+ "mjml": "^4.15.3"
},
"bundledDependencies": [
"@slack/web-api",
- "got"
+ "got",
+ "mjml"
],
"keywords": [
"cdk"
@@ -223,6 +231,7 @@
"./lib/dmarc": "./lib/dmarc/index.js",
"./lib/ecs-service-roller": "./lib/ecs-service-roller/index.js",
"./lib/email-receiver": "./lib/email-receiver/index.js",
+ "./lib/mjml-template": "./lib/mjml-template/index.js",
"./lib/saml-identity-provider": "./lib/saml-identity-provider/index.js",
"./lib/slack-app": "./lib/slack-app/index.js",
"./lib/slack-events": "./lib/slack-events/index.js",
diff --git a/src/index.ts b/src/index.ts
index 64e40330..874dcdbc 100644
--- a/src/index.ts
+++ b/src/index.ts
@@ -3,6 +3,7 @@ export * from './slack-textract';
export * from './static-website';
export * from './state-machine-cr-provider';
export * from './email-receiver';
+export * from './mjml-template';
export * from './ecs-service-roller';
export * from './url-shortener';
export * from './saml-identity-provider';
diff --git a/src/mjml-template/README.md b/src/mjml-template/README.md
new file mode 100644
index 00000000..199f2e87
--- /dev/null
+++ b/src/mjml-template/README.md
@@ -0,0 +1,38 @@
+# MjmlTemplate
+
+SES email template from [MJML](https://mjml.io/)
+
+## Usage
+
+Define a `MjmlTemplate`:
+
+```ts
+import { Stack, StackProps } from 'aws-cdk-lib';
+import * as cloudstructs from 'cloudstructs';
+import { Construct } from 'constructs';
+
+export class MyStack extends Stack {
+ constructor(scope: Construct, id: string, props?: StackProps) {
+ super(scope, id, props);
+
+ const mjml = `
+
+
+
+
+
+
+
+
+
|
+
\n \n \n \n \n \n \n \n
| \n