forked from rails/rails
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Readability in Action Mailer README.
- Loading branch information
Kristian Freeman
committed
Dec 23, 2011
1 parent
cffb636
commit 2d6d39a
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,7 +42,7 @@ So the corresponding body template for the method above could look like this: | |
|
||
Thank you for signing up! | ||
|
||
And if the recipient was given as "[email protected]", the email | ||
If the recipient was given as "[email protected]", the email | ||
generated would look like this: | ||
|
||
Date: Mon, 25 Jan 2010 22:48:09 +1100 | ||
|
@@ -62,7 +62,7 @@ generated would look like this: | |
Thank you for signing up! | ||
|
||
In previous version of Rails you would call <tt>create_method_name</tt> and | ||
<tt>deliver_method_name</tt>. Rails 3.0 has a much simpler interface, you | ||
<tt>deliver_method_name</tt>. Rails 3.0 has a much simpler interface - you | ||
simply call the method and optionally call +deliver+ on the return value. | ||
|
||
Calling the method returns a Mail Message object: | ||
|
@@ -76,7 +76,7 @@ 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 ActionMailer::Base. This method accepts a Hash as the parameter. You can use any of the headers e-mail messages has, 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 ActionMailer::Base. This method accepts a Hash as the parameter. You can use any of the headers e-mail messages has, 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 over written if you use the same key in your mailer method. | ||
|
||
|