feat: Add message content to mention email template (#2838)

This commit is contained in:
Tejaswini Chile
2021-08-18 15:28:45 +05:30
committed by GitHub
parent 20b96c7c60
commit eb80324eaa
5 changed files with 37 additions and 8 deletions

View File

@@ -39,7 +39,8 @@ RSpec.describe AgentNotifications::ConversationNotificationsMailer, type: :maile
end
describe 'conversation_mention' do
let(:message) { create(:message, conversation: conversation, account: account) }
let(:another_agent) { create(:user, email: 'agent2@example.com', account: account) }
let(:message) { create(:message, conversation: conversation, account: account, sender: another_agent) }
let(:mail) { described_class.with(account: account).conversation_mention(message, agent).deliver_now }
it 'renders the subject' do
@@ -49,6 +50,10 @@ RSpec.describe AgentNotifications::ConversationNotificationsMailer, type: :maile
it 'renders the receiver email' do
expect(mail.to).to eq([agent.email])
end
it 'renders the senders name' do
expect(mail.body.encoded).to match("You've been mentioned in a conversation. <b>#{another_agent.display_name}</b> wrote:")
end
end
describe 'assigned_conversation_new_message' do