Skip to content
This repository has been archived by the owner on May 10, 2018. It is now read-only.

Commit

Permalink
Parse the address using the mail gem.
Browse files Browse the repository at this point in the history
  • Loading branch information
aeden committed Apr 17, 2012
1 parent 7d05545 commit b7eba48
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ gem 'sinatra'
gem 'multi_json', '~> 1.3.2'
gem 'hashie'
gem 'httparty'
gem 'mail'
11 changes: 11 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@ GEM
httparty (0.8.2)
multi_json
multi_xml
i18n (0.6.0)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.18)
multi_json (1.3.2)
multi_xml (0.4.4)
polyglot (0.3.3)
rack (1.4.1)
rack-protection (1.2.0)
rack
Expand All @@ -15,12 +22,16 @@ GEM
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
tilt (1.3.3)
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)

PLATFORMS
ruby

DEPENDENCIES
hashie
httparty
mail
multi_json (~> 1.3.2)
sinatra
3 changes: 2 additions & 1 deletion app.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require 'sinatra'
require 'hashie'
require 'multi_json'
require 'mail'
require './intercom'

get '/' do
Expand All @@ -10,7 +11,7 @@
post '/:appid/messages' do
if params[:appid] == 'dnsimple'
message = Hashie::Mash.new(
:from => params[:"from"],
:from => Mail::Address.new(params[:"from"]).address,
:subject => params[:"subject"],
:body => params[:"stripped-text"]
)
Expand Down

0 comments on commit b7eba48

Please sign in to comment.