Skip to content
This repository has been archived by the owner on Jul 16, 2020. It is now read-only.

Commit

Permalink
Merge pull request #6 from verticalbrands/log-yesmail-api-call
Browse files Browse the repository at this point in the history
added log message when API call is sent to Yesmail
  • Loading branch information
Jon Snitow committed Jan 2, 2013
2 parents f12099c + 6e272cb commit f751e5d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Gemfile
@@ -1,4 +1,6 @@
source "http://rubygems.org"

gem 'log_mixin', :git => 'https://github.com/verticalbrands/log_mixin.git'

# Specify your gem's dependencies in yesmail.gemspec
gemspec
5 changes: 5 additions & 0 deletions lib/yesmail/subscriber.rb
Expand Up @@ -18,6 +18,8 @@
require 'json'
module Yesmail
class Subscriber
include LogMixin

# @attribute email [String] The email that will receive a Yesmail email
# @attribute name [String] The name of the user
# @attribute attribute_data [Hash] used for any extra data in the user
Expand Down Expand Up @@ -130,6 +132,9 @@ def api_create_and_send(master, side_table = nil)
data[:sideTable] = side_table.payload_hash unless side_table.nil?

path = '/composite/subscribeAndSend'
email = data[:subscriber][:attributes][:attributes][:email]
master_id = master.subscriber_message_data[:masterId]
info("Yesmail: subscribeAndSend #{email} to master #{master_id}")
handler.post(data, path)
end
end
Expand Down
1 change: 1 addition & 0 deletions yesmail.gemspec
Expand Up @@ -22,6 +22,7 @@ Gem::Specification.new do |s|
# s.add_development_dependency "rspec"
# s.add_runtime_dependency "rest-client"
s.add_dependency 'httparty'
s.add_dependency 'log_mixin'
s.add_development_dependency 'rspec'
s.add_development_dependency 'rr'
s.add_development_dependency 'faker'
Expand Down

0 comments on commit f751e5d

Please sign in to comment.