| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
- And move the Active Job related section down. Otherwise it was
appearing as if the options are available for the `delivery_job`
setting.
|
| |
|
| |
|
|
|
|
|
| |
This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing
changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
Setting delivery_job on a mailer class will cause MessageDelivery to use
the specified job instead of ActionMailer::DeliveryJob:
class MyMailer < ApplicationMailer
self.delivery_job = MyCustomDeliveryJob
...
end
|
| |
|
|
|
|
|
| |
The current code base is not uniform. After some discussion,
we have chosen to go with double quotes by default.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
| |
this allows us to construct mailer objects without possibly disastrous
side-effects.
|
| |
|
|
|
|
|
|
|
| |
xijo/action_mailer_message_delivery_respects_i18n_locale"
This reverts commit f2a8c23654d69dd8f294971487b5abf0e5d891c3, reversing
changes made to 3046c9bbe154aa717a5147091be8b495ed8969c4.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
|
|
|
| |
These requires were added only to change deprecation message
|
|
|
|
|
| |
These methods were deprecated in Rails 4.2 (see f4ee1147) so they can
be safely removed in Rails 5.0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
ActionMailer::DeliveryJob
|
| |
|
|
|