Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

* Updated `emails#show` to conditionally ensure the link to plain tex…

…t email displays when using rails_email_preview in conjunction with premailer-rails3.

* Updated readme to reflect these changes.
  • Loading branch information...
commit df5fdef28387cc876661d412c1be289df44d7082 1 parent f4f6614
@coryschires coryschires authored
View
8 README.md
@@ -73,17 +73,17 @@ To get the url of RailsEmailPreview in your main app you can call rails_email_pr
Premailer integration
---------------------
-[Premailer](https://github.com/alexdunae/premailer) (CSS inlining) integration can be done by using the <code>before_render</code> hook:
+[Premailer](https://github.com/alexdunae/premailer) automatically translates standard CSS rules into old-school inline styles. It will also automatically create plain text emails based on their HTML counterparts. If you're your running Rails 3, I suggest using [premailer-rails3](https://github.com/fphilipe/premailer-rails3) as it requires almost no configuration.
-For example, to process the previews with [ActionMailer Inline CSS](https://github.com/ndbroadbent/actionmailer_inline_css)
-can be done like so:
+Integration can be done by using the <code>before_render</code> hook:
RailsEmailPreview.setup do |config|
config.before_render do |message|
- ActionMailer::InlineCssHook.delivering_email(message)
+ PremailerRails::Hook.delivering_email(message)
end
end
+
Interface
---------
View
2  app/views/rails_email_preview/emails/show.html.haml
@@ -4,7 +4,7 @@
html_url = if @mail.multipart? || @mail.content_type =~ %r(text/html)
rails_email_preview.email_url(params.merge(:part_type => 'text/html'))
end
- plain_url = if @mail.multipart? || @mail.content_type =~ %r(text/plain)
+ plain_url = if @mail.multipart? || @mail.content_type =~ %r(text/plain) || Object.const_defined?('PremailerRails')
rails_email_preview.email_url(params.merge(:part_type => 'text/plain'))
end
Please sign in to comment.
Something went wrong with that request. Please try again.