Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression: Only add reply-to if sender has emails #17998

Merged
merged 1 commit into from
Jun 22, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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