Skip to content

Commit

Permalink
nodemailer upgrade - test file
Browse files Browse the repository at this point in the history
  • Loading branch information
macarthuror committed Jun 2, 2020
1 parent 7929992 commit 2488afd
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 8 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
end_of_line = lf
charset = utf-8
indent_style = space
indent_size = 2

[*.js]
end_of_line = lf
insert_final_newline = true
charset = utf-8
indent_style = space
indent_size = 2
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -311,4 +311,4 @@ var SmtpMailAdapter = mailOptions => {
});
}

module.exports = SmtpMailAdapter;
module.exports = SmtpMailAdapter;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "parse-smtp-template",
"version": "2.0.2",
"version": "2.1.0",
"description": "Parse Server Module to send emails via SMTP with a customizable template option and Multi Language",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"test": "node test.js"
},
"repository": {
"type": "git",
Expand All @@ -26,7 +26,7 @@
},
"homepage": "https://github.com/macarthuror/parse-smtp-template#readme",
"dependencies": {
"nodemailer": "4.7.0"
"nodemailer": "6.4.8"
},
"devDependencies": {}
}
22 changes: 22 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// You can test it with `https://ethereal.email/`

const port = 587
const password = '3UjDDMnF6bAd98J8sU'
const host = 'smtp.ethereal.email'
const user = '[email protected]'

const text = `Hi,\n\nYou are being asked to confirm the e-mail address ${user} with appName\n\n Click here to confirm it:\nhttp://myparseapp.com/actionTest?username=YourUsername`
const subject = 'Password subject Test for appName'

const { sendMail } = require('./index.js')({ host, port, fromAddress: user, user, password })

sendMail({ subject, text, to: user })
.then(data => {
console.log('SEND IT ---------')
})
.catch(err => {
console.error(err)
})
.finally(() => {
console.log('END --------')
})
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# yarn lockfile v1


nodemailer@4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-4.7.0.tgz#4420e06abfffd77d0618f184ea49047db84f4ad8"
integrity sha512-IludxDypFpYw4xpzKdMAozBSkzKHmNBvGanUREjJItgJ2NYcK/s8+PggVhj7c2yGFQykKsnnmv1+Aqo0ZfjHmw==
nodemailer@6.4.8:
version "6.4.8"
resolved "https://registry.yarnpkg.com/nodemailer/-/nodemailer-6.4.8.tgz#aca52886e4e56f71f6b8a65f5ca6b767ca751fc7"
integrity sha512-UbJD0+g5e2H20bWv7Rpj3B+N3TMMJ0MLoLwaGVJ0k3Vo8upq0UltwHJ5BJfrpST1vFa91JQ8cf7cICK5DSIo1Q==

0 comments on commit 2488afd

Please sign in to comment.