All Projects → dblock → actionmailer-text

dblock / actionmailer-text

Licence: MIT License
Automatically insert a text/plain part into your HTML multipart e-mails.

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects

ActionMailer::Text

Build Status Gem Version

Automatically insert a text/plain part into your HTML multipart e-mails.

Installation

gem 'actionmailer-text'

Usage

class WelcomeMailer < ActionMailer::Base
  include ActionMailer::Text

  default from: '[email protected]'

  def welcome(user)
    @user = user
    mail(to: @user.email, subject: 'Welcome!') do |format|
      format.html { render 'welcome' }
    end
  end
end

Details

The MIME standard allows systems to send e-mail with multiple parts: plain/text for business-efficient devices such as the Blackberry, and text/html for web-based e-mail readers, such as GMail. Furthermore, ActionMailer supports multiple template formats: create an .html.haml template along with a .txt.haml template to generate both. We also know that text/plain email helps deliverability, but we believe a disproportionately small amount of text e-mails are actually read - the vast majority of devices are capable of parsing some HTML. This gem lets you get the text/plain part for free.

See this blog post for details.

Contributing

See CONTRIBUTING.

Copyright and License

Copyright (c) 2015, Daniel Doubrovkine, Artsy and Contributors.

This project is licensed under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].