Home
Ruby on Rails
Cheatsheets
|
recipients = [array] or "string" |
A string containing the email of address of the recipient, or an array of strings containing email addresses of multiple recipients. Will use the email's |
|
sent_on = Time object |
A |
|
subject = "string" |
The subject line to be used to set the email's |
|
from = [array] or "string" |
A string containing the email address to appear on the |
|
body = {hash} |
The body method sets instance variables to be available in the view template. For example, to make the variables order and name accessible as body :order => order, :name => name |
|
attachment = {hash} or block |
Enables you to add attachments to your email message. attachment :content_type => "image/jpeg", :body => File.read("an-image.jpg") attachment "application/pdf" do |a| a.body = generate_your_pdf_here() end |
|
bcc = [array] or "string" |
Blind carbon copy recipients in the same format as |
|
*cc* = [array] or "string" |
Carbon copy recipients in the same format as |
|
content_type = "string" |
Set the content type of the message. Defaults to |
|
headers = {hash} |
A hash containing name/value pairs to be converted into abitrary header lines. For example... headers "X-Mail-Count" => 107370 |
|
mime_version = "string" |
The mime version for the message. Defaults to |
|
charset = "string" |
The charset for the body and to encode the subject. Defaults to |
|
implicit_parts_order = [array] |
When an email is built implicitly, this variable controls how the parts are ordered. Defaults to |