Test ActionMailer view rendering

21 Aug 2012

You can force ActionMailer to write an email into a file by:

  • In your environment file, add `config.action_mailer.delivery_method = :file`.
  • Or at anywhere, add `ActionMailer::Base.delivery_method = :file`.

It will be written under `tmp/mails`.

Here are other delivery_methods: `smtp, ``sendmail`, andtest``.

Please note that `sendmailuses the ``/usr/sbin/sendmail``` command.

As things might change, you can see all the delivery methods in the source code of `actionmailergem; It is in ``lib/action_mailer/delivery_method.rb```.

Give it a kudos