Skip to content

Mail client

Mail client · Type

NameTypeDescription
descriptionstring
logger
namespacestring
client.client(dsn: string) → Client

Create an SMTP client from a DSN string. The DSN’s host is checked the way mash.http checks a URL: no internal or reserved address unless an administrator allowed it.

client.from(senderAddress: string, senderDisplay?: string) → Client

Set the sender address and display name.

client.message(options?: array = []) → Message

Create a new email message.

client.parser(file: File)

Parse an email file (EML/MIME)

client.send(recipient: mixed, subject: mixed, body: mixed, attachments?: mixed = [], cc?: mixed = [], bcc?: mixed = [], replyTo?: mixed = [], delay?: int)

Send an email.

client.sendMessage(message: Message, delay?: int)

Send a pre-built message object.

client.sendWithTemplate(template: mixed, recipient: mixed, subject: string, data: array, attachments?: mixed = [], cc?: mixed = [], bcc?: mixed = [], replyTo?: mixed = [], delay?: int)

Send an email using a notification template.

client.template(template: mixed) → TemplateModel

Get a notification template by name, ID, or UUID.

client.templates() → TemplateModel[]

List this tenant’s notification templates.