aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Removed method missing from ActionMailer::MessageDeliveryCristian Bica2014-08-152-4/+4
| | |
| * | Refactor DeliverLater into MessageDeliveryAbdelkader Boudih2014-08-149-83/+73
| | |
| * | Make ActionMailer::Previews methods class methods.Abdelkader Boudih2014-08-142-0/+8
| | |
| * | Merge branch 'master' into activejobCristian Bica2014-08-131-1/+3
| |\ \
| | * | use :test delivery method for `base_test.rb`Yves Senn2014-08-132-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solves errors like: ``` BaseTest#test_you_can_register_multiple_observers_to_the_mail_object_that_both_get_informed_on_email_delivery: Errno::ECONNREFUSED: Connection refused - connect(2) for "localhost" port 25 /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `initialize' /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `open' /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:541:in `tcp_socket' /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:551:in `block in do_start' /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:91:in `block in timeout' /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `call' /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/timeout.rb:101:in `timeout' /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:550:in `do_start' /Users/senny/.rbenv/versions/2.1.2/lib/ruby/2.1.0/net/smtp.rb:520:in `start' /Users/senny/Projects/rails/.bundle/gems/mail-2.6.1/lib/mail/network/delivery_methods/smtp.rb:112:in `deliver!' /Users/senny/Projects/rails/.bundle/gems/mail-2.6.1/lib/mail/message.rb:2136:in `do_delivery' /Users/senny/Projects/rails/.bundle/gems/mail-2.6.1/lib/mail/message.rb:232:in `block in deliver' /Users/senny/Projects/rails/actionmailer/lib/action_mailer/base.rb:528:in `block in deliver_mail' /Users/senny/Projects/rails/activesupport/lib/active_support/notifications.rb:164:in `block in instrument' /Users/senny/Projects/rails/activesupport/lib/active_support/notifications/instrumenter.rb:20:in `instrument' /Users/senny/Projects/rails/activesupport/lib/active_support/notifications.rb:164:in `instrument' /Users/senny/Projects/rails/actionmailer/lib/action_mailer/base.rb:526:in `deliver_mail' /Users/senny/Projects/rails/.bundle/gems/mail-2.6.1/lib/mail/message.rb:232:in `deliver' /Users/senny/Projects/rails/actionmailer/test/base_test.rb:598:in `block (2 levels) in <class:BaseTest>' /Users/senny/Projects/rails/actionmailer/test/base_test.rb:801:in `mail_side_effects' /Users/senny/Projects/rails/actionmailer/test/base_test.rb:593:in `block in <class:BaseTest>' ``` where the `:smtp` delivery method was leaked over to other test cases.
| | * | actionmailer_tests_are_order_dependent!Akira Matsuda2014-08-131-0/+5
| | | |
| | * | AM, AP, AV, and AMo tests are already order_independent!Akira Matsuda2014-08-131-5/+0
| | | |
| * | | Added ActionMailer::DeliverLaterAbdelkader Boudih2014-08-137-1/+160
| | | |
* | | | Merge branch 'master' into loofahRafael Mendonça França2014-08-126-14/+95
|\ \ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | Conflicts: actionpack/CHANGELOG.md actionpack/test/controller/integration_test.rb actionview/CHANGELOG.md
| * | | Nobody sucks so nobody should call this awful method nameRafael Mendonça França2014-08-121-1/+1
| | | |
| * | | users_dont_suck_but_only_we_suck_and_only_our_tests_are_order_dependent!Akira Matsuda2014-08-121-0/+5
| |/ / | | | | | | | | | | | | Calling ActiveSupport::TestCase.i_suck_and_my_tests_are_order_dependent! in AS::TestCase makes everyone's tests order dependent, which should never be done by the framework.
| * | Deprecate `*_path` methods in mailers@schneems and @sgrif2014-07-303-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Email does not support relative links since there is no implicit host. Therefore all links inside of emails must be fully qualified URLs. All path helpers are now deprecated. When removed, the error will give early indication to developers to use `*_url` methods instead. Currently if a developer uses a `*_path` helper, their tests and `mail_view` will not catch the mistake. The only way to see the error is by sending emails in production. Preventing sending out emails with non-working path's is the desired end goal of this PR. Currently path helpers are mixed-in to controllers (the ActionMailer::Base acts as a controller). All `*_url` and `*_path` helpers are made available through the same module. This PR separates this behavior into two modules so we can extend the `*_path` methods to add a Deprecation to them. Once deprecated we can use this same area to raise a NoMethodError and add an informative message directing the developer to use `*_url` instead. The module with warnings is only mixed in when a controller returns false from the newly added `supports_relative_path?`. Paired @sgrif & @schneems
| * | Raise an exception when attachments are added after `mail` was called.Yves Senn2014-07-293-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #16163 Adding attachments after a call to `mail` will result in invalid emails. This is related to the fact, that `mail` is making the required preparations before the email is ready to be sent. These change depending on your added attachments.
| * | Merge branch 'rm-remove-mocha'Rafael Mendonça França2014-07-191-0/+2
| |\ \ | | | | | | | | | | | | | | | | Conflicts: actionpack/test/abstract_unit.rb
| | * | Stop requiring mocha automaticallyRafael Mendonça França2014-07-191-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We are planning to remove mocha from our test suite because of performance problems. To make this possible we should stop require mocha on ActionSupport::TestCase. This should not affect applications since users still need to add mocha to Gemfile and this already load mocha. Added FIXME notes to place that still need mocha removal
| * | | Prefer to pass block when logging.Guo Xiang Tan2014-07-181-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Logger by default includes a guard which checks for the logging level. By removing the custom logging guards, we can decouple the logging guard from the logging action to be done. This also follows the good practice listed on http://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance.
| * | | Fix typos like `a html` to `an html` and 'an mail' to 'an email'. [ci skip]Santosh Wadghule2014-07-141-1/+1
| |/ /
* | | Defining the right dependenciesRafael Mendonça França2014-07-151-0/+1
| | |
* | | Include the selector assertions on the test caseRafael Mendonça França2014-07-152-3/+2
| | | | | | | | | | | | | | | We don't need to require users to include this module on ActionMailer::TestCase
* | | Rails is a module not a classRafael Mendonça França2014-07-151-1/+1
| | |
* | | Merge pull request #11218 from kaspth/loofah-integrationRafael Mendonça França2014-07-102-3/+52
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | Loofah-integration Conflicts: actionpack/CHANGELOG.md actionview/CHANGELOG.md
| * | Restore delivery method on teardowns.Timm2014-06-161-3/+2
| | |
| * | Inline Assertion reference.Timm2014-06-161-3/+4
| | |
| * | Remove response faking.Timm2014-06-161-15/+1
| | |
| * | Use 1.9 syntax.Timm2014-06-161-6/+6
| | |
| * | Added rails-dom-testing and rails-html-sanitizer to Gemfile. Added tests for ↵Timm2014-06-161-0/+63
| | | | | | | | | | | | assert_select_email.
* | | test i18n against a routed appAaron Patterson2014-07-071-1/+16
| | |
* | | add test coverage for the action mailerDmitry Polushkin2014-07-046-38/+16
| | |
* | | Rename preview_enabled option to show_previewsRafael Mendonça França2014-07-013-8/+8
| | |
* | | Add configuration to enable mail previewsLeonard Garvey2014-07-013-1/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds `config.action_mailer.preview_enabled` This allows mail previewing to be enabled easily in non-development environments such as staging. The default is set to true for development so no changes should be required to existing Rails applications. The mail preview path can still be configured using the existing `config.action_mailer.preview_path` configuration option. Adding this avoids devs from having to do stuff like: https://gist.github.com/lengarvey/fa2c9bd6cdbeba96526a Update actionmailer/CHANGELOG with new configuration. Update configuring guide with new configuratation. Add `config.action_mailer.preview_path` to configuring guide.
* | | Merge pull request #15815 from DNNX/mail-helper-refactoringRafael Mendonça França2014-06-191-2/+2
|\ \ \ | | | | | | | | Remove unused block parameter from #gsub call in AM::MailHelper#block_format
| * | | Remove unused block parameter from #gsub call in AM::MailHelper#block_formatViktar Basharymau2014-06-191-2/+2
| | | |
* | | | Add `logger.debug?` guard to `ActionMailer::LogSubscriber#process`Viktar Basharymau2014-06-191-0/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | *TLDR*: The method is 4 times faster when log level is higher than DEBUG. Also, the other two methods, `#deliver` and `#receive` have similar guard statements, so this commit adds some symmetry to the code. This is probably not the most critical part of ActionMailer in terms of performance, but here are some benchmarks: ``` require 'benchmark/ips' require 'action_mailer' event = ActiveSupport::Notifications::Event.new( 'process.action_mailer', Time.now, Time.now, 'bf4e2b36ce085fd35b24', { mailer: "UserMailer", action: :welcome } ) ActionMailer::Base.logger = ActiveSupport::Logger.new '/dev/null' subscriber = ActionMailer::LogSubscriber.new def subscriber.process_with_guard(event) return unless logger.debug? mailer = event.payload[:mailer] action = event.payload[:action] debug("\n#{mailer}##{action}: processed outbound mail in #{event.duration.round(1)}ms") end Benchmark.ips do |r| ActionMailer::Base.logger.level = ::Logger::Severity::INFO r.report('no guard') { subscriber.process(event) } r.report(' guard') { subscriber.process_with_guard(event) } end __END__ Calculating ------------------------------------- no guard 9640 i/100ms guard 38381 i/100ms ------------------------------------------------- no guard 169166.9 (±10.2%) i/s - 838680 in 5.007262s guard 728184.9 (±9.6%) i/s - 3607814 in 4.999218s ``` When log level is DEBUG, the _guarded_ method is a bit slower. This is a good tradeoff for 4x improvement in production mode. ``` Benchmark.ips do |r| ActionMailer::Base.logger.level = ::Logger::Severity::DEBUG r.report('no guard') { subscriber.process(event) } r.report(' guard') { subscriber.process_with_guard(event) } end __END__ Calculating ------------------------------------- no guard 4970 i/100ms guard 4564 i/100ms ------------------------------------------------- no guard 55617.4 (±3.5%) i/s - 278320 in 5.010523s guard 49452.1 (±5.6%) i/s - 251020 in 5.093358s ```
* | | allow preview interceptors to be registered through `config.action_mailer`.Yves Senn2014-06-153-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was partially broken because `preview_interceptors=` just assigned the raw values, whithout going through `register_preview_interceptor`. Now the Action Mailer railtie takes care of the `preview_interceptors` option. This commit is a partial revert of: Revert "Merge pull request #15739 from y-yagi/correct_doc_for_action_mailer_base" This reverts commit a15704d7f35f17d34d0118546799141d6f853656, reversing changes made to 1bd12a8609d275ad75fcc4b622ca4f5b32dc76be. /cc @kuldeepaggarwal @y-yagi
* | | [ci skip] correct doc for `register_preview_interceptor`yuuji.yaginuma2014-06-151-1/+1
| | |
* | | Merge pull request #15590 from ↵Yves Senn2014-06-121-4/+0
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | zuhao/refactor_actionview_register_template_handler Add unregister_template_handler to prevent leaks. Conflicts: actionview/CHANGELOG.md
| * | Add unregister_template_handler to prevent leaks.Zuhao Wan2014-06-121-4/+0
| | |
* | | [ci skip] Improve enable_starttls_auto documentation.Juanito Fatas2014-06-111-2/+2
|/ /
* | Restore I18n.locale to default after test.Zuhao Wan2014-06-071-0/+4
| | | | | | | | | | | | | | | | | | | | If i18n_with_controller_test.rb were to run first, the I18n.locale will be changed to :de, and the following tests in base_test.rb will fail: "subject gets default from I18n" “default subject can have interpolations” "translations are scoped properly" "implicit multipart with default locale"
* | Restore test deliveries properly in ActionMailer.Zuhao Wan2014-06-071-0/+8
| | | | | | | | | | | | | | | | | | | | | | `ActionMailer::Base.delivery_method` and `ActionMailer::Base.perform_deliveries` have leaked states. "delivery method can be customized per instance" and "delivery method can be customized in subclasses not changing the parent" in delivery_methods_test.rb will fail if test_helper_test.rb (in which TestHelperMailerTest is inherited from ActionMailer::TestCase) runs before it.
* | Relax mail gem constraint from ~> 2.5.4 to ~> 2.5, >= 2.5.4Benjamin Fleischer2014-06-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows Rails users to install mail 2.6 which relaxes the mime-types dependency, which is a big win for a lot of people. Previously, the mail gem restricted mime-types to ~> 1.16 but now it has expanded to [">= 1.16", "< 3"] And the mime-types maintainer will also be checking that 2.x releases don't break mail. See https://github.com/mikel/mail/pull/713 https://rubygems.org/gems/mail/versions/2.6.0
* | Feature requests should be made on the mailing list, not submitted toZachary Scott2014-06-011-1/+5
| | | | | | | | the issue tracker. See also #15455 [ci skip]
* | Pass through AM documentation re: 02d048d [ci skip]Zachary Scott2014-05-262-5/+7
| |
* | Use "Action Mailer" as canonical name in documentation [ci skip]Zachary Scott2014-05-261-1/+1
| | | | | | | | | | See also: https://github.com/rails/rails/commit/3a297f8db75b172882bb3c2f9440d0c7365b8b11#commitcomment-6451708
* | Add description of ActionMailer::TestHelper module [ci skip]Zachary Scott2014-05-261-0/+2
| |
* | Merge pull request #15083 from ↵Yves Senn2014-05-131-11/+14
|\ \ | | | | | | | | | | | | zuhao/refactor_actionmailer_i18n_with_controller_test Use with_translation helper to clean up I18n stored translations.
| * | Use with_translation helper to clean up I18n stored translations.Zuhao Wan2014-05-131-11/+14
| | |
* | | Merge pull request #15082 from zuhao/refactor_actionmailer_delivery_methods_testYves Senn2014-05-131-30/+42
|\ \ \ | | | | | | | | Clean up deliveries after each test.
| * | | Move state restoration from setup/teardown into affected test cases.Zuhao Wan2014-05-131-30/+42
| |/ /
* | | Merge pull request #15086 from zuhao/refactor_actionmailer_mail_layout_testYves Senn2014-05-131-10/+0
|\ \ \ | | | | | | | | Do not clear deliveries in setup.