Skip to main content

MailerParameters

@webda/mailer


Class: MailerParameters

Defined in: mailer/src/mailer.service.ts:23

Parameters for the Mailer service configuration

Configures the email transport and where templates are rendered from

Secret​

auth.pass,SES.credentials - nodemailer transport options to encrypt with webda config encrypt

Extends​

  • ServiceParameters

Constructors​

Constructor​

new MailerParameters(): MailerParameters

Returns​

MailerParameters

Inherited from​

ServiceParameters.constructor

Properties​

args?​

optional args?: string[]

Defined in: mailer/src/mailer.service.ts:180

Extra arguments for the sendmail command


auth?​

optional auth?: any

Defined in: mailer/src/mailer.service.ts:124

Authentication data for the transport (auth.pass can be encrypted with webda config encrypt)


authMethod?​

optional authMethod?: string

Defined in: mailer/src/mailer.service.ts:128

Preferred authentication method


buffer?​

optional buffer?: boolean

Defined in: mailer/src/mailer.service.ts:188

Return a Buffer instead of a stream for streamTransport


connectionTimeout?​

optional connectionTimeout?: number

Defined in: mailer/src/mailer.service.ts:108

Milliseconds to wait for the connection to establish


dkim?​

optional dkim?: any

Defined in: mailer/src/mailer.service.ts:140

DKIM configuration options


dnsTimeout?​

optional dnsTimeout?: number

Defined in: mailer/src/mailer.service.ts:120

Milliseconds to wait for DNS resolution


emailTemplateOptions?​

optional emailTemplateOptions?: object

Defined in: mailer/src/mailer.service.ts:51

Rendering options

juiceResources?​

optional juiceResources?: any

juice juiceResources options used to inline the CSS of the html part

Deep merged over the email-templates defaults: { applyStyleTags: false, removeStyleTags: false, webResources: { images: false, relativeTo } }, webResources.relativeTo being the templates folder

See​

https://github.com/Automattic/juice


greetingTimeout?​

optional greetingTimeout?: number

Defined in: mailer/src/mailer.service.ts:112

Milliseconds to wait for the greeting after connection is established


host?​

optional host?: string

Defined in: mailer/src/mailer.service.ts:76

SMTP server hostname or IP address


ignoreTLS?​

optional ignoreTLS?: boolean

Defined in: mailer/src/mailer.service.ts:88

Turns off STARTTLS support if true


jsonTransport?​

optional jsonTransport?: boolean

Defined in: mailer/src/mailer.service.ts:192

Return a JSON string representation of the message


localAddress?​

optional localAddress?: string

Defined in: mailer/src/mailer.service.ts:104

Local interface to bind to for network connections


maxConnections?​

optional maxConnections?: number

Defined in: mailer/src/mailer.service.ts:156

Count of maximum simultaneous connections to make against the SMTP server


maxMessages?​

optional maxMessages?: number

Defined in: mailer/src/mailer.service.ts:160

Limits the message count to be sent using a single connection


name?​

optional name?: string

Defined in: mailer/src/mailer.service.ts:100

Optional hostname of the client, used for identifying to the server


newline?​

optional newline?: string

Defined in: mailer/src/mailer.service.ts:184

Line ending style ("unix" or "windows") for sendmail or stream transport


opportunisticTLS?​

optional opportunisticTLS?: boolean

Defined in: mailer/src/mailer.service.ts:96

Attempts to upgrade the connection to TLS when advertised by the server


path?​

optional path?: string

Defined in: mailer/src/mailer.service.ts:176

Path to the sendmail command


pool?​

optional pool?: boolean

Defined in: mailer/src/mailer.service.ts:152

Use pooled connections instead of creating a new connection for every email


port?​

optional port?: number

Defined in: mailer/src/mailer.service.ts:80

SMTP port to connect to (defaults to 587 if secure is false or 465 if true)


proxy?​

optional proxy?: string

