import * as sweet from 'express-sweet';
const client = new sweet.services.AWSSesClient({
apiVersion: 'API Version ("YYYYY-MM-DD" or "latest")',
region: 'the region to send service requests to',
accessKeyId: 'your AWS access key ID',
secretAccessKey: 'your AWS secret access key',
});
const sweet = require('express-sweet');
const client = new sweet.services.AWSSesClient({
apiVersion: 'API Version ("YYYYY-MM-DD" or "latest")',
region: 'the region to send service requests to',
accessKeyId: 'your AWS access key ID',
secretAccessKey: 'your AWS secret access key',
});
public send()
Send email.
Parameters:
type: 'text'|'html'
E-Mail type ('html': HTML mail, 'text': text mail). Default is 'text'.
Return:
Promise<string> Unique ID assigned by Amazon SES for a successfully sent email.
import * as sweet from 'express-sweet';
const client = new sweet.services.AWSSesClient({
apiVersion: 'API Version ("YYYYY-MM-DD" or "latest")',
region: 'the region to send service requests to',
accessKeyId: 'your AWS access key ID',
secretAccessKey: 'your AWS secret access key',
});
// Send email.
await client
.from('from@example.com', 'Sender Name')
.to('to@example.com')
.subject('Test email')
.body('Hi, this is a test email')
.send();
// Use variables in the body of the e-mail.
// The body can use the handlebars and handlebars-extd syntax.
await client
.from('from@example.com', 'Sender Name')
.to('to@example.com')
.subject('Test email')
.body('Hello ', {name: 'Mason'})
.send();
const sweet = require('express-sweet');
const client = new sweet.services.AWSSesClient({
apiVersion: 'API Version ("YYYYY-MM-DD" or "latest")',
region: 'the region to send service requests to',
accessKeyId: 'your AWS access key ID',
secretAccessKey: 'your AWS secret access key',
});
// Send email.
await client
.from('from@example.com', 'Sender Name')
.to('to@example.com')
.subject('Test email')
.body('Hi, this is a test email')
.send();
// Use variables in the body of the e-mail.
// The body can use the handlebars and handlebars-extd syntax.
await client
.from('from@example.com', 'Sender Name')
.to('to@example.com')
.subject('Test email')
.body('Hello ', {name: 'Mason'})
.send();