From 2b736f4698bf63eaa8023cd831775dd0fe60da21 Mon Sep 17 00:00:00 2001 From: Tejaswini Chile Date: Thu, 13 Apr 2023 23:12:38 +0530 Subject: [PATCH] fix: Update from_email in the name to fix the syntax error (#6900) --- app/mailers/conversation_reply_mailer.rb | 3 ++- config/locales/en.yml | 2 +- spec/mailers/conversation_reply_mailer_spec.rb | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/mailers/conversation_reply_mailer.rb b/app/mailers/conversation_reply_mailer.rb index c010fce6d..b118df107 100644 --- a/app/mailers/conversation_reply_mailer.rb +++ b/app/mailers/conversation_reply_mailer.rb @@ -116,7 +116,8 @@ class ConversationReplyMailer < ApplicationMailer def channel_email_with_name if @conversation.assignee.present? - I18n.t('conversations.reply.channel_email.header.reply_with_name', assignee_name: assignee_name, inbox_name: @inbox.name) + I18n.t('conversations.reply.channel_email.header.reply_with_name', assignee_name: assignee_name, inbox_name: @inbox.name, + from_email: @channel.email) else I18n.t('conversations.reply.channel_email.header.reply_with_inbox_name', inbox_name: @inbox.name, from_email: @channel.email) end diff --git a/config/locales/en.yml b/config/locales/en.yml index 72439195e..97aa64976 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -154,7 +154,7 @@ en: reply_with_name: "%{assignee_name} from %{inbox_name} " channel_email: header: - reply_with_name: "%{assignee_name} from %{inbox_name}" + reply_with_name: "%{assignee_name} from %{inbox_name} <%{from_email}>" reply_with_inbox_name: "%{inbox_name} <%{from_email}>" email_subject: "New messages on this conversation" transcript_subject: "Conversation Transcript" diff --git a/spec/mailers/conversation_reply_mailer_spec.rb b/spec/mailers/conversation_reply_mailer_spec.rb index a5eb5a6b7..61900fc7e 100644 --- a/spec/mailers/conversation_reply_mailer_spec.rb +++ b/spec/mailers/conversation_reply_mailer_spec.rb @@ -171,7 +171,7 @@ RSpec.describe ConversationReplyMailer, type: :mailer do it 'renders assignee name in the from address' do mail = described_class.email_reply(message) - expect(mail['from'].value).to eq "#{conversation.assignee.available_name} from #{smtp_email_channel.inbox.name}" + expect(mail['from'].value).to eq "#{conversation.assignee.available_name} from #{smtp_email_channel.inbox.name} <#{smtp_email_channel.email}>" end it 'renders inbox name in the from address' do