aboutsummaryrefslogtreecommitdiffstats
path: root/guides
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2018-09-11 16:30:22 -0400
committerGitHub <noreply@github.com>2018-09-11 16:30:22 -0400
commit7acd2674fb6822cc3841ae2d59b93695ef18b71a (patch)
treea1038855dee638770fa4d9640acda3268034b474 /guides
parentd54d0c95750e2693da495b75ac5fa0280253972d (diff)
parent576209b45bf6d20e91562da77e454bc58bda3658 (diff)
downloadrails-7acd2674fb6822cc3841ae2d59b93695ef18b71a.tar.gz
rails-7acd2674fb6822cc3841ae2d59b93695ef18b71a.tar.bz2
rails-7acd2674fb6822cc3841ae2d59b93695ef18b71a.zip
Merge pull request #33824 from yskkin/suppress_logging
Skip delivery notification when perform_deliveries is false.
Diffstat (limited to 'guides')
-rw-r--r--guides/source/action_mailer_basics.md2
-rw-r--r--guides/source/active_support_instrumentation.md26
2 files changed, 15 insertions, 13 deletions
diff --git a/guides/source/action_mailer_basics.md b/guides/source/action_mailer_basics.md
index 37cbf3f53d..406615f681 100644
--- a/guides/source/action_mailer_basics.md
+++ b/guides/source/action_mailer_basics.md
@@ -787,7 +787,7 @@ files (environment.rb, production.rb, etc...)
|`sendmail_settings`|Allows you to override options for the `:sendmail` delivery method.<ul><li>`:location` - The location of the sendmail executable. Defaults to `/usr/sbin/sendmail`.</li><li>`:arguments` - The command line arguments to be passed to sendmail. Defaults to `-i`.</li></ul>|
|`raise_delivery_errors`|Whether or not errors should be raised if the email fails to be delivered. This only works if the external email server is configured for immediate delivery.|
|`delivery_method`|Defines a delivery method. Possible values are:<ul><li>`:smtp` (default), can be configured by using `config.action_mailer.smtp_settings`.</li><li>`:sendmail`, can be configured by using `config.action_mailer.sendmail_settings`.</li><li>`:file`: save emails to files; can be configured by using `config.action_mailer.file_settings`.</li><li>`:test`: save emails to `ActionMailer::Base.deliveries` array.</li></ul>See [API docs](http://api.rubyonrails.org/classes/ActionMailer/Base.html) for more info.|
-|`perform_deliveries`|Determines whether deliveries are actually carried out when the `deliver` method is invoked on the Mail message. By default they are, but this can be turned off to help functional testing.|
+|`perform_deliveries`|Determines whether deliveries are actually carried out when the `deliver` method is invoked on the Mail message. By default they are, but this can be turned off to help functional testing. If this value is `false`, `deliveries` array will not be populated even if delivery_method is :test.|
|`deliveries`|Keeps an array of all the emails sent out through the Action Mailer with delivery_method :test. Most useful for unit and functional testing.|
|`default_options`|Allows you to set default values for the `mail` method options (`:from`, `:reply_to`, etc.).|
diff --git a/guides/source/active_support_instrumentation.md b/guides/source/active_support_instrumentation.md
index 8581817d71..69c6a6e414 100644
--- a/guides/source/active_support_instrumentation.md
+++ b/guides/source/active_support_instrumentation.md
@@ -319,17 +319,18 @@ Action Mailer
### deliver.action_mailer
-| Key | Value |
-| ------------- | -------------------------------------------- |
-| `:mailer` | Name of the mailer class |
-| `:message_id` | ID of the message, generated by the Mail gem |
-| `:subject` | Subject of the mail |
-| `:to` | To address(es) of the mail |
-| `:from` | From address of the mail |
-| `:bcc` | BCC addresses of the mail |
-| `:cc` | CC addresses of the mail |
-| `:date` | Date of the mail |
-| `:mail` | The encoded form of the mail |
+| Key | Value |
+| --------------------- | ---------------------------------------------------- |
+| `:mailer` | Name of the mailer class |
+| `:message_id` | ID of the message, generated by the Mail gem |
+| `:subject` | Subject of the mail |
+| `:to` | To address(es) of the mail |
+| `:from` | From address of the mail |
+| `:bcc` | BCC addresses of the mail |
+| `:cc` | CC addresses of the mail |
+| `:date` | Date of the mail |
+| `:mail` | The encoded form of the mail |
+| `:perform_deliveries` | Whether delivery of this message is performed or not |
```ruby
{
@@ -339,7 +340,8 @@ Action Mailer
to: ["users@rails.com", "dhh@rails.com"],
from: ["me@rails.com"],
date: Sat, 10 Mar 2012 14:18:09 +0100,
- mail: "..." # omitted for brevity
+ mail: "...", # omitted for brevity
+ perform_deliveries: true
}
```