Disallow calling #deliver_later
in the wake of making neighborhood adjustments to the message which would be lost when the conveyance 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 exemption now. Make alterations to the message inside the mailer method rather, or utilize a custom Active Job to manage delivery instead of utilizing
#deliver_later.
Jeremy Daer
No comments:
Post a Comment