Skip to content

Commit 5b3c46c

Browse files
committed
fix: prevent emails with empty bodies
1 parent f1bfe87 commit 5b3c46c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/src/notifications/service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ export const sendNotification = async (notification: Notification, skipInsert =
6363
if (notification.outputs && notification.outputs.includes('email')) {
6464
// global.events.emit('sentNotification', { output: 'email', notification })
6565
debug('Send notif to email address')
66-
let text = notification.body || ''
67-
let simpleHtml = `<p>${notification.body || ''}</p>`
66+
let text = notification.body || notification.title || ''
67+
let simpleHtml = `<p>${notification.body || notification.title || ''}</p>`
6868
if (notification.url) {
6969
text += '\n\n' + notification.url
7070
simpleHtml += `<p>${i18n.__({ phrase: 'seeAt', locale: notification.locale })} <a href="${notification.url}">${new URL(notification.url).host}</a></p>`

0 commit comments

Comments
 (0)