aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/message_delivery.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-3/+3
|
* applies new string literal convention in actionmailer/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Action Mailer: Declarative exception handling with `rescue_from`.Jeremy Daer2016-05-151-22/+37
| | | | | | | | | | | | | | | | | | | | | | | Follows the same pattern as controllers and jobs. Exceptions raised in delivery jobs (enqueued by `#deliver_later`) are also delegated to the mailer's rescue_from handlers, so you can handle the DeserializationError raised by delivery jobs: ```ruby class MyMailer < ApplicationMailer rescue_from ActiveJob::DeserializationError do … end ``` ActiveSupport::Rescuable polish: * Add the `rescue_with_handler` class method so exceptions may be handled at the class level without requiring an instance. * Rationalize `exception.cause` handling. If no handler matches the exception, fall back to the handler that matches its cause. * Handle exceptions raised elsewhere. Pass `object: …` to execute the `rescue_from` handler (e.g. a method call or a block to instance_exec) against a different object. Defaults to `self`.
* Disallow calling `#deliver_later` after local message modifications.Jeremy Daer2016-04-071-2/+14
| | | | | | | | | | | | | | | | | | | 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.
* split `process` from mailer instantiationAaron Patterson2015-10-301-1/+5
| | | | | this allows us to construct mailer objects without possibly disastrous side-effects.
* Add missing punctuation mark to all ActionMailer docs [ci skip]amitkumarsuroliya2015-09-281-3/+3
|
* Revert "Merge pull request #20758 from ↵Kasper Timm Hansen2015-07-071-1/+1
| | | | | | | xijo/action_mailer_message_delivery_respects_i18n_locale" This reverts commit f2a8c23654d69dd8f294971487b5abf0e5d891c3, reversing changes made to 3046c9bbe154aa717a5147091be8b495ed8969c4.
* ActionMailer::MessageDelivery respects current I18n.localeJohannes Opper2015-07-051-1/+1
| | | | | | | | | | | | | | | | | | When #deliver_now is called all translations within the generated email will be looked up for the current I18n locale. I18n.locale = ‘de’ mail.deliver_now # Generates german email, correct In #enqueue_delivery the locale was not considered and the resulting job uses the default locale. I18n.locale = ‘de’ mail.deliver_later # Generate english email, incorrect In order to achieve a consistent behaviour the current locale is now always passed to `ActionMailer::DeliveryJob`.
* Remove unneeded requiresRafael Mendonça França2015-01-041-1/+0
| | | | These requires were added only to change deprecation message
* Remove deprecated ActionMailer deliver & deliver!claudiob2015-01-041-20/+0
| | | | | These methods were deprecated in Rails 4.2 (see f4ee1147) so they can be safely removed in Rails 5.0.
* edit pass over all warningsXavier Noria2014-10-281-4/+4
| | | | | | | | | | | | | | | This patch uniformizes warning messages. I used the most common style already present in the code base: * Capitalize the first word. * End the message with a full stop. * "Rails 5" instead of "Rails 5.0". * Backticks for method names and inline code. Also, converted a few long strings into the new heredoc convention.
* let's warn with heredocsXavier Noria2014-10-281-4/+13
| | | | | | | | | | | | The current style for warning messages without newlines uses concatenation of string literals with manual trailing spaces where needed. Heredocs have better readability, and with `squish` we can still produce a single line. This is a similar use case to the one that motivated defining `strip_heredoc`, heredocs are super clean.
* [ci skip] add :queue option to deliver_later and deliver_later! documentationyuuji.yaginuma2014-10-191-0/+2
|
* Rename remaining :in / :at to :wait / :wait_untilCristian Bica2014-09-041-12/+9
|
* Active Job refactoringCristian Bica2014-09-031-9/+4
|
* [ci skip] Fix a typo in the doc of MessageDeliveryyuuji.yaginuma2014-09-021-3/+3
|
* applies API guidelines to new AM docsXavier Noria2014-08-211-27/+27
|
* [Rdoc] Make clear that we are sending an AR object [ci skip]Abdelkader Boudih2014-08-201-12/+12
|
* Fix typo in rdoc [ci skip]Abdelkader Boudih2014-08-201-12/+12
|
* Updated rdoc / guides / release notes related to ActiveJob / ActionMailerCristian Bica2014-08-201-21/+68
|
* Deprecated .deliver / .deliver! to .deliver_now / .deliver_now!Cristian Bica2014-08-201-2/+22
|
* [ActionMailer] Rename ActionMailer::DelayedDeliveryJob to ↵Abdelkader Boudih2014-08-171-1/+3
| | | | ActionMailer::DeliveryJob
* Removed method missing from ActionMailer::MessageDeliveryCristian Bica2014-08-151-4/+0
|
* Refactor DeliverLater into MessageDeliveryAbdelkader Boudih2014-08-141-0/+47