ruby script/generate mailer customermailer
models/customer_mail.rb:
class CustomerMailer < ActionMailer::Base
def welcome_message(sent_at = Time.now)
@subject = 'CustomerMailer#welcome_message'
@body = {}
@recipients = ''
@from = ''
@sent_on = sent_at
@headers = {}
@body["email"] = ''
end
end
views/customer_mailer/welcome_message.html.erb
This will be your email message
and now send it with this:
customer_mail = CustomerMailer.create_welcome_message
CustomerMailer.deliver(customer_mail)
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---