Skip to content

Commit

Permalink
Merge 32f3d3d into f6c014b
Browse files Browse the repository at this point in the history
  • Loading branch information
lependu committed Jul 12, 2019
2 parents f6c014b + 32f3d3d commit 12c3cab
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
6 changes: 3 additions & 3 deletions example.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const build = (options) => {
},
handler: (req, reply, next) => {
req.log.info('sendmail route')
let { nodemailer } = fastify
let recipient = req.params.email
const { nodemailer } = fastify
const recipient = req.params.email

nodemailer.sendMail({
from: 'sender@example.com',
Expand All @@ -39,7 +39,7 @@ const build = (options) => {
}, (err, info) => {
if (err) next(err)

let { messageId, envelope: { to } } = info
const { messageId, envelope: { to } } = info
reply.send({
messageId,
recipient: to
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"devDependencies": {
"fastify": "^1.13.3",
"standard": "^12.0.1",
"standard": "^13.0.1",
"tap": "^12.7.0"
},
"dependencies": {
Expand Down
10 changes: 5 additions & 5 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ test('nodemailer#sendMail', t => {
})
.ready(err => {
t.error(err)
let { nodemailer } = fastify
const { nodemailer } = fastify
nodemailer.sendMail({
from: 'sender@example.com',
to: 'recipient@example.com',
Expand All @@ -70,12 +70,12 @@ test('customTransport', t => {
const fastify = Fastify()
t.tearDown(fastify.close.bind(fastify))

let transport = {
const transport = {
name: 'minimal',
version: '0.1.0',
send: (mail, callback) => {
let envelope = mail.message.getEnvelope()
let messageId = mail.message.messageId()
const envelope = mail.message.getEnvelope()
const messageId = mail.message.messageId()
callback(null, {
envelope,
messageId
Expand All @@ -87,7 +87,7 @@ test('customTransport', t => {
.register(nodemailer, transport)
.ready(err => {
t.error(err)
let { nodemailer } = fastify
const { nodemailer } = fastify
nodemailer.sendMail({
from: 'sender@example.com',
to: 'recipient@example.com',
Expand Down

0 comments on commit 12c3cab

Please sign in to comment.