Skip to content

Commit

Permalink
Regression: Only add reply-to if sender has emails (#17998)
Browse files Browse the repository at this point in the history
  • Loading branch information
sampaiodiego authored Jun 22, 2020
1 parent c9333af commit ca4dfa6
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions app/lib/server/functions/notifications/email.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ export function getEmailData({
? receiver.name || receiver.username
: receiver.username;

const [senderEmail] = sender.emails;
const email = {
from: generateNameEmail(username, settings.get('From_Email')),
to: generateNameEmail(receiverName, emailAddress),
Expand All @@ -157,11 +156,13 @@ export function getEmailData({
data: {
room_path,
},
headers: {
'Reply-To': generateNameEmail(username, senderEmail.address),
},
};

if (sender.emails?.length > 0) {
const [senderEmail] = sender.emails;
email.headers['Reply-To'] = generateNameEmail(username, senderEmail.address);
}

// If direct reply enabled, email content with headers
if (settings.get('Direct_Reply_Enable')) {
const replyto = settings.get('Direct_Reply_ReplyTo') || settings.get('Direct_Reply_Username');
Expand Down

0 comments on commit ca4dfa6

Please sign in to comment.