feat: Enable template variables in channel greeting messages (#6971)

This commit is contained in:
Tejaswini Chile
2023-04-26 20:23:46 +05:30
committed by GitHub
parent 3fa654f5c6
commit 99dfe1d5af
9 changed files with 112 additions and 4 deletions

View File

@@ -91,6 +91,7 @@ RSpec.describe AutomationRules::ActionService do
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'] }
rule.save
end
it 'will send email to transcript to action params emails' do
@@ -102,6 +103,17 @@ RSpec.describe AutomationRules::ActionService do
described_class.new(rule, account, conversation).perform
end
it 'will send email to transcript to contacts' do
rule.actions = [{ action_name: 'send_email_transcript', action_params: ['{{contact.email}}'] }]
rule.save
mailer = double
allow(ConversationReplyMailer).to receive(:with).and_return(mailer)
allow(mailer).to receive(:conversation_transcript).with(conversation, conversation.contact.email)
described_class.new(rule.reload, account, conversation).perform
end
end
end
end