From 61d0a63bf7042c2febb43a1f9febcee58f77ee6a Mon Sep 17 00:00:00 2001 From: Tejaswini Chile Date: Thu, 2 Mar 2023 10:57:14 +0530 Subject: [PATCH] Fix: product#804: email sender improvement (#6579) --- app/mailers/conversation_reply_mailer.rb | 2 +- config/locales/en.yml | 2 +- spec/mailers/conversation_reply_mailer_spec.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/mailers/conversation_reply_mailer.rb b/app/mailers/conversation_reply_mailer.rb index 5c44d622f..c010fce6d 100644 --- a/app/mailers/conversation_reply_mailer.rb +++ b/app/mailers/conversation_reply_mailer.rb @@ -116,7 +116,7 @@ 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, from_email: @channel.email) + I18n.t('conversations.reply.channel_email.header.reply_with_name', assignee_name: assignee_name, inbox_name: @inbox.name) 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 2b2b9ac15..ad1fbc6cf 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -149,7 +149,7 @@ en: reply_with_name: '%{assignee_name} from %{inbox_name} ' channel_email: header: - reply_with_name: '%{assignee_name} from <%{from_email}>' + reply_with_name: '%{assignee_name} from %{inbox_name}' 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 df0e34fd4..a5eb5a6b7 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.email}>" + expect(mail['from'].value).to eq "#{conversation.assignee.available_name} from #{smtp_email_channel.inbox.name}" end it 'renders inbox name in the from address' do