Skip to main content

Class: Email

Defined in: models/email.ts:16

Represents an email that is sent to a user

Constructors

Constructor

new Email(props): Email

Defined in: models/email.ts:38

Creates an instance of an Email

Parameters

props

EmailProps

Returns

Email

Properties

emailAddress?

optional emailAddress: string

Defined in: models/email.ts:21

The emailAddress to send an email to


emailBody?

optional emailBody: IKeyValue

Defined in: models/email.ts:27

An object of the emailBody contents, such as who to send the email to, heading, body, etc.


htmlBody?

optional htmlBody: string

Defined in: models/email.ts:30

The HTML of the email


subject?

optional subject: string

Defined in: models/email.ts:24

The subject of the email, either invite or otp


id

static id: string = 'email'

Defined in: models/email.ts:18

The ID used to distinguish email from other classes/DB entries

Methods

buildInviteHtml()

buildInviteHtml(name, roomUrl): void

Defined in: models/email.ts:48

Builds an invitation URL

Parameters

name

string

The name of the user sending an invite to

roomUrl

string

The URL of the room

Returns

void


buildOtpHtml()

buildOtpHtml(displayName, otp): void

Defined in: models/email.ts:84

Builds the HTML for an OTP email

Parameters

displayName

string

The name of the user requesting the OTP

otp

string

The OTP that is generated

Returns

void


buildUrl()

buildUrl(shortname): string

Defined in: models/email.ts:120

Builds a room URL

Parameters

shortname

string

The room shortname

Returns

string

a room URL


sendEmail()

sendEmail(key): Promise<any>

Defined in: models/email.ts:149

Sends an email to a user using forwardemail

Parameters

key

string

The email API key

Returns

Promise<any>

true if email was successfully sent | false if there was an error


setEmailBody()

setEmailBody(): void

Defined in: models/email.ts:127

Sets the emailBody property

Returns

void