Commit a986f463 by tady

compose html mail

parent b9a53535
......@@ -82,3 +82,7 @@ gem 'rack-mini-profiler'
# ref. https://github.com/popgiro/action-gmailer
gem 'mail'
gem 'action-gmailer', github: 'popgiro/action-gmailer'
# compose html mail
gem 'nokogiri'
gem 'premailer'
......@@ -41,6 +41,7 @@ GEM
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
addressable (2.3.5)
ancestry (2.0.0)
activerecord (>= 3.0.0)
arel (4.0.1)
......@@ -60,6 +61,8 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.6.3)
css_parser (1.3.5)
addressable
daemons (1.1.9)
debug_inspector (0.0.2)
devise (3.2.2)
......@@ -77,6 +80,7 @@ GEM
oauth (>= 0.3.6)
hashie (2.0.5)
hike (1.2.3)
htmlentities (4.3.1)
httpauth (0.2.0)
i18n (0.6.9)
jbuilder (1.5.3)
......@@ -89,9 +93,12 @@ GEM
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.25.1)
mini_portile (0.5.2)
minitest (4.7.5)
multi_json (1.8.2)
multipart-post (1.2.0)
nokogiri (1.6.1)
mini_portile (~> 0.5.0)
oauth (0.4.7)
oauth2 (0.8.1)
faraday (~> 0.8)
......@@ -111,6 +118,9 @@ GEM
orm_adapter (0.5.0)
pg (0.17.0)
polyglot (0.3.3)
premailer (1.7.9)
css_parser (>= 1.1.9)
htmlentities (>= 4.0.0)
rack (1.5.2)
rack-mini-profiler (0.1.31)
rack (>= 1.1.3)
......@@ -186,8 +196,10 @@ DEPENDENCIES
devise
jbuilder (~> 1.2)
mail
nokogiri
omniauth-google-oauth2
pg
premailer
rack-mini-profiler
rails (~> 4.0.2)
rails_12factor
......
......@@ -7,6 +7,7 @@ class PostsController < ApplicationController
before_action :require_login, except: [:index]
include ApplicationHelper
include RV::Mailer
# GET /posts
# GET /posts.json
......@@ -55,9 +56,7 @@ class PostsController < ApplicationController
def mail
@post = set_post
subject = @post.title
body = @post.body
RV::Mailer.compose_mail(subject, body, current_user).deliver
compose_mail(@post, current_user).deliver
redirect_to root_path(id: @post.id)
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment