Skip to content

Commit ba6a8c7

Browse files
committed
fix: email event format
ref issue #144
1 parent 88cdea5 commit ba6a8c7

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

config/email_template.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ module.exports = {
1414
*/
1515
'team-issue-report': {
1616
subject: 'Issue Reported on TaaS Team {{projectName}} ({{projectId}}).',
17-
message: 'Project Name: {{projectName}}' + '\n' +
17+
body: 'Project Name: {{projectName}}' + '\n' +
1818
'Project ID: {{projectId}}' + '\n' +
1919
`Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' +
2020
'\n' +
@@ -31,7 +31,7 @@ module.exports = {
3131
*/
3232
'member-issue-report': {
3333
subject: 'Issue Reported for member {{userHandle}} on TaaS Team {{projectName}} ({{projectId}}).',
34-
message: 'User Handle: {{userHandle}}' + '\n' +
34+
body: 'User Handle: {{userHandle}}' + '\n' +
3535
'Project Name: {{projectName}}' + '\n' +
3636
'Project ID: {{projectId}}' + '\n' +
3737
`Project URL: ${config.TAAS_APP_URL}/{{projectId}}` + '\n' +

src/services/TeamService.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const ResourceBookingService = require('./ResourceBookingService')
1717
const emailTemplates = _.mapValues(emailTemplateConfig, (template) => {
1818
return {
1919
subjectTemplate: Handlebars.compile(template.subject),
20-
messageTemplate: Handlebars.compile(template.message),
20+
bodyTemplate: Handlebars.compile(template.body),
2121
recipients: template.recipients,
2222
sendgridTemplateId: template.sendgridTemplateId
2323
}
@@ -318,9 +318,8 @@ async function sendEmail (currentUser, data) {
318318
const template = emailTemplates[data.template]
319319
await helper.postEvent(config.EMAIL_TOPIC, {
320320
data: {
321-
handle: currentUser.handle,
322321
subject: template.subjectTemplate(data.data),
323-
message: template.messageTemplate(data.data)
322+
body: template.bodyTemplate(data.data)
324323
},
325324
sendgrid_template_id: template.sendgridTemplateId,
326325
version: 'v3',

0 commit comments

Comments
 (0)