Skip to content

Commit

Permalink
- Changed redundant user of deliver to deliver_now
Browse files Browse the repository at this point in the history
- Wrapped text in setting defaults section. Also added break, to a sentence.
[ci skip]
  • Loading branch information
vipulnsward committed Oct 31, 2014
1 parent 0249c36 commit d3e4100
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions actionmailer/README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ generated would look like this:

Thank you for signing up!

In order to send mails, you simply call the method and then call +deliver+ on the return value.
In order to send mails, you simply call the method and then call +deliver_now+ on the return value.

Calling the method returns a Mail Message object:

Expand All @@ -74,7 +74,12 @@ Or you can just chain the methods together like:

== Setting defaults

It is possible to set default values that will be used in every method in your Action Mailer class. To implement this functionality, you just call the public class method <tt>default</tt> which you get for free from <tt>ActionMailer::Base</tt>. This method accepts a Hash as the parameter. You can use any of the headers email messages have, like <tt>:from</tt> as the key. You can also pass in a string as 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.
It is possible to set default values that will be used in every method in your Action Mailer class.
To implement this functionality, you just call the public class method <tt>default</tt> which you get for free from
<tt>ActionMailer::Base</tt>. This method accepts a Hash as the parameter. You can use any of the headers, email messages
have, like <tt>:from</tt> as the key. You can also pass in a string as 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.

Expand Down

0 comments on commit d3e4100

Please sign in to comment.