Module: loopback

Class: Email

Email

Email model. Extends LoopBack base Model.

Class Properties
Name Type Description
to String

Email addressee. Required.

from String

Email sender address. Required.

subject String

Email subject string. Required.

text String

Text body of email.

html String

HTML body of email.

Email.send(options, callback)

Send an email with the given options.

Example Options:

{
  from: "Fred Foo <foo@blurdybloop.com>", // sender address
  to: "bar@blurdybloop.com, baz@blurdybloop.com", // list of receivers
  subject: "Hello", // Subject line
  text: "Hello world", // plaintext body
  html: "<b>Hello world</b>" // html body
}

See https://github.com/andris9/Nodemailer for other supported options.

Arguments
Name Type Description
options Object

See below

callback Function

Called after the e-mail is sent or the sending failed

options
Name Type Description
from String

Senders's email address

to String

List of one or more recipient email addresses (comma-delimited)

subject String

Subject line

text String

Body text

html String

Body HTML (optional)

email.send()

A shortcut for Email.send(this).