Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Transparently generate and cache versions of html emails sent with ActionMailer for "View Online" links.
Ruby
Branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
tasks
test
.gitignore
MIT-LICENSE
README
Rakefile
VERSION
has_web_fallback.gemspec
init.rb

README

HasWebFallback
=============

Extracts the common behaviour of wanting online versions of html emails.

If a mailer function is described as has_web_fallback two things will happen.

1.  The template will get access to an @web_fallback_url, a url (relative to /) to the web version of the email
2.  After sending, if the email has an html part, that part will be written out to the public directory.

Future Features
===============
Customizable urls/paths

Installation
============
Right now, HasWebFallback requires UUIDTools to generate the names for the emails.
config.gem 'uuidtools'


Example
=======

class ExampleMailer < ActionMailer::Base

	has_web_fallback :welcome, :keep_for=>7.days
	has_web_fallback :goodbye, :keep_for=>10.minutes

	def welcome
		#
	end

	def goodbye
		#
	end
end 

... and in the template

<%= link_to("View this email online", APPLICATION_URL+@web_fallback_url) %>


Copyright (c) 2009 Gavin Montague, released under the MIT license
Something went wrong with that request. Please try again.