提交 95e8740f 编写于 作者: D David Heinemeier Hansson

Allow Mailers to have custom initialize methods that set default instance...

Allow Mailers to have custom initialize methods that set default instance variables for all mail actions (closes #2563) [mrj@bigpond.net.au]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2742 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 dd257a3c
*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
......
......@@ -337,15 +337,14 @@ def deliver!(mail = @mail)
# 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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册