Tiny documentation styling fixes [ci skip]
This commit is contained in:
parent
26126c8533
commit
1d6d0cc245
|
@ -74,14 +74,17 @@ Or you can just chain the methods together like:
|
||||||
|
|
||||||
== Setting defaults
|
== Setting defaults
|
||||||
|
|
||||||
It is possible to set default values that will be used in every method in your Action Mailer class.
|
It is possible to set default values that will be used in every method in your
|
||||||
To implement this functionality, you just call the public class method <tt>default</tt> which you get for free from
|
Action Mailer class. To implement this functionality, you just call the public
|
||||||
<tt>ActionMailer::Base</tt>. This method accepts a Hash as the parameter. You can use any of the headers, email messages
|
class method +default+ which you get for free from <tt>ActionMailer::Base</tt>.
|
||||||
have, like <tt>:from</tt> as the key. You can also pass in a string as the key, like "Content-Type", but Action Mailer
|
This method accepts a Hash as the parameter. You can use any of the headers,
|
||||||
does this out of the box for you, so you won't need to worry about that.
|
email messages have, like +:from+ as the key. You can also pass in a string as
|
||||||
Finally, it is also possible to pass in a Proc that will get evaluated when it is needed.
|
the key, like "Content-Type", but Action Mailer does this out of the box for you,
|
||||||
|
so you won't need to worry about that. Finally, it is also possible to pass in a
|
||||||
|
Proc that will get evaluated when it is needed.
|
||||||
|
|
||||||
Note that every value you set with this method will get overwritten if you use the same key in your mailer method.
|
Note that every value you set with this method will get overwritten if you use the
|
||||||
|
same key in your mailer method.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
@ -92,10 +95,11 @@ Example:
|
||||||
|
|
||||||
== Receiving emails
|
== Receiving emails
|
||||||
|
|
||||||
To receive emails, you need to implement a public instance method called <tt>receive</tt> that takes an
|
To receive emails, you need to implement a public instance method called
|
||||||
email object as its single parameter. The Action Mailer framework has a corresponding class method,
|
+receive+ that takes an email object as its single parameter. The Action Mailer
|
||||||
which is also called <tt>receive</tt>, that accepts a raw, unprocessed email as a string, which it then turns
|
framework has a corresponding class method, which is also called +receive+, that
|
||||||
into the email object and calls the receive instance method.
|
accepts a raw, unprocessed email as a string, which it then turns into the email
|
||||||
|
object and calls the receive instance method.
|
||||||
|
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
|
@ -116,13 +120,14 @@ Example:
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
This Mailman can be the target for Postfix or other MTAs. In Rails, you would use the runner in the
|
This Mailman can be the target for Postfix or other MTAs. In Rails, you would use
|
||||||
trivial case like this:
|
the runner in the trivial case like this:
|
||||||
|
|
||||||
rails runner 'Mailman.receive(STDIN.read)'
|
rails runner 'Mailman.receive(STDIN.read)'
|
||||||
|
|
||||||
However, invoking Rails in the runner for each mail to be received is very resource intensive. A single
|
However, invoking Rails in the runner for each mail to be received is very
|
||||||
instance of Rails should be run within a daemon, if it is going to process more than just a limited amount of email.
|
resource intensive. A single instance of Rails should be run within a daemon, if
|
||||||
|
it is going to process more than just a limited amount of email.
|
||||||
|
|
||||||
== Configuration
|
== Configuration
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ module ActiveJob
|
||||||
# * {Sneakers}[https://github.com/jondot/sneakers]
|
# * {Sneakers}[https://github.com/jondot/sneakers]
|
||||||
# * {Sucker Punch}[https://github.com/brandonhilkert/sucker_punch]
|
# * {Sucker Punch}[https://github.com/brandonhilkert/sucker_punch]
|
||||||
#
|
#
|
||||||
# #### Backends Features
|
# === Backends Features
|
||||||
#
|
#
|
||||||
# | | Async | Queues | Delayed | Priorities | Timeout | Retries |
|
# | | Async | Queues | Delayed | Priorities | Timeout | Retries |
|
||||||
# |-------------------|-------|--------|-----------|------------|---------|---------|
|
# |-------------------|-------|--------|-----------|------------|---------|---------|
|
||||||
|
|
|
@ -1347,7 +1347,8 @@ config.assets.digest = true
|
||||||
|
|
||||||
Rails 4 no longer sets default config values for Sprockets in `test.rb`, so
|
Rails 4 no longer sets default config values for Sprockets in `test.rb`, so
|
||||||
`test.rb` now requires Sprockets configuration. The old defaults in the test
|
`test.rb` now requires Sprockets configuration. The old defaults in the test
|
||||||
environment are: `config.assets.compile = true`, `config.assets.compress = false`, `config.assets.debug = false` and `config.assets.digest = false`.
|
environment are: `config.assets.compile = true`, `config.assets.compress = false`,
|
||||||
|
`config.assets.debug = false` and `config.assets.digest = false`.
|
||||||
|
|
||||||
The following should also be added to `Gemfile`:
|
The following should also be added to `Gemfile`:
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue