Skip to content

Commit ac8471e

Browse files
committed
Moving Subject and Body inside data attribute
1 parent bccba30 commit ac8471e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/services/TeamService.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -321,15 +321,17 @@ async function sendEmail (currentUser, data) {
321321
const templateCC = template.cc || []
322322
const dataRecipients = data.recipients || []
323323
const templateRecipients = template.recipients || []
324-
const emailData = {
324+
const subjectBody = {
325325
subject: data.subject || template.subject,
326-
body: data.body || template.body,
326+
body: data.body || template.body
327+
}
328+
const emailData = {
327329
// override template if coming data already have the 'from' address
328330
from: data.from || template.from,
329331
// create a set of uniq. recipients & CCs, from both coming data & template
330332
recipients: _.uniq([...dataRecipients, ...templateRecipients]),
331333
cc: _.uniq([...dataCC, ...templateCC]),
332-
data: data.data,
334+
data: { ...data.data, ...subjectBody },
333335
sendgrid_template_id: template.sendgridTemplateId,
334336
version: 'v3'
335337
}

0 commit comments

Comments
 (0)