diff options
-rw-r--r-- | actionmailer/CHANGELOG | 5 | ||||
-rw-r--r-- | actionmailer/lib/action_mailer/base.rb | 17 |
2 files changed, 13 insertions, 9 deletions
diff --git a/actionmailer/CHANGELOG b/actionmailer/CHANGELOG index 7a1c1c664c..d2b27bf029 100644 --- a/actionmailer/CHANGELOG +++ b/actionmailer/CHANGELOG @@ -1,3 +1,8 @@ +*SVN* + +* Allow Mailers to have custom initialize methods that set default instance variables for all mail actions #2563 [mrj@bigpond.net.au] + + *1.1.2* (October 26th, 2005) * Upgraded to Action Pack 1.10.2 diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index a77f9ce018..aa1fb648a0 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -337,15 +337,14 @@ module ActionMailer # mailer. Subclasses may override this method to provide different # defaults. def initialize_defaults(method_name) - @bcc = @cc = @from = @recipients = @sent_on = @subject = nil - @charset = @@default_charset.dup - @content_type = @@default_content_type.dup - @implicit_parts_order = @@default_implicit_parts_order.dup - @template = method_name - @mailer_name = Inflector.underscore(self.class.name) - @parts = [] - @headers = {} - @body = {} + @charset ||= @@default_charset.dup + @content_type ||= @@default_content_type.dup + @implicit_parts_order ||= @@default_implicit_parts_order.dup + @template ||= method_name + @mailer_name ||= Inflector.underscore(self.class.name) + @parts ||= [] + @headers ||= {} + @body ||= {} @mime_version = @@default_mime_version.dup if @@default_mime_version end |