Skip to content

Commit

Permalink
Ticket CV2-3904: Graceful error when cannot send custom message to ti…
Browse files Browse the repository at this point in the history
…pline user
  • Loading branch information
caiosba committed Nov 18, 2023
1 parent d0eff3a commit 462fe74
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/concerns/smooch_messages.rb
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ def send_custom_message_to_user(team, uid, timestamp, message, language)
date = I18n.l(Time.at(timestamp), locale: language, format: :short)
message = self.format_template_message('custom_message', [date, message.to_s.gsub(/\s+/, ' ')], nil, message, language, nil, true) if platform == 'WhatsApp'
response = self.send_message_to_user(uid, message, {}, false, true, 'custom_message')
success = (response.code.to_i < 400)
success = (response && response.code.to_i < 400)
success
end
end
Expand Down

0 comments on commit 462fe74

Please sign in to comment.