0.0
No commit activity in last 3 years
No release in over 3 years
Escape the name in To and From fields in emails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 0

Runtime

 Project Readme

SafeEmailName

Format the "From" and "To" fields in emails, correctly escaped.

Future

This has been merged into Rails as email_address_with_name.

Usage

gem 'safe_email_name'

Call bundle, then, in your Rails app you can use it like this:

class UserMailer < ActionMailer::Base
  include SafeEmailName

  default from: safe_email_name('Example Corp', 'hello@example.com')

  def contact(user)
    mail to: safe_email_name(user.name, user.email)
  end
def

Tests

bundle exec rspec

Release

Update the version number in the gemspec, then:

gem build safe_email_name.gemspec
gem push safe_email_name-*.gem