fix: Add email rate limiting to automation rule actions (#13474)
This commit is contained in:
@@ -78,8 +78,11 @@ class ActionService
|
||||
emails = emails[0].gsub(/\s+/, '').split(',')
|
||||
|
||||
emails.each do |email|
|
||||
break unless @account.within_email_rate_limit?
|
||||
|
||||
email = parse_email_variables(@conversation, email)
|
||||
ConversationReplyMailer.with(account: @conversation.account).conversation_transcript(@conversation, email)&.deliver_later
|
||||
@account.increment_email_sent_count
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -58,7 +58,10 @@ class AutomationRules::ActionService < ActionService
|
||||
teams = Team.where(id: params[0][:team_ids])
|
||||
|
||||
teams.each do |team|
|
||||
break unless @account.within_email_rate_limit?
|
||||
|
||||
TeamNotifications::AutomationNotificationMailer.conversation_creation(@conversation, team, params[0][:message])&.deliver_now
|
||||
@account.increment_email_sent_count
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user