Skip to content

tzmfreedom/http_action_mailer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

HttpActionMailer

AcitonMailer plugin to send HTTP request for debugging mail contents.

Usage

# config/environments/development.rb
config.action_mailer.delivery_method = :http
config.action_mailer.http_settings = {
  url: 'https://example.com',
  path: '/foo/bar',
  headers: {
    'X-HOGEHOGE-Header' => 'XXXX',
  },
}

Example for POST payload

{
    "from": [
        "from@example.com"
    ],
    "to": [
        "to@example.org"
    ],
    "cc": null,
    "subject": "Hello",
    "text": "User#hello\n\nHi, find me in app/views/user_mailer/hello.text.erb\n\n",
    "html": "<!DOCTYPE html>\n<html>\n  <head>\n    <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n    <style>\n      /* Email styles need to be inline */\n    </style>\n  </head>\n\n  <body>\n    <h1>User#hello</h1>\n\n<p>\n  Hi, find me in app/views/user_mailer/hello.html.erb\n</p>\n\n  </body>\n</html>\n"
}

Installation

Add this line to your application's Gemfile:

gem 'http_action_mailer'

And then execute:

$ bundle

Or install it yourself as:

$ gem install http_action_mailer

Contributing

Contribution directions go here.

License

The gem is available as open source under the terms of the MIT License.