File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -321,15 +321,17 @@ async function sendEmail (currentUser, data) {
321
321
const templateCC = template . cc || [ ]
322
322
const dataRecipients = data . recipients || [ ]
323
323
const templateRecipients = template . recipients || [ ]
324
- const emailData = {
324
+ const subjectBody = {
325
325
subject : data . subject || template . subject ,
326
- body : data . body || template . body ,
326
+ body : data . body || template . body
327
+ }
328
+ const emailData = {
327
329
// override template if coming data already have the 'from' address
328
330
from : data . from || template . from ,
329
331
// create a set of uniq. recipients & CCs, from both coming data & template
330
332
recipients : _ . uniq ( [ ...dataRecipients , ...templateRecipients ] ) ,
331
333
cc : _ . uniq ( [ ...dataCC , ...templateCC ] ) ,
332
- data : data . data ,
334
+ data : { ... data . data , ... subjectBody } ,
333
335
sendgrid_template_id : template . sendgridTemplateId ,
334
336
version : 'v3'
335
337
}
You can’t perform that action at this time.
0 commit comments