Skip to content

Commit

Permalink
Merge pull request #7999 from pkgodara/email_sender_name
Browse files Browse the repository at this point in the history
[NEW] Sender's name in email notifications.
  • Loading branch information
rodrigok authored Dec 8, 2017
2 parents 3637627 + 3d78af4 commit 88177c5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/rocketchat-lib/server/lib/sendEmailOnMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,10 +170,15 @@ RocketChat.callbacks.add('afterSaveMessage', function(message, room) {
if (email.verified) {
email = {
to: email.address,
from: RocketChat.settings.get('From_Email'),
subject: emailSubject,
html: header + messageHTML + divisorMessage + (linkByUser[user._id] || defaultLink) + footer
};
// using user full-name/channel name in from address
if (room.t === 'd') {
email.from = `${ message.u.name } <${ RocketChat.settings.get('From_Email') }>`;
} else {
email.from = `${ room.name } <${ RocketChat.settings.get('From_Email') }>`;
}
// If direct reply enabled, email content with headers
if (RocketChat.settings.get('Direct_Reply_Enable')) {
email.headers = {
Expand Down

0 comments on commit 88177c5

Please sign in to comment.