Skip to main content

Class: MessagingUtils

Defined in: core/src/MessagingUtils.ts:75

Simple utility class for sending templated messages via e-mail, SMS and more.

Constructors

Constructor

new MessagingUtils(): MessagingUtils

Returns

MessagingUtils

Properties

slackApps

protected slackApps: any[] = []

Defined in: core/src/MessagingUtils.ts:76


slackConfigs

protected slackConfigs: any[] = []

Defined in: core/src/MessagingUtils.ts:78

Methods

init()

init(): Promise<void>

Defined in: core/src/MessagingUtils.ts:96

Returns

Promise<void>


loadTemplate()

loadTemplate(name): Template

Defined in: core/src/MessagingUtils.ts:168

Loads the template with the given name and returns its contents as a string.

Parameters

name

string

The name of the template to load.

Returns

Template


sendEmail()

sendEmail(templateName, templateVars, options?): Promise<any>

Defined in: core/src/MessagingUtils.ts:207

Sends an email using the given template name and variables.

Parameters

templateName

string

The name of the email template to send.

templateVars

any

The map of variables to inject into the template.

options?

any = {}

The map of additional options to pass into the sendMail function.

Returns

Promise<any>


sendSlack()

sendSlack(templateName, templateVars): Promise<any[] | undefined>

Defined in: core/src/MessagingUtils.ts:253

Sends an Slack message using the given template name and variables.

Parameters

templateName

string

The name of the Slack template to send.

templateVars

any

The map of variables to inject into the template.

Returns

Promise<any[] | undefined>


sendSMS()

sendSMS(templateName, templateVars, options?): Promise<any>

Defined in: core/src/MessagingUtils.ts:286

Sends an SMS using the given template name and variables.

Parameters

templateName

string

The name of the SMS template to send.

templateVars

any

The map of variables to inject into the template.

options?

any = {}

The map of additional options to pass into the sendMail function.

Returns

Promise<any>