Permalink
Browse files

added log message when API call is sent to Yesmail

  • Loading branch information...
Jon Snitow
Jon Snitow committed Jan 2, 2013
1 parent f12099c commit 6e272cb8b8abf232472d5501345ad2bb9fb2424d
Showing with 8 additions and 0 deletions.
  1. +2 −0 Gemfile
  2. +5 −0 lib/yesmail/subscriber.rb
  3. +1 −0 yesmail.gemspec
View
@@ -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
@@ -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
@@ -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
View
@@ -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'

0 comments on commit 6e272cb

Please sign in to comment.