aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer/lib/action_mailer/base.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #36198 from oneiros/actionmailer_ssl_optionRyuta Kamizono2019-07-291-1/+1
|\ | | | | | | | | Documentation for ActionMailer's SMTP over SSL/TLS option [ci skip]
| * Improve documentation of `:ssl/:tls` option [ci skip]David Roetzel2019-07-291-1/+1
| | | | | | | | | | | | | | | | Add missing bullet point to make clear this is actually a separate option from `:openssl_verify_mode`. Add `:ssl/:tls`-option to guides as well [ci skip]
* | Merge pull request #36227 from ↵Rafael França2019-07-261-1/+1
|\ \ | | | | | | | | | | | | betesh/avoid-misleading-error-about-late-attachments Prevent reading inline attachments after `mail` was called from raising an inaccurate exception
| * | Prevent reading inline attachments after `mail` was called from raising an ↵Isaac Betesh2019-05-211-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | inaccurate exception Without this change, `attachments.inline['my_attachment'].present?`, for example, would raise the exception `Can't add attachments after mail was called`. I first brought this issue up at https://github.com/rails/rails/issues/16163#issuecomment-437378347. Note that this commit addresses only one of the 2 problems I described in that comment. The other problem is that using `attachments.inline['my_attachment']` for reading an attachment is unnecessary--it's the same as `attachments['my_attachment']`--even before `mail` is called. We could add a warning about the unnecessary use of `inline` but I'm saving that for a later PR since my comment has not received any feedback yet.
* / Enable `Layout/EmptyLinesAroundAccessModifier` copRyuta Kamizono2019-06-131-2/+0
|/ | | | | | | | | | | We sometimes say "✂️ newline after `private`" in a code review (e.g. https://github.com/rails/rails/pull/18546#discussion_r23188776, https://github.com/rails/rails/pull/34832#discussion_r244847195). Now `Layout/EmptyLinesAroundAccessModifier` cop have new enforced style `EnforcedStyle: only_before` (https://github.com/rubocop-hq/rubocop/pull/7059). That cop and enforced style will reduce the our code review cost.
* Merge pull request #35121 from utilum/warning_tried_to_create_proc_without_blockKasper Timm Hansen2019-03-101-2/+2
|\ | | | | Ruby 2.7 warning: creating a Proc without a block
| * Ruby 2.7 warning: creating a Proc without a blockutilum2019-02-131-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As of [Revision 66772]( https://bugs.ruby-lang.org/projects/ruby-trunk/repository/trunk/revisions/66772) `Proc.new` without giving a block emits `warning: tried to create Proc object without a block`. This commit fixes cases where Rails test suit tickles this warning. See CI logs: https://travis-ci.org/rails/rails/jobs/487205819#L1161-L1190 https://travis-ci.org/rails/rails/jobs/487205821#L1154-1159 https://travis-ci.org/rails/rails/jobs/487205821#L1160-L1169 https://travis-ci.org/rails/rails/jobs/487205821#L1189 https://travis-ci.org/rails/rails/jobs/487254404#L1307-L1416 https://travis-ci.org/rails/rails/jobs/487254405#L1174-L1191
* | Add test and change how format set in ActionMailerJohn Hawthorn2019-03-011-2/+1
| | | | | | | | | | | | | | | | | | | | Previously this used self.formats= to set the format which render would use to find templates. This worked, but was untested, and looked a little confusing because it was doing the mutation within a loop. This commit replaces the assignment with passing formats: [format] into the render call, which makes it more obvious that that's the purpose of the format. It also adds a test to verify the formats being used.
* | Create templates with format=nilJohn Hawthorn2019-02-261-2/+3
| |
* | Templates have one formatAaron Patterson2019-02-251-2/+2
| | | | | | | | | | | | | | Templates only have one format. Before this commit, templates would be constructed with a single element array that contained the format. This commit eliminates the single element array and just implements a `format` method. This saves one array allocation per template.
* | Don’t log recipients when sending mailJaap van der Plas2019-02-131-1/+1
|/ | | | | | Since production applications typically run with log level info and email adresses should be considered as sensitive data we want to prevent them from ending up in the logs. In development mode (with log level debug) they are still logged as part of the Mail::Message object.
* Move MailDeliveryJob default to 6.0 defaultsGannon McGibbon2019-01-071-1/+1
|
* Deprecate ActionMailer::Base.receive in favor of Action MailboxGeorge Claghorn2018-12-271-0/+5
|
* Add MailDeliveryJob for unified mail deliveryGannon McGibbon2018-12-041-1/+1
| | | | | Add `MailDeliveryJob` for delivering both regular and parameterized mail. Deprecate using `DeliveryJob` and `Parameterized::DeliveryJob`.
* Deliver parameterized mail with DeliveryJobGannon McGibbon2018-11-221-1/+0
| | | | | Deliver parameterized mail with `ActionMailer::DeliveryJob` and remove `ActionMailer::Parameterized::DeliveryJob`.
* 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-051-0/+1
| | | | | | | | | | | | | | | | | | | | 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
* | 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'
* | Add `perform_deliveries` to a payload of `deliver.action_mailer` notification.Yoshiyuki Kinjo2018-09-091-10/+10
| |
* | Skip delivery notification when perform_deliveries is false.Yoshiyuki Kinjo2018-09-081-0/+1
| |
* | ActionMailer::Base can unregister observer(s) and interceptor(s). (#32207)Kota Miyake2018-05-301-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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]
* | 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.
* | | [Action Mailer] require_relative => requireAkira Matsuda2017-10-211-3/+3
| | | | | | | | | | | | This basically reverts cd9cc721ab54e2b0c7875cacf2113f03908a8bb7
* | | Update Action Mailer doc [ci skip]Yoshiyuki Hirano2017-08-301-3/+3
|/ /
* | 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-231-0/+2
| |
* | [Action Mailer] require => require_relativeAkira Matsuda2017-07-011-3/+3
| |
* | Allow mailers to configure their delivery jobMatthew Mongeau2017-06-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | 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
* | Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-291-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | * 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
* | Document using `default_url_options` in an ActionMailer class.Krzysztof Zych2017-03-081-0/+3
| |
* | Freeze fragment cache related instrument name.Stan Lo2017-02-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | ActionMailer::Base#instrument_name and ActionController::Base#instrument_name will be frequently called once caching is enabled. So it's better to freeze them instead of create new string on every call. Also, the instrument name in #instrument_fragment_cache will usually be "write_fragment.action_controller" or "read_fragment.action_controller". So freezing them might also gain some performance improvement. We have done something like this in other places: https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
* | Add `:args` to `process.action_mailer` eventyuuji.yaginuma2017-02-041-1/+2
| |
* | add default value to `deliver_later_queue_name` option [ci skip]yuuji.yaginuma2017-01-311-1/+1
| |
* | Offer the option to use parameterization for shared processing of headers ↵David Heinemeier Hansson2017-01-281-7/+6
| | | | | | | | | | and ivars (#27825) Offer the option to use parameterization for shared processing of headers and ivars
* | ZOMG worst typo in my life :scream:Akira Matsuda2017-01-151-1/+1
| |
* | `respond_to_missing?` should fallback to `super` where method_missing could ↵Akira Matsuda2017-01-151-1/+1
| | | | | | | | call `super`
* | Merge pull request #27227 from MQuy/allow-custom-content-type-in-mail-bodyRafael Mendonça França2017-01-061-4/+21
|\ \ | | | | | | | | | Allow to custom content type when setting mailer body
| * | Remove unnecessary condition in content_typeMQuy2017-01-061-1/+1
| | |
| * | Add document in mailerMQuy2016-12-061-0/+13
| | |
| * | allow context type when set body mailMQuy2016-11-301-4/+8
| | |
* | | Privatize unneededly protected methods in Action MailerAkira Matsuda2016-12-241-11/+7
| | |
* | | No need to nodoc private methodAkira Matsuda2016-12-241-1/+1
|/ /
* | Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-2/+2
| |
* | Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-15/+15
| | | | | | | | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* | normalizes indentation and whitespace across the projectXavier Noria2016-08-061-94/+94
| |
* | applies new string literal convention in actionmailer/libXavier Noria2016-08-061-10/+10
| | | | | | | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* | remove `-t` option from default sendmail arguments [ci skip]yuuji.yaginuma2016-07-061-1/+1
| | | | | | | | Follow up to #24436
* | Do not suggest nonsensical OpenSSL verify modes [ci skip]Jonne Haß2016-06-071-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SSL_set_verify(3) explains: SSL_VERIFY_FAIL_IF_NO_PEER_CERT Server mode: if the client did not return a certificate, the TLS/SSL handshake is immediately terminated with a "handshake failure" alert. This flag must be used together with SSL_VERIFY_PEER. Client mode: ignored SSL_VERIFY_CLIENT_ONCE Server mode: only request a client certificate on the initial TLS/SSL handshake. Do not ask for a client certificate again in case of a renegotiation. This flag must be used together with SSL_VERIFY_PEER. Client mode: ignored The SMTP connection here uses a OpenSSL socket in client mode, suggesting invalid/ignored flags is rather misleading.