aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/CHANGELOG.md
diff options
context:
space:
mode:
authorJeremy Daer <jeremydaer@gmail.com>2016-04-07 13:16:54 -0700
committerJeremy Daer <jeremydaer@gmail.com>2016-04-07 13:36:50 -0700
commit95e06e6682b3bc7f813336142213697eac36e401 (patch)
treee7e058cae32134a316ef9c6b4c8344c95067b5ef /actionmailer/CHANGELOG.md
parent9c2945f4cc1017fc9424f2e425e4820da1ef33b0 (diff)
downloadrails-95e06e6682b3bc7f813336142213697eac36e401.tar.gz
rails-95e06e6682b3bc7f813336142213697eac36e401.tar.bz2
rails-95e06e6682b3bc7f813336142213697eac36e401.zip
Disallow calling `#deliver_later` after local message modifications.
They would be lost when the delivery job is enqueued, otherwise. Prevents a common, hard-to-find bug like: ```ruby message = Notifier.welcome(user, foo) message.message_id = my_generated_message_id message.deliver_later ``` The message_id is silently lost here! *Only the mailer arguments are passed to the delivery job.* This raises an exception now. Make modifications to the message within the mailer method or use a custom Active Job to manage delivery instead of using #deliver_later.
Diffstat (limited to 'actionmailer/CHANGELOG.md')
-rw-r--r--actionmailer/CHANGELOG.md18
1 files changed, 18 insertions, 0 deletions
diff --git a/actionmailer/CHANGELOG.md b/actionmailer/CHANGELOG.md
index 1109912b04..1fef9eae29 100644
--- a/actionmailer/CHANGELOG.md
+++ b/actionmailer/CHANGELOG.md
@@ -1,3 +1,21 @@
+* Disallow calling `#deliver_later` after making local modifications to
+ the message which would be lost when the delivery job is enqueued.
+
+ Prevents a common, hard-to-find bug like
+
+ message = Notifier.welcome(user, foo)
+ message.message_id = my_generated_message_id
+ message.deliver_later
+
+ The message_id is silently lost! *Only the mailer arguments are passed
+ to the delivery job.*
+
+ This raises an exception now. Make modifications to the message within
+ the mailer method instead, or use a custom Active Job to manage delivery
+ instead of using #deliver_later.
+
+ *Jeremy Daer*
+
* Removes `-t` from default Sendmail arguments to match the underlying
`Mail::Sendmail` setting.