feat: Support multiple emails in email transcript automation (#6924)

This commit is contained in:
Tejaswini Chile
2023-04-19 16:55:25 +05:30
committed by GitHub
parent 821d49943a
commit 5cdc7d654a
3 changed files with 18 additions and 71 deletions

View File

@@ -87,5 +87,21 @@ RSpec.describe AutomationRules::ActionService do
described_class.new(rule, account, conversation).perform
end
end
describe '#perform with send_email_transcript action' do
before do
rule.actions << { action_name: 'send_email_transcript', action_params: ['contact@example.com, agent@example.com,agent1@example.com'] }
end
it 'will send email to transcript to action params emails' do
mailer = double
allow(ConversationReplyMailer).to receive(:with).and_return(mailer)
allow(mailer).to receive(:conversation_transcript).with(conversation, 'contact@example.com')
allow(mailer).to receive(:conversation_transcript).with(conversation, 'agent@example.com')
allow(mailer).to receive(:conversation_transcript).with(conversation, 'agent1@example.com')
described_class.new(rule, account, conversation).perform
end
end
end
end