zet-lib 1.0.77 → 1.0.78
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/Mail.js +4 -4
- package/package.json +1 -1
package/lib/Mail.js
CHANGED
|
@@ -18,7 +18,7 @@ let mailOptions = {
|
|
|
18
18
|
html: '<p>hi text</p>',
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
MAIL.gmailTransporter = (user, pass) => {
|
|
21
|
+
MAIL.gmailTransporter = (user = '', pass = '') => {
|
|
22
22
|
return nodemailer.createTransport({
|
|
23
23
|
service: 'gmail',
|
|
24
24
|
auth: {
|
|
@@ -28,7 +28,7 @@ MAIL.gmailTransporter = (user, pass) => {
|
|
|
28
28
|
})
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
-
MAIL.send = function (options, transporter = null) {
|
|
31
|
+
MAIL.send = function (options = {}, transporter = null) {
|
|
32
32
|
let option = Object.assign(mailOptions, options)
|
|
33
33
|
// send mail with defined transport object
|
|
34
34
|
option.user = option.user || 'aptiwise@gmail.com'
|
|
@@ -42,7 +42,7 @@ MAIL.send = function (options, transporter = null) {
|
|
|
42
42
|
})
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
MAIL.forgotPassword = (datas, options) => {
|
|
45
|
+
MAIL.forgotPassword = (datas = {}, options = {}) => {
|
|
46
46
|
ejs.renderFile(`${dirRoot}/views/layouts/email/forgot_password.ejs`, { data: datas, Util: Util }, function (err, data) {
|
|
47
47
|
let option = Object.assign(mailOptions, options)
|
|
48
48
|
option.html = data
|
|
@@ -54,7 +54,7 @@ MAIL.forgotPassword = (datas, options) => {
|
|
|
54
54
|
})
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
MAIL.register = (datas, options) => {
|
|
57
|
+
MAIL.register = (datas = {}, options = {}) => {
|
|
58
58
|
ejs.renderFile(`${dirRoot}/views/layouts/email/register.ejs`, { data: datas, Util: Util }, function (err, data) {
|
|
59
59
|
let option = Object.assign(mailOptions, options)
|
|
60
60
|
option.html = data
|