@travetto/email-nodemailer
v5.0.13
Published
Email transmission module.
Downloads
462
Maintainers
Readme
Email Nodemailer Support
Email transmission module.
Install: @travetto/email-nodemailer
npm install @travetto/email-nodemailer
# or
yarn add @travetto/email-nodemailer
Given the integration with nodemailer, all extensions should be usable out of the box. The primary nodemailer modules are provided (assuming dependencies are installed):
Code: sendmail to send all messages via the sendmail operation
import { InjectableFactory } from '@travetto/di';
import { NodemailerTransport } from '@travetto/email-nodemailer';
class Config {
@InjectableFactory()
static getTransport() {
return new NodemailerTransport({ sendmail: true });
}
}
Code: smtp to send all messages via the smtp operation
import { InjectableFactory } from '@travetto/di';
import { NodemailerTransport } from '@travetto/email-nodemailer';
class Config {
@InjectableFactory()
static getTransport() {
return new NodemailerTransport({
service: 'smtp'
});
}
}
Code: ses to send all messages via the ses operation
import { SESClient } from '@aws-sdk/client-ses';
import { InjectableFactory } from '@travetto/di';
import { NodemailerTransport } from '@travetto/email-nodemailer';
class Config {
@InjectableFactory()
static getTransport() {
return new NodemailerTransport({
SES: SESClient
});
}
}