Hello airbnb

This commit is contained in:
masnn committed 2020-04-15 15:08:05 +08:00
1 parent f9468536de
commit 8c195661d7
78 files changed
+2032 -1471

No files matched your search

+13 -11
View File
@@ -1,7 +1,6 @@
const
nodemailer = require('nodemailer'),
options = require('../options'),
{ SendMailError } = require('../error');
const nodemailer = require('nodemailer');
const options = require('../options');
const { SendMailError } = require('../error');
let transporter = null;
try {
@@ -11,8 +10,8 @@ try {
secure: options.VJ_SMTP_SECURE,
auth: {
user: options.VJ_SMTP_USER,
pass: options.VJ_SMTP_PASSWORD
}
pass: options.VJ_SMTP_PASSWORD,
},
});
} catch (e) {
console.error(e);
@@ -20,8 +19,8 @@ try {
module.exports = {
/**
* @param {string} to
* @param {string} subject
* @param {string} to
* @param {string} subject
* @param {string} text
* @param {string} html
*/
@@ -31,7 +30,10 @@ module.exports = {
t = await new Promise((resolve, reject) => {
transporter.sendMail({
from: options.VJ_SMTP_FROM,
to, subject, text, html
to,
subject,
text,
html,
}, (err, info) => {
if (err) reject(err);
else resolve(info);
@@ -41,5 +43,5 @@ module.exports = {
throw new SendMailError(to);
}
return t;
}
};
},
};