Defined in: mailer/src/mailer.service.ts:136

Proxy URL for SMTP connections


rateDelta?​

optional rateDelta?: number

Defined in: mailer/src/mailer.service.ts:164

Defines the time measuring period in milliseconds for rate limiting


rateLimit?​

optional rateLimit?: number

Defined in: mailer/src/mailer.service.ts:168

Limits the message count to be sent in rateDelta time


requireTLS?​

optional requireTLS?: boolean

Defined in: mailer/src/mailer.service.ts:92

Forces the client to use STARTTLS if true


secure?​

optional secure?: boolean

Defined in: mailer/src/mailer.service.ts:84

If true the connection uses TLS when connecting to server; if false then TLS is used if server supports the STARTTLS extension


sender?​

optional sender?: string

Defined in: mailer/src/mailer.service.ts:47

Define the default sender


sendmail?​

optional sendmail?: boolean

Defined in: mailer/src/mailer.service.ts:172

Use sendmail transport


service?​

optional service?: string

Defined in: mailer/src/mailer.service.ts:144

Well-known service name for nodemailer


SES?​

optional SES?: any

Defined in: mailer/src/mailer.service.ts:72

SES AWS Bean if transport === "ses"

Credentials inside can be encrypted with webda config encrypt


skipEncoding?​

optional skipEncoding?: boolean

Defined in: mailer/src/mailer.service.ts:196

Skip JSON encoding in jsonTransport


socketTimeout?​

optional socketTimeout?: number

Defined in: mailer/src/mailer.service.ts:116

Milliseconds of inactivity to allow before timing out the socket


streamTransport?​

optional streamTransport?: boolean

Defined in: mailer/src/mailer.service.ts:200

Return a stream instead of sending the message


templates?​

optional templates?: string

Defined in: mailer/src/mailer.service.ts:31

Folder containing the mailer templates

When set (or when templatesEngine is set), the mailer renders with its own renderer on this folder, even if a TemplateService is configured. Left unset, the templateService is used if it exists, otherwise ./templates


templatesEngine?​

optional templatesEngine?: string

Defined in: mailer/src/mailer.service.ts:37

Template engine to use with the mailer own renderer, mustache when unset

Setting it makes the mailer use its own renderer, like templates


templateService?​

optional templateService?: string

Defined in: mailer/src/mailer.service.ts:43

Name of the TemplateService to render with when neither templates nor templatesEngine are set

Default​

"TemplateService"

tls?​

optional tls?: any

Defined in: mailer/src/mailer.service.ts:132

Additional node.js TLSSocket options to be passed to the socket constructor


transport?​

optional transport?: string

Defined in: mailer/src/mailer.service.ts:66

Define the type of transport to use


type​

type: string

Defined in: core/lib/services/serviceparameters.d.ts:9

Type of the service

Inherited from​

ServiceParameters.type


url?​

optional url?: string

Defined in: mailer/src/mailer.service.ts:148

Connection URL for SMTP configuration

Methods​

load()​

load(params?): this

Defined in: mailer/src/mailer.service.ts:211

Load and apply defaults to the mailer parameters

templates and templatesEngine stay undefined when not configured: being set is what makes the mailer use its own renderer instead of the TemplateService

Parameters​

params?​

any = {}

Raw parameters to load

Returns​

this

this instance with defaults applied

Overrides​

ServiceParameters.load


update()​

update(params, delta): this

Defined in: core/lib/application/parameters.d.ts:21

Update parameters and call watchers if a parameter was changed

Parameters​

params​

any

the service parameters

delta​

any

the delta

Returns​

this

this for chaining

Inherited from​

ServiceParameters.update


with()​

with(callback): this

Defined in: core/lib/application/parameters.d.ts:27

Watch for changes on the parameters and call watchers when a parameter is changed

Parameters​

callback​

(params) => void

the callback function

Returns​

this

this for chaining

Inherited from​

ServiceParameters.with