Skip to content

Automatically generate a text part for your HTML emails in Rails.

License

Notifications You must be signed in to change notification settings

lucaspiller/plain-david

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plain David

Plain David automatically generates a text part for your HTML emails.

Install

Add the gem to Rails' Gemfile

gem 'plain-david'

Usage

Nothing. Just send emails as normal, and a text part will be automatically generated. The email will be changed from HTML to multipart like magic!

It works seamlessly with css inliners like Roadie.

Works with Rails 3, 4 and 5.

Conversion Strategies

You can set your own conversion strategy. The default MarkdownStrategy converts the HTML to Markdown. If you want to use your own you just need to set the strategy option.

For example, in your application.rb:

class AwesomeStrategy
  attr_accessor :html

  def initialize(html)
    @html = html
  end

  def convert!
    @html.awesomize!
  end
end

config.plain_david.strategy = AwesomeStrategy

Contributing

  • Fork the project.
  • Make your feature addition or bug fix.
  • Send me a pull request. Bonus points for topic branches.

License

MIT License. See LICENSE for details.

Copyright

Copyright (c) 2013-2016 Luca Spiller.

About

Automatically generate a text part for your HTML emails in Rails.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages