Highoutput Email Service Client
Class:Client
Constructor:new Client(host, secret)
Creates an email service client for the specific host and it's secret.
<Promise>
sendEmail(param) - param
<Object>
- from
<String>
required Email of the sender - to
<String>|<Array<String>>
required Email(s) of the recipient(s) - text
<String>
Text content - html
<String>
Html content - bcc
<String>|<Array<String>>
- cc
<String>|<Array<String>>
- template
<String>
Name of the template - templateData
<Object>
Object data to be bound to the template - checkValidity
<Boolean>
Determine whether to check first all the email if those email(s) exists of the domain SMTP server
- from
Though text
, html
, or template
property is not required, but one of them must be present.
;
<Promise>
sendEmailVerification(param, secret) Acts same like a send email but also includes a key
data that is being included in templateData
.
It also adds a new optional property which is a payloadData
other information you wanted to include upon verifying.
client;
verify(param, secret)
Verifies the parameter it can be a string
of the plain link or koa ctx
.
client; // Outputs: // { email: 'djansyledjans@gmail.com', id: 'f64f2940-fae4-11e7-8c5f-ef356f279131' iat: 1524793969 }