Skip to content

Commit 979b3bc

Browse files
committed
#591: split to and reply_to emails
1 parent 0f830fe commit 979b3bc

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

lib/notifier.rb

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,16 @@ def self.send_emails(notifications)
6161
end
6262
attachments_file_name_list = attachments_file_name_list[0..-3]
6363
end
64-
64+
old_to = m[:to]
65+
m[:to] = old_to.to_s.split(",").map(&:strip).reject(&:empty?)
66+
old_reply_to = nil
67+
if m[:reply_to].is_a?(String) && !m[:reply_to].empty?
68+
old_reply_to = m[:reply_to]
69+
m[:reply_to] = old_reply_to.to_s.split(",").map(&:strip).reject(&:empty?)
70+
end
6571
actionmailer_base.mail(m).deliver!
72+
m[:to] = old_to
73+
m[:reply_to] = old_reply_to unless old_reply_to.nil?
6674

6775
NotificationLog.new(
6876
notification_id: m[:notification_id],

0 commit comments

Comments
 (0)