Skip to content

Commit

Permalink
fix: tests
Browse files Browse the repository at this point in the history
  • Loading branch information
meghein committed Jan 23, 2024
1 parent 0125e2d commit 33a412f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ const fastifyMail = async (fastify, opts) => {
// It will either render the templates or use the data in the message object as is
createMessage: async function (message, templatePath, context) {
const formattedMessage = {
from: message.from,
to: message.to,
subject: message.subject,
replyTo: message.replyTo,
cc: message.cc,
bcc: message.bcc,
from: message.from,
subject: message.subject,
replyTo: message.replyTo,
html: message.html,
text: message.text
text: message.text,
attachments: message.attachments
}

if (templatePath) {
Expand Down
8 changes: 4 additions & 4 deletions index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ const testHtml =

const testMessage = {
to: '[email protected]',
from: '[email protected]',
cc: '[email protected]',
bcc: '[email protected]',
replyTo: 'reply@ignoreme.com',
from: 'from@ignoreme.com',
subject: 'This is a plain text subject',
replyTo: '[email protected]',
html: testHtml,
text: 'This is a plain text email message.',
attachments: [
Expand All @@ -46,11 +46,11 @@ const testMessage = {

const responseWhenTemplatesPresent = {
to: '[email protected]',
from: '[email protected]',
cc: '[email protected]',
bcc: '[email protected]',
replyTo: 'reply@ignoreme.com',
from: 'from@ignoreme.com',
subject: 'This is a plain text subject',
replyTo: '[email protected]',
html: testHtml,
text: 'This is a test text message to Test Name',
attachments: [
Expand Down

0 comments on commit 33a412f

Please sign in to comment.