aboutsummaryrefslogtreecommitdiffstats
path: root/actionmailer
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2007-02-21 00:29:44 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2007-02-21 00:29:44 +0000
commit21187c0fb4fc559927a2f947f909dedd85969ffb (patch)
treeefd0ceb5c3a88531916186e97aa106041c293975 /actionmailer
parentb5419cd66ea160d1ee94f3ca521bb44adf3a21ca (diff)
downloadrails-21187c0fb4fc559927a2f947f909dedd85969ffb.tar.gz
rails-21187c0fb4fc559927a2f947f909dedd85969ffb.tar.bz2
rails-21187c0fb4fc559927a2f947f909dedd85969ffb.zip
Apply the rest of Chads patch
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionmailer')
-rw-r--r--actionmailer/lib/action_mailer/base.rb20
-rw-r--r--actionmailer/test/fixtures/first_mailer/share.erb1
-rw-r--r--actionmailer/test/fixtures/first_mailer/share.rhtml1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_example_helper.erb1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_helper.erb1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_helper.rhtml1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_helper_method.erb1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml1
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb5
-rw-r--r--actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml5
-rw-r--r--actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb1
-rw-r--r--actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml1
-rw-r--r--actionmailer/test/fixtures/second_mailer/share.erb1
-rw-r--r--actionmailer/test/fixtures/second_mailer/share.rhtml1
-rw-r--r--actionmailer/test/fixtures/templates/signed_up.erb3
-rw-r--r--actionmailer/test/fixtures/templates/signed_up.rhtml3
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb1
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml1
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb10
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml10
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb2
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml2
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb1
-rw-r--r--actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml1
-rw-r--r--actionmailer/test/fixtures/test_mailer/signed_up.erb3
-rw-r--r--actionmailer/test/fixtures/test_mailer/signed_up.rhtml3
-rw-r--r--actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb3
-rw-r--r--actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml3
29 files changed, 44 insertions, 44 deletions
diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb
index 5de9331674..044ff46587 100644
--- a/actionmailer/lib/action_mailer/base.rb
+++ b/actionmailer/lib/action_mailer/base.rb
@@ -52,9 +52,9 @@ module ActionMailer #:nodoc:
#
# Like ActionController, each mailer class has a corresponding view directory
# in which each method of the class looks for a template with its name.
- # To define a template to be used with a mailing, create an <tt>.rhtml</tt> file with the same name as the method
+ # To define a template to be used with a mailing, create an <tt>.erb</tt> file with the same name as the method
# in your mailer model. For example, in the mailer defined above, the template at
- # <tt>app/views/notifier/signup_notification.rhtml</tt> would be used to generate the email.
+ # <tt>app/views/notifier/signup_notification.erb</tt> would be used to generate the email.
#
# Variables defined in the model are accessible as instance variables in the view.
#
@@ -103,7 +103,7 @@ module ActionMailer #:nodoc:
#
# = HTML email
#
- # To send mail as HTML, make sure your view (the <tt>.rhtml</tt> file) generates HTML and
+ # To send mail as HTML, make sure your view (the <tt>.erb</tt> file) generates HTML and
# set the content type to html.
#
# class MyMailer < ActionMailer::Base
@@ -142,10 +142,10 @@ module ActionMailer #:nodoc:
# by the content type. Each such detected template will be added as separate part to the message.
#
# For example, if the following templates existed:
- # * signup_notification.text.plain.rhtml
- # * signup_notification.text.html.rhtml
- # * signup_notification.text.xml.rxml
- # * signup_notification.text.x-yaml.rhtml
+ # * signup_notification.text.plain.erb
+ # * signup_notification.text.html.erb
+ # * signup_notification.text.xml.builder
+ # * signup_notification.text.x-yaml.erb
#
# Each would be rendered and added as a separate part to the message,
# with the corresponding content type. The same body hash is passed to
@@ -383,14 +383,14 @@ module ActionMailer #:nodoc:
unless String === @body
# First, we look to see if there are any likely templates that match,
# which include the content-type in their file name (i.e.,
- # "the_template_file.text.html.rhtml", etc.). Only do this if parts
+ # "the_template_file.text.html.erb", etc.). Only do this if parts
# have not already been specified manually.
if @parts.empty?
templates = Dir.glob("#{template_path}/#{@template}.*")
templates.each do |path|
- # TODO: don't hardcode rhtml|rxml
+ # TODO: don't hardcode erb|builder
basename = File.basename(path)
- next unless md = /^([^\.]+)\.([^\.]+\.[^\.]+)\.(rhtml|rxml)$/.match(basename)
+ next unless md = /^([^\.]+)\.([^\.]+\.[^\.]+)\.(erb|builder|rhtml|rxml)$/.match(basename)
template_name = basename
content_type = md.captures[1].gsub('.', '/')
@parts << Part.new(:content_type => content_type,
diff --git a/actionmailer/test/fixtures/first_mailer/share.erb b/actionmailer/test/fixtures/first_mailer/share.erb
new file mode 100644
index 0000000000..da43638ceb
--- /dev/null
+++ b/actionmailer/test/fixtures/first_mailer/share.erb
@@ -0,0 +1 @@
+first mail
diff --git a/actionmailer/test/fixtures/first_mailer/share.rhtml b/actionmailer/test/fixtures/first_mailer/share.rhtml
index da43638ceb..e69de29bb2 100644
--- a/actionmailer/test/fixtures/first_mailer/share.rhtml
+++ b/actionmailer/test/fixtures/first_mailer/share.rhtml
@@ -1 +0,0 @@
-first mail
diff --git a/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb b/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb
new file mode 100644
index 0000000000..fcff3bb1b4
--- /dev/null
+++ b/actionmailer/test/fixtures/helper_mailer/use_example_helper.erb
@@ -0,0 +1 @@
+So, <%= example_format(@text) %>
diff --git a/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml b/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml
index fcff3bb1b4..e69de29bb2 100644
--- a/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml
+++ b/actionmailer/test/fixtures/helper_mailer/use_example_helper.rhtml
@@ -1 +0,0 @@
-So, <%= example_format(@text) %>
diff --git a/actionmailer/test/fixtures/helper_mailer/use_helper.erb b/actionmailer/test/fixtures/helper_mailer/use_helper.erb
new file mode 100644
index 0000000000..378777f8bb
--- /dev/null
+++ b/actionmailer/test/fixtures/helper_mailer/use_helper.erb
@@ -0,0 +1 @@
+Hello, <%= person_name %>. Thanks for registering!
diff --git a/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml b/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml
index 378777f8bb..e69de29bb2 100644
--- a/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml
+++ b/actionmailer/test/fixtures/helper_mailer/use_helper.rhtml
@@ -1 +0,0 @@
-Hello, <%= person_name %>. Thanks for registering!
diff --git a/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb b/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb
new file mode 100644
index 0000000000..d5b8b285e7
--- /dev/null
+++ b/actionmailer/test/fixtures/helper_mailer/use_helper_method.erb
@@ -0,0 +1 @@
+This message brought to you by <%= name_of_the_mailer_class %>.
diff --git a/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml b/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml
index d5b8b285e7..e69de29bb2 100644
--- a/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml
+++ b/actionmailer/test/fixtures/helper_mailer/use_helper_method.rhtml
@@ -1 +0,0 @@
-This message brought to you by <%= name_of_the_mailer_class %>.
diff --git a/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb b/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb
new file mode 100644
index 0000000000..96ec49d18a
--- /dev/null
+++ b/actionmailer/test/fixtures/helper_mailer/use_mail_helper.erb
@@ -0,0 +1,5 @@
+From "Romeo and Juliet":
+
+<%= block_format @text %>
+
+Good ol' Shakespeare.
diff --git a/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml b/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml
index 96ec49d18a..e69de29bb2 100644
--- a/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml
+++ b/actionmailer/test/fixtures/helper_mailer/use_mail_helper.rhtml
@@ -1,5 +0,0 @@
-From "Romeo and Juliet":
-
-<%= block_format @text %>
-
-Good ol' Shakespeare.
diff --git a/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb
new file mode 100644
index 0000000000..897a5065cf
--- /dev/null
+++ b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.erb
@@ -0,0 +1 @@
+Have a lovely picture, from me. Enjoy! \ No newline at end of file
diff --git a/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
index 897a5065cf..e69de29bb2 100644
--- a/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
+++ b/actionmailer/test/fixtures/path.with.dots/funky_path_mailer/multipart_with_template_path_with_dots.rhtml
@@ -1 +0,0 @@
-Have a lovely picture, from me. Enjoy! \ No newline at end of file
diff --git a/actionmailer/test/fixtures/second_mailer/share.erb b/actionmailer/test/fixtures/second_mailer/share.erb
new file mode 100644
index 0000000000..9a54010672
--- /dev/null
+++ b/actionmailer/test/fixtures/second_mailer/share.erb
@@ -0,0 +1 @@
+second mail
diff --git a/actionmailer/test/fixtures/second_mailer/share.rhtml b/actionmailer/test/fixtures/second_mailer/share.rhtml
index 9a54010672..e69de29bb2 100644
--- a/actionmailer/test/fixtures/second_mailer/share.rhtml
+++ b/actionmailer/test/fixtures/second_mailer/share.rhtml
@@ -1 +0,0 @@
-second mail
diff --git a/actionmailer/test/fixtures/templates/signed_up.erb b/actionmailer/test/fixtures/templates/signed_up.erb
new file mode 100644
index 0000000000..a85d5fa442
--- /dev/null
+++ b/actionmailer/test/fixtures/templates/signed_up.erb
@@ -0,0 +1,3 @@
+Hello there,
+
+Mr. <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/templates/signed_up.rhtml b/actionmailer/test/fixtures/templates/signed_up.rhtml
index a85d5fa442..e69de29bb2 100644
--- a/actionmailer/test/fixtures/templates/signed_up.rhtml
+++ b/actionmailer/test/fixtures/templates/signed_up.rhtml
@@ -1,3 +0,0 @@
-Hello there,
-
-Mr. <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb
new file mode 100644
index 0000000000..6940419d47
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.erb
@@ -0,0 +1 @@
+Ignored when searching for implicitly multipart parts.
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml
index 6940419d47..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.ignored.rhtml
@@ -1 +0,0 @@
-Ignored when searching for implicitly multipart parts.
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb
new file mode 100644
index 0000000000..946d99ede5
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.erb
@@ -0,0 +1,10 @@
+<html>
+ <body>
+ HTML formatted message to <strong><%= @recipient %></strong>.
+ </body>
+</html>
+<html>
+ <body>
+ HTML formatted message to <strong><%= @recipient %></strong>.
+ </body>
+</html>
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml
index 946d99ede5..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.html.rhtml
@@ -1,10 +0,0 @@
-<html>
- <body>
- HTML formatted message to <strong><%= @recipient %></strong>.
- </body>
-</html>
-<html>
- <body>
- HTML formatted message to <strong><%= @recipient %></strong>.
- </body>
-</html>
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb
new file mode 100644
index 0000000000..a6c8d54cf9
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.erb
@@ -0,0 +1,2 @@
+Plain text to <%= @recipient %>.
+Plain text to <%= @recipient %>.
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml
index a6c8d54cf9..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.plain.rhtml
@@ -1,2 +0,0 @@
-Plain text to <%= @recipient %>.
-Plain text to <%= @recipient %>.
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb
new file mode 100644
index 0000000000..c14348c770
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.erb
@@ -0,0 +1 @@
+yaml to: <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml
index c14348c770..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/implicitly_multipart_example.text.yaml.rhtml
@@ -1 +0,0 @@
-yaml to: <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/signed_up.erb b/actionmailer/test/fixtures/test_mailer/signed_up.erb
new file mode 100644
index 0000000000..a85d5fa442
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/signed_up.erb
@@ -0,0 +1,3 @@
+Hello there,
+
+Mr. <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/signed_up.rhtml b/actionmailer/test/fixtures/test_mailer/signed_up.rhtml
index a85d5fa442..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/signed_up.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/signed_up.rhtml
@@ -1,3 +0,0 @@
-Hello there,
-
-Mr. <%= @recipient %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb
new file mode 100644
index 0000000000..e8fb65d4d2
--- /dev/null
+++ b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.erb
@@ -0,0 +1,3 @@
+Hello there,
+
+Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> \ No newline at end of file
diff --git a/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml
index e8fb65d4d2..e69de29bb2 100644
--- a/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml
+++ b/actionmailer/test/fixtures/test_mailer/signed_up_with_url.rhtml
@@ -1,3 +0,0 @@
-Hello there,
-
-Mr. <%= @recipient %>. Please see our greeting at <%= @welcome_url %> \ No newline at end of file