Sendmail

Sendmail

new Sendmail(configopt)

Source:

构造器

config.nodemailer:从外部指定nodemailer,若未指定则使用内置nodemailer

Parameters:
Name Type Attributes Default Description
config Object <optional>
{}

插件配置

Methods

send(mail, templateopt, dataopt) → {Promise}

Source:
See:

发送邮件

Parameters:
Name Type Attributes Default Description
mail Object

参数,nodemailermessage,支持其所有参数。 但不会被编译和转换,一般用于设置接收人。

template Object <optional>
{}

模板

data Any <optional>

数据

Returns:

结果

Type
Promise

template(message, data) → {Object}

Source:
See:

处理模板

Parameters:
Name Type Description
message Object

消息,nodemailermessage,支持其所有参数。

其中:

  • subject:支持Handlebars模板引擎,数据来源于data
  • html:支持Handlerbars模板引擎,数据来源于data,支持Markdown格式编码
data Any

数据

Returns:

内容

Type
Object