Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

actionmailer_extensions

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

actionmailer_extensions

  • 0.5.3
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= actionmailer_extensions

These extensions wrap around the "deliver!" method on ActionMailer::Base to provide:

  • save all outgoing emails to disk, and
  • a list of recipient email addresses that are safe to receive mail. All other mail is not sent.

Note - only tested up to and including ActionMailer 2.3.8. Not tested on 3.0.

== Saving email to disk

Sending email with markup from a web app is a pain in the ass because HTML markup renders differently in every email client. (If you don't believe me, check out this {matrix of CSS support across the different email clients}[http://www.campaignmonitor.com/css/?utm_medium=email&utm_source=Email%20marketing%20software&utm_content=299578507&utm_campaign=September+News+-+Version+A+_+khihur&utm_term=AllnewCSSguidecovering24emailclients].

The only foolproof way to ensure that your content is rendering properly is to visually inspect the emails yourself. To get going, configure ActionMailer like so:

require 'actionmailer_extensions' ActionMailer::Base.save_emails_to_disk = true # Defaults to false ActionMailer::Base.email_output_dir = "some/path" # Defaults to "/tmp/actionmailer_output_emails"

Then send some emails with ActionMailer, and inspect the files in the output path that you specified. The emails are saved with a .eml extension which should open in your favourite email client for easy visual inspection.

== Safe recipients list

Ever found that you want to limit the list of people that can receive email from a Rails app? This is a particularly handy feature during development when you don't want your (unfinished) application to send out real mail to people beyond the dev team.

Configure ActionMailer like so:

require 'actionmailer_extensions' ActionMailer::Base.safe_recipients = ["pete@example.com", "dave@foo.com"]

Pete and Dave are now the only recipients that ActionMailer will send to, and all other mail will be quietly dropped. (And logged to disk, if save_emails_to_disk is enabled.)

Make sure that the recipients list contains the :any symbol in production mode.

ActionMailer::Base.safe_recipients = [:any]

This is enabled by default. Also note that an empty or nil recipients list means no mail will be sent out to anyone.

== Install

gem source --add http://gemcutter.org gem install actionmailer_extensions

== Note on Patches/Pull Requests

  • Fork the project.
  • Make your feature addition or bug fix.
  • Add tests for it. This is important so I don't break it in a future version unintentionally.
  • Commit, do not mess with rakefile, version, or history. (if you want to have your own version, that is fine but bump version in a commit by itself I can ignore when I pull)
  • Send me a pull request. Bonus points for topic branches.

== Copyright

Copyright (c) 2010 Peter MacRobert. See LICENSE for details.

FAQs

Package last updated on 26 Mar 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc