Skip to content

KissKissBankBank/safe_email_name

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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', '[email protected]')

  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

About

Ruby gem to escape the name in To and From fields in emails

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages