Allow mailers to configure their delivery job #29457

Merged
merged 1 commit into from Jun 15, 2017

Conversation

Projects
None yet
4 participants
@halogenandtoast
Contributor

halogenandtoast commented Jun 15, 2017

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

Summary

In some situations, a user may want to configure the delivery job in order to have
better control over errors (For example, retrying the job when deserialization fails
due to replica databases not being up to date). This adds an option to each mailer
class that can be configured to handle such behavior.

@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Jun 15, 2017

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @pixeltrix (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @pixeltrix (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

This repository is being automatically checked for code quality issues using Code Climate. You can see results for this analysis in the PR status below. Newly introduced issues should be fixed before a Pull Request is considered ready to review.

Please see the contribution instructions for more information.

Allow mailers to configure their delivery job
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
@halogenandtoast

This comment has been minimized.

Show comment
Hide comment
@halogenandtoast

halogenandtoast Jun 15, 2017

Contributor

I believe the CI failure is unrelated to my changes.

Contributor

halogenandtoast commented Jun 15, 2017

I believe the CI failure is unrelated to my changes.

@guilleiguaran

👍

@guilleiguaran guilleiguaran merged commit 95ae033 into rails:master Jun 15, 2017

2 checks passed

codeclimate no new or fixed issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

y-yagi added a commit to y-yagi/rails that referenced this pull request Aug 18, 2017

Add an `:only` option to `assert_enqueued_emails` and `assert_no_enqu…
…eued_emails` to filter delivery job

Since #29457, delivery job can specified for each mailer.
Added the `:only` option to make helper method usable even when
deliver job is specified.

y-yagi added a commit to y-yagi/rails that referenced this pull request Aug 18, 2017

Add an `:only` option to `assert_enqueued_emails` and `assert_no_enqu…
…eued_emails` to filter delivery job

Since #29457, delivery job can specified for each mailer.
Added the `:only` option to make helper method usable even when
deliver job is specified.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment