From bbcc2126c6a8b8ae368108889f753178f110864c Mon Sep 17 00:00:00 2001 From: Waynn Lue Date: Mon, 15 Apr 2013 16:35:25 -0700 Subject: took out unnecessary wordage, changed "number" to "amount" --- actionmailer/README.rdoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/README.rdoc b/actionmailer/README.rdoc index 4d78d6142a..ffd2217d58 100644 --- a/actionmailer/README.rdoc +++ b/actionmailer/README.rdoc @@ -119,8 +119,7 @@ trivial case like this: rails runner 'Mailman.receive(STDIN.read)' However, invoking Rails in the runner for each mail to be received is very resource intensive. A single -instance of Rails should be run within a daemon, if it is going to be utilized to process more than just -a limited number of email. +instance of Rails should be run within a daemon, if it is going to process more than just a limited amount of email. == Configuration -- cgit v1.2.3 From 98ed2d43c4fb49bf1a45e4f3ddd2502bac5b1caf Mon Sep 17 00:00:00 2001 From: Alexey Vakhov Date: Mon, 22 Apr 2013 12:54:16 +0400 Subject: Make AM readme example more consistent At 4a6eba32 mail sending example was rewrited from rails 2 format to modern rails 3 approach. But passing parameter `recipient` to method Notifier#welcome was lost. Passing email as parameter makes this example more solid. --- actionmailer/README.rdoc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/README.rdoc b/actionmailer/README.rdoc index ffd2217d58..a14a6ba18f 100644 --- a/actionmailer/README.rdoc +++ b/actionmailer/README.rdoc @@ -67,12 +67,12 @@ simply call the method and optionally call +deliver+ on the return value. Calling the method returns a Mail Message object: - message = Notifier.welcome # => Returns a Mail::Message object - message.deliver # => delivers the email + message = Notifier.welcome("david@loudthinking.com") # => Returns a Mail::Message object + message.deliver # => delivers the email Or you can just chain the methods together like: - Notifier.welcome.deliver # Creates the email and sends it immediately + Notifier.welcome("david@loudthinking.com").deliver # Creates the email and sends it immediately == Setting defaults -- cgit v1.2.3 From a145c1b4afb880f077a1811c3aec29d40bbcad81 Mon Sep 17 00:00:00 2001 From: Alexey Vakhov Date: Tue, 23 Apr 2013 10:05:09 +0400 Subject: Cosmetic fixes in AM::Base docs. Missed spaces in OpenSSL constants enumerations. Injected at a1639ad. --- actionmailer/lib/action_mailer/base.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index ff74185e37..351c14be7d 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -334,8 +334,8 @@ module ActionMailer # and starts to use it. # * :openssl_verify_mode - When using TLS, you can set how OpenSSL checks the certificate. This is # really useful if you need to validate a self-signed and/or a wildcard certificate. You can use the name - # of an OpenSSL verify constant ('none', 'peer', 'client_once','fail_if_no_peer_cert') or directly the - # constant (OpenSSL::SSL::VERIFY_NONE, OpenSSL::SSL::VERIFY_PEER,...). + # of an OpenSSL verify constant ('none', 'peer', 'client_once', 'fail_if_no_peer_cert') or directly the + # constant (OpenSSL::SSL::VERIFY_NONE, OpenSSL::SSL::VERIFY_PEER, ...). # # * sendmail_settings - Allows you to override options for the :sendmail delivery method. # * :location - The location of the sendmail executable. Defaults to /usr/sbin/sendmail. -- cgit v1.2.3 From e1df81c2050fee6758eaad073bc56795cfc9f467 Mon Sep 17 00:00:00 2001 From: Alexey Vakhov Date: Tue, 23 Apr 2013 10:30:31 +0400 Subject: Remove superfluous `self.` in Action Mailer mail method documetation Notation with `self` was sugestted at 0b05acd, when self.defaults was extlib_inheritable_accessor. But now all Action Mailer examples are without this self. It's nicer. --- actionmailer/lib/action_mailer/base.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 351c14be7d..1fff958ceb 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -596,9 +596,9 @@ module ActionMailer # class method: # # class Notifier < ActionMailer::Base - # self.default from: 'no-reply@test.lindsaar.net', - # bcc: 'email_logger@test.lindsaar.net', - # reply_to: 'bounces@test.lindsaar.net' + # default from: 'no-reply@test.lindsaar.net', + # bcc: 'email_logger@test.lindsaar.net', + # reply_to: 'bounces@test.lindsaar.net' # end # # If you need other headers not listed above, you can either pass them in -- cgit v1.2.3 From 58533dc9bd8736c28b5ad8286e57b02f45939621 Mon Sep 17 00:00:00 2001 From: Prem Sichanugrist Date: Fri, 3 May 2013 13:33:10 -0400 Subject: Add some documentation for AM.mailer_name --- actionmailer/lib/action_mailer/base.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 1fff958ceb..91b03f28de 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -412,6 +412,8 @@ module ActionMailer Mail.register_interceptor(delivery_interceptor) end + # Returns the name of current mailer. This method also being used as a path for a view lookup. + # If this is an anonymous mailer, this method will return +anonymous+ instead. def mailer_name @mailer_name ||= anonymous? ? "anonymous" : name.underscore end -- cgit v1.2.3 From b245287bc535933e7b0b095ca84d313dfd676eab Mon Sep 17 00:00:00 2001 From: Hendy Tanata Date: Mon, 6 May 2013 17:02:29 -0700 Subject: Fix grammar on AM.mailer_name documentation. --- actionmailer/lib/action_mailer/base.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index 91b03f28de..fa015d9108 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -412,7 +412,7 @@ module ActionMailer Mail.register_interceptor(delivery_interceptor) end - # Returns the name of current mailer. This method also being used as a path for a view lookup. + # Returns the name of current mailer. This method is also being used as a path for a view lookup. # If this is an anonymous mailer, this method will return +anonymous+ instead. def mailer_name @mailer_name ||= anonymous? ? "anonymous" : name.underscore -- cgit v1.2.3 From 0d7daf24dfa8454ae0e6bd75dac96e36bc608b27 Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Fri, 10 May 2013 00:07:20 -0400 Subject: Document ActionMailer::Base::default, ::mailer_name, and #mailer_name --- actionmailer/lib/action_mailer/base.rb | 39 ++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 14 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index fa015d9108..fe04a19f9e 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -398,7 +398,7 @@ module ActionMailer # Register an Observer which will be notified when mail is delivered. # Either a class or a string can be passed in as the Observer. If a string is passed in - # it will be constantized. + # it will be +constantize+d. def register_observer(observer) delivery_observer = (observer.is_a?(String) ? observer.constantize : observer) Mail.register_observer(delivery_observer) @@ -417,9 +417,15 @@ module ActionMailer def mailer_name @mailer_name ||= anonymous? ? "anonymous" : name.underscore end + # Allows to set the name of current mailer. attr_writer :mailer_name alias :controller_path :mailer_name + # Sets the defaults through app configuration: + # + # config.action_mailer.default { from: "no-reply@example.org" } + # + # Aliased by ::default_options= def default(value = nil) self.default_params = default_params.merge(value).freeze if value default_params @@ -431,13 +437,15 @@ module ActionMailer # Receives a raw email, parses it into an email object, decodes it, # instantiates a new mailer, and passes the email object to the mailer - # object's +receive+ method. If you want your mailer to be able to - # process incoming messages, you'll need to implement a +receive+ - # method that accepts the raw email string as a parameter: + # object's +receive+ method. + # + # If you want your mailer to be able to process incoming messages, you'll + # need to implement a +receive+ method that accepts the raw email string + # as a parameter: # # class MyMailer < ActionMailer::Base # def receive(mail) - # ... + # # ... # end # end def receive(raw_mail) @@ -448,10 +456,12 @@ module ActionMailer end end - # Wraps an email delivery inside of Active Support Notifications instrumentation. This - # method is actually called by the Mail::Message object itself through a callback - # when you call :deliver on the Mail::Message, calling +deliver_mail+ directly - # and passing a Mail::Message will do nothing except tell the logger you sent the email. + # Wraps an email delivery inside of ActiveSupport::Notifications instrumentation. + # + # This method is actually called by the Mail::Message object itself + # through a callback when you call +:deliver+ on the Mail::Message, + # calling +deliver_mail+ directly and passing a Mail::Message will do + # nothing except tell the logger you sent the email. def deliver_mail(mail) #:nodoc: ActiveSupport::Notifications.instrument("deliver.action_mailer") do |payload| set_payload_for_mail(payload, mail) @@ -477,7 +487,7 @@ module ActionMailer payload[:mail] = mail.encoded end - def method_missing(method_name, *args) + def method_missing(method_name, *args) # :nodoc: if respond_to?(method_name) new(method_name, *args).message else @@ -514,17 +524,18 @@ module ActionMailer end end + # Returns the name of the mailer object. def mailer_name self.class.mailer_name end - # Allows you to pass random and unusual headers to the new Mail::Message object - # which will add them to itself. + # Allows you to pass random and unusual headers to the new Mail::Message + # object which will add them to itself. # # headers['X-Special-Domain-Specific-Header'] = "SecretValue" # - # You can also pass a hash into headers of header field names and values, which - # will then be set on the Mail::Message object: + # You can also pass a hash into headers of header field names and values, + # which will then be set on the Mail::Message object: # # headers 'X-Special-Domain-Specific-Header' => "SecretValue", # 'In-Reply-To' => incoming.message_id -- cgit v1.2.3 From f65f4fa538724563ac7c69849fc43d471cd740af Mon Sep 17 00:00:00 2001 From: Zachary Scott Date: Fri, 10 May 2013 00:20:20 -0400 Subject: RDoc style for ActionMailer::Base#mail --- actionmailer/lib/action_mailer/base.rb | 48 ++++++++++++++++++---------------- 1 file changed, 25 insertions(+), 23 deletions(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/base.rb b/actionmailer/lib/action_mailer/base.rb index fe04a19f9e..d2e01cfd4c 100644 --- a/actionmailer/lib/action_mailer/base.rb +++ b/actionmailer/lib/action_mailer/base.rb @@ -591,22 +591,22 @@ module ActionMailer # Both methods accept a headers hash. This hash allows you to specify the most used headers # in an email message, these are: # - # * :subject - The subject of the message, if this is omitted, Action Mailer will - # ask the Rails I18n class for a translated :subject in the scope of + # * +:subject+ - The subject of the message, if this is omitted, Action Mailer will + # ask the Rails I18n class for a translated +:subject+ in the scope of # [mailer_scope, action_name] or if this is missing, will translate the - # humanized version of the action_name - # * :to - Who the message is destined for, can be a string of addresses, or an array + # humanized version of the +action_name+ + # * +:to+ - Who the message is destined for, can be a string of addresses, or an array # of addresses. - # * :from - Who the message is from - # * :cc - Who you would like to Carbon-Copy on this email, can be a string of addresses, + # * +:from+ - Who the message is from + # * +:cc+ - Who you would like to Carbon-Copy on this email, can be a string of addresses, # or an array of addresses. - # * :bcc - Who you would like to Blind-Carbon-Copy on this email, can be a string of + # * +:bcc+ - Who you would like to Blind-Carbon-Copy on this email, can be a string of # addresses, or an array of addresses. - # * :reply_to - Who to set the Reply-To header of the email to. - # * :date - The date to say the email was sent on. + # * +:reply_to+ - Who to set the Reply-To header of the email to. + # * +:date+ - The date to say the email was sent on. # - # You can set default values for any of the above headers (except :date) by using the default - # class method: + # You can set default values for any of the above headers (except +:date+) + # by using the ::default class method: # # class Notifier < ActionMailer::Base # default from: 'no-reply@test.lindsaar.net', @@ -618,17 +618,19 @@ module ActionMailer # as part of the headers hash or use the headers['name'] = value # method. # - # When a :return_path is specified as header, that value will be used as the 'envelope from' - # address for the Mail message. Setting this is useful when you want delivery notifications - # sent to a different address than the one in :from. Mail will actually use the - # :return_path in preference to the :sender in preference to the :from - # field for the 'envelope from' value. + # When a +:return_path+ is specified as header, that value will be used as + # the 'envelope from' address for the Mail message. Setting this is useful + # when you want delivery notifications sent to a different address than the + # one in +:from+. Mail will actually use the +:return_path+ in preference + # to the +:sender+ in preference to the +:from+ field for the 'envelope + # from' value. # - # If you do not pass a block to the +mail+ method, it will find all templates in the - # view paths using by default the mailer name and the method name that it is being - # called from, it will then create parts for each of these templates intelligently, - # making educated guesses on correct content type and sequence, and return a fully - # prepared Mail::Message ready to call :deliver on to send. + # If you do not pass a block to the +mail+ method, it will find all + # templates in the view paths using by default the mailer name and the + # method name that it is being called from, it will then create parts for + # each of these templates intelligently, making educated guesses on correct + # content type and sequence, and return a fully prepared Mail::Message + # ready to call +:deliver+ on to send. # # For example: # @@ -663,8 +665,8 @@ module ActionMailer # format.html { render text: "

