default_i18n_subject

default_i18n_subject(interpolations = {}) Instance Protected methods Translates the subject using Rails I18n class under [mailer_scope, action_name] scope. If it does not find a translation for the subject under the specified scope it will default to a humanized version of the action_name. If the subject has interpolations, you can pass them through the interpolations parameter.

mailer_name 2

mailer_name() Instance Public methods Returns the name of the mailer object.

mail

mail(headers = {}, &block) Instance Public methods The main method that creates the message and renders the email templates. There are two ways to call this method, with a block, or without a block. 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 [mailer_scope,

headers

headers(args = nil) Instance Public methods 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: headers 'X-Special-Domain-Specific-Header' => "SecretValue", 'In-Reply-To' => incoming.message_id The resulting Mail::Message will ha

attachments

attachments() Instance Public methods Allows you to add attachments to an email, like so: mail.attachments['filename.jpg'] = File.read('/path/to/filename.jpg') If you do this, then Mail will take the file name and work out the mime type set the Content-Type, Content-Disposition, Content-Transfer-Encoding and base64 encode the contents of the attachment all for you. You can also specify overrides if you want by passing a hash instead of a string: mail.attachments['filename.jpg'] =

register_observers

register_observers(*observers) Class Public methods Register one or more Observers which will be notified when mail is delivered.

register_observer

register_observer(observer) Class Public methods Register an Observer which will be notified when mail is delivered. Either a class, string or symbol can be passed in as the Observer. If a string or symbol is passed in it will be camelized and constantized.

register_interceptors

register_interceptors(*interceptors) Class Public methods Register one or more Interceptors which will be called before mail is sent.

register_interceptor

register_interceptor(interceptor) Class Public methods Register an Interceptor which will be called before mail is sent. Either a class, string or symbol can be passed in as the Interceptor. If a string or symbol is passed in it will be camelized and constantized.

receive

receive(raw_mail) Class Public methods 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: class MyMailer < ActionMailer::Base def receive(mail) # ... end end