Action Mailer In Action

4,582 views

Published on

A talk about using ActionMailer safely, how to keep out of the spam box and how to test your emails before your customers see them.

Published in: Technology, Business
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
4,582
On SlideShare
0
From Embeds
0
Number of Embeds
74
Actions
Shares
0
Downloads
80
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Action Mailer In Action

  1. 1. ActionMailer in Action <ul><li>Rob Kaufman </li></ul><ul><li>Notch8.com </li></ul><ul><li>[email_address] </li></ul><ul><li>Talk about ActionMailer </li></ul><ul><ul><li>Beyond just send a message via SMTP </li></ul></ul>
  2. 2. Intro to ActionMailer (Send) <ul><li>ActionMailer allows you to send and receive email. Most people just use send </li></ul><ul><li>ActionMailer is more MV than MVC </li></ul><ul><li>AM model in /app/model </li></ul><ul><ul><li>inherets from ActionMailer::Base instead of ActionRecord::Base </li></ul></ul><ul><li>AM views are stored in /app/views/model_name </li></ul><ul><li>Plain text vs HTML email </li></ul>
  3. 3. Safety First - Overview <ul><li>IDs in email </li></ul><ul><li>Careful about 'real' email addresses in development env </li></ul><ul><li>Careful about a lot of email </li></ul><ul><li>Understand limits of email via own server </li></ul>
  4. 4. Safety First - Checklist <ul><li>Before Committing </li></ul><ul><ul><li>Create new email tagging </li></ul></ul><ul><ul><li>Create new NotifierTest method </li></ul></ul><ul><ul><li>Create new Notifier method </li></ul></ul><ul><ul><li>Create new Notifier view </li></ul></ul><ul><ul><li>Verify that email body includes a link at the bottom to unsubscribe </li></ul></ul>
  5. 5. Safety First - Checklist <ul><li>Before Commiting (cont.) </li></ul><ul><ul><li>Verify that the email contains the lead id </li></ul></ul><ul><ul><li>Verify that the email bodies fields are all correctly formated </li></ul></ul><ul><ul><li>Verify mime-type if sending HTML email </li></ul></ul><ul><ul><li>Test, Commit, Push </li></ul></ul><ul><ul><li>Bootstrap </li></ul></ul>
  6. 6. Safety First - Checklist <ul><li>Before Sending </li></ul><ul><ul><li>Send sample copy to Design (currently Andy) and Marketing (Casey and Carrie) </li></ul></ul><ul><ul><li>Send sample to at least 2 individuals (besides author) to look for typos/errors </li></ul></ul><ul><ul><li>Run RAILS_ENV=production rake email:check EMAIL_TEMPLATE=’template_name’ to verify Inbox delivery </li></ul></ul>
  7. 7. Safety First - mail_safety <ul><li>Overrides Tmail::Mail.deliveries so that everything is sent where you want it. </li></ul><ul><li>Can be used w/ either sendmail or smtp </li></ul>
  8. 8. Setting up Email Testing
  9. 9. Testing - Assert Email
  10. 10. Testing - Email Test Task <ul><li>Hits the big 4 (Hotmail, AOL, Yahoo, Gmail) </li></ul><ul><li>Can be used just to send the templates </li></ul><ul><li>If freepopd is installed, can check that the emails where received as well </li></ul>
  11. 11. Testing - Email Test Task <ul><li>rake email:send </li></ul><ul><ul><li>Sends all templates </li></ul></ul><ul><li>rake email:send EMAIL_TEMPLATE=hello </li></ul><ul><ul><li>Just sends the hello email </li></ul></ul><ul><li>rake email:accounts:check </li></ul><ul><ul><li>Sends all , waits for you, then checks all </li></ul></ul><ul><li>rake email:accounts:clear </li></ul><ul><ul><li>Removes all emails (cleans accounts) </li></ul></ul><ul><li>rake email: accounts:count_messages </li></ul>
  12. 12. Summary and Questions

×