Hello Mikel!

" } # end # - # Which will render a multipart/alternative email with text/plain and - # text/html parts. + # Which will render a +multipart/alternative+ email with +text/plain+ and + # +text/html+ parts. # # The block syntax also allows you to customize the part headers if desired: # -- cgit v1.2.3 From 1ed6ff1006fb5fd816b8b0267754b3113828e918 Mon Sep 17 00:00:00 2001 From: Vipul A M Date: Mon, 13 May 2013 09:20:19 +0530 Subject: Extract variable out of loop --- actionmailer/lib/action_mailer/mail_helper.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'actionmailer') diff --git a/actionmailer/lib/action_mailer/mail_helper.rb b/actionmailer/lib/action_mailer/mail_helper.rb index ec84256491..d63d3b94a5 100644 --- a/actionmailer/lib/action_mailer/mail_helper.rb +++ b/actionmailer/lib/action_mailer/mail_helper.rb @@ -46,8 +46,9 @@ module ActionMailer end end + indentation = " " * indent sentences.map { |sentence| - "#{" " * indent}#{sentence.join(' ')}" + "#{indentation}#{sentence.join(' ')}" }.join "\n" end end -- cgit v1.2.3 From e100d1e489a9d88e86510fcc8f1bdfe0fb54f6a7 Mon Sep 17 00:00:00 2001 From: Mikel Lindsaar Date: Tue, 14 May 2013 15:00:44 +1000 Subject: Update mail to minimum version 2.5.4 --- actionmailer/actionmailer.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionmailer') diff --git a/actionmailer/actionmailer.gemspec b/actionmailer/actionmailer.gemspec index 67ec0d1097..c56b6979ef 100644 --- a/actionmailer/actionmailer.gemspec +++ b/actionmailer/actionmailer.gemspec @@ -21,5 +21,5 @@ Gem::Specification.new do |s| s.add_dependency 'actionpack', version - s.add_dependency 'mail', '~> 2.5.3' + s.add_dependency 'mail', '~> 2.5.4' end -- cgit v1.2.3