aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix legacy fallback for parameterized mailersGannon McGibbon2019-01-071-1/+9
|
* Move MailDeliveryJob default to 6.0 defaultsGannon McGibbon2019-01-072-1/+5
|
* Bump license years for 2019Arun Agrawal2018-12-311-1/+1
|
* Deprecate ActionMailer::Base.receive in favor of Action MailboxGeorge Claghorn2018-12-271-0/+5
|
* Add MailDeliveryJob for unified mail deliveryGannon McGibbon2018-12-047-9/+77
| | | | | Add `MailDeliveryJob` for delivering both regular and parameterized mail. Deprecate using `DeliveryJob` and `Parameterized::DeliveryJob`.
* Deliver parameterized mail with DeliveryJobGannon McGibbon2018-11-225-20/+10
| | | | | Deliver parameterized mail with `ActionMailer::DeliveryJob` and remove `ActionMailer::Parameterized::DeliveryJob`.
* Fix ActionMailer assertion not working for mail defining delivery_job:Edouard CHIN2018-11-211-5/+14
| | | | | | | | | | | | | | | | | | | - If a Mail defines a custom delivery_job, all ActionMailer assertion helper (assert_emails, assert_enqueued_emails ...) wouldn't work. ```ruby MyMailer < ApplicationMailer self.delivery_job = MyJob end # This assertion will fail assert_emails(1) do MyMailer.my_mail.deliver_later end This PR leverage the new ActiveJob feature that accepts Procs for the `only` keyword and check if the delivery job is one of ActionMailer registered ones.
* Merge pull request #22534 from evopark/masterRafael Mendonça França2018-11-191-3/+8
|\ | | | | | | ActionMailer: support overriding template name in multipart
| * ActionMailer: support overriding template name in multipartMarcus Ilgner2015-12-081-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | Implicit rendering in multipart blocks now also uses the template name from the options hash instead of always using the action name. So you can now write mail(template_name: template_name) do |format| format.text format.html end
* | Parameterized mailers can configure delivery jobLuke Pearce2018-10-052-1/+3
| | | | | | | | | | | | | | | | | | | | Setting parameterized_delivery_job on a mailer class will cause Parameterized::MessageDelivery to use the specified job instead of ActionMailer::Parameterized::DeliveryJob: class MyMailer < ApplicationMailer self.parameterized_delivery_job = MyCustomDeliveryJob ... end
* | Fix spellings for 'unmarshall(ing/ed)' & 'marshall(ing/ed)'Sharang Dashputre2018-10-021-1/+1
| |
* | Add `Style/RedundantFreeze` to remove redudant `.freeze`Yasuo Honda2018-09-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Rails 6.0 will support Ruby 2.4.1 or higher `# frozen_string_literal: true` magic comment is enough to make string object frozen. This magic comment is enabled by `Style/FrozenStringLiteralComment` cop. * Exclude these files not to auto correct false positive `Regexp#freeze` - 'actionpack/lib/action_dispatch/journey/router/utils.rb' - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333 Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed. * Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required - 'actionpack/test/controller/test_case_test.rb' - 'activemodel/test/cases/type/string_test.rb' - 'activesupport/lib/active_support/core_ext/string/strip.rb' - 'activesupport/test/core_ext/string_ext_test.rb' - 'railties/test/generators/actions_test.rb'
* | Include test helpers when ActionDispatch::IntegrationTest is loadedRicardo Díaz2018-09-121-1/+4
| | | | | | | | | | | | | | | | | | | | | | As @dhh brings up, the point of `ActionDispatch::IntegrationTest` is to allow users to test the integration of all the pieces called by a controller. Asserting about the emails and jobs queued is part of that task. This commit includes the `ActionMailer::TestHelper` and `ActiveJob::TestHelper` modules when the ActionMailer and ActiveJob railties are initialized respectively.
* | Add `perform_deliveries` to a payload of `deliver.action_mailer` notification.Yoshiyuki Kinjo2018-09-092-11/+16
| |
* | Skip delivery notification when perform_deliveries is false.Yoshiyuki Kinjo2018-09-081-0/+1
| |
* | Turn on performance based copsDillon Welch2018-07-231-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use attr_reader/attr_writer instead of methods method is 12% slower Use flat_map over map.flatten(1) flatten is 66% slower Use hash[]= instead of hash.merge! with single arguments merge! is 166% slower See https://github.com/rails/rails/pull/32337 for more conversation
* | Fix docs of `assert_no_emails` [ci skip]bogdanvlviv2018-06-291-1/+1
| | | | | | | | `assert_no_emails` is shortcut for `assert_emails 0, &block`.
* | ActionMailer::Base can unregister observer(s) and interceptor(s). (#32207)Kota Miyake2018-05-302-5/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * ActionMailer::Base can unregister observer(s) and interceptor(s). One or multiple mail observers can be unregistered using `ActionMailer::Base.unregister_observers` or `ActionMailer::Base.unregister_observer`. One or multiple mail interceptors can be unregistered using `ActionMailer::Base.unregister_interceptors` or `ActionMailer::Base.unregister_interceptor`. For preview interceptors, it's possible to use `ActionMailer::Base.unregister_preview_interceptors` or `ActionMailer::Base.unregister_preview_interceptor`. * Ensure to be reset registered observer(s) and interceptor(s) * Add explanation to CHANGELOG * Add original author's name [Kota Miyake + Rafael Mendonça França + Claudio Ortolina]
* | Eager autoload mail gem when eager load is true (#32808)Samuel Cochran2018-05-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Eager autoload mail gem when eager load is true We had a production issue where our Sidekiq worker threads all became deadlocked while autoloading a file within the mail gem, required via ActionMailer, despite setting our Rails applicaiton to eager load. `Mail.eager_autoload!` exists and works great, ActionMailer just doesn't call it during eager loading. Adding it to the ActionMailer Railtie's eager_load_namespaces takes care of calling `Mail.eager_autoload!` during the `eager_load!` initializer. * 'Mail' isn't defined yet, use before_eager_load instead * Make sure mail is loaded * Move eager load of Mail into ActionMailer.eager_load! [Samuel Cochran + Rafael Mendonça França]
* | Strip duplicated suffixes more strictlyRyuta Kamizono2018-04-221-1/+1
| | | | | | | | In the previous code incorrectly removes intermediate words.
* | Merge pull request #32427 from tjschuck/small_doc_fixesRyuta Kamizono2018-04-031-1/+1
|\ \ | | | | | | | | | | | | Small doc fixes [ci skip]
| * | Small doc fixesT.J. Schuck2018-04-021-1/+1
| | | | | | | | | | | | [ci skip]
* | | Doc fix added missing quoteMichael H2018-04-021-1/+1
|/ /
* | Partly revert #32231bogdanvlviv2018-03-141-4/+2
| | | | | | | | | | | | | | - Remove extra execution of `perform_enqueued_jobs` since it performs all enqueued jobs in the duration of the block. - Fix example of using `assert_emails` without block since we can't use enqueued jobs in this case.
* | Perform email jobs in #assert_emailsGannon McGibbon2018-03-121-5/+7
| | | | | | | | Perform enqueued delivery jobs in #assert_emails and #assert_no_emails.
* | Start Rails 6.0 development!!!Rafael Mendonça França2018-01-301-3/+3
| | | | | | | | :tada::tada::tada:
* | Merge pull request #30391 from jbourassa/fix-actionmailer-lambda-defaultRyuta Kamizono2018-01-241-1/+11
|\ \ | | | | | | | | | Fix actionmailer lambda default
| * | Fix AM::Base.default proc arity breaking changeJimmy Bourassa2017-08-291-1/+11
| | | | | | | | | | | | | | | | | | | | | PR #29270 changed the number of arguments that gets passed to Procs defined in ActionMail::Base.default. With this changeset, Procs can now have 1 or 0 arguments Also adds test coverage for AM::Base.default Proc arity.
* | | Fix typos, update documentationJames Lovejoy2018-01-111-1/+1
| | | | | | | | | | | | [ci skip]
* | | Move the options for deliver_later up near to the example [ci skip]Prathamesh Sonpatki2018-01-041-12/+12
| | | | | | | | | | | | | | | | | | - And move the Active Job related section down. Otherwise it was appearing as if the options are available for the `delivery_job` setting.
* | | Bump license years for 2018Yoshiyuki Hirano2017-12-311-1/+1
| | |
* | | Preparing for 5.2.0.beta2 releaseRafael Mendonça França2017-11-281-1/+1
| | |
* | | Preparing for 5.2.0.beta1 releaseRafael Mendonça França2017-11-271-1/+1
| | |
* | | Sort mailer previewsDwight Watson2017-11-141-1/+1
| | |
* | | Use .tt extension to all the template filesRafael Mendonça França2017-11-132-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | Make clear that the files are not to be run for interpreters. Fixes #23847. Fixes #30690. Closes #23878.
* | | [Action Mailer] require_relative => requireAkira Matsuda2017-10-212-4/+4
| | | | | | | | | | | | This basically reverts cd9cc721ab54e2b0c7875cacf2113f03908a8bb7
* | | Add assert_enqueued_email_with to ActionMailer::TestHelperMikkel Malmberg2017-09-271-0/+42
| | |
* | | Update Action Mailer doc [ci skip]Yoshiyuki Hirano2017-08-303-8/+8
|/ /
* | Use tt in doc for action_mailer [ci skip]Yoshiyuki Hirano2017-08-261-1/+1
| |
* | Merge pull request #29559 from kirs/eager-load-controller-actionsRafael França2017-08-111-0/+6
|\ \ | | | | | | Eager load controller actions to reduce response time of the first request
| * | Eager load controller and mailer actionsKir Shatrov2017-07-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the first request, ActionController::Base#action_methods computes and memoized the list of available actions [1]. With this PR we move this expensive operation into eager load step to reduce response time of the first request served in production. This also reduces the memory footprint when running on forking server like Unicorn. [1] https://github.com/rails/rails/blob/a3813dce9a0c950a4af7909111fa730a2622b1db/actionpack/lib/abstract_controller/base.rb#L66-L77
* | | Remove outdated comment [ci skip]Youssef Boulkaid2017-08-061-4/+0
|/ / | | | | | | | | The comment was describing a previous version of the method with a different signature. This is outdated since e76c38e
* | Use frozen string literal in actionmailer/Kir Shatrov2017-07-2318-0/+36
| |
* | [Action Mailer] require => require_relativeAkira Matsuda2017-07-012-4/+4
| |
* | Fix formatting of `ActionMailer::MessageDelivery` doc [ci skip]Ryuta Kamizono2017-06-161-4/+4
| |
* | Document setting the delivery_job for ActionMailer [ci skip]Matthew Mongeau2017-06-161-0/+16
| |
* | Allow mailers to configure their delivery jobMatthew Mongeau2017-06-152-1/+3
| | | | | | | | | | | | | | | | | | | | | | 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
* | Use mattr_accessor default: option throughout the projectGenadi Samokovarov2017-06-032-10/+4
| |
* | Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-292-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
* | Define path with __dir__bogdanvlviv2017-05-231-1/+1
| | | | | | | | | | | | ".. with __dir__ we can restore order in the Universe." - by @fxn Related to 5b8738c2df003a96f0e490c43559747618d10f5f