mail_spy 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -70,9 +70,10 @@ module MailSpy
70
70
  # ------------------------------------------- SEND OUTSTANDING EMAILS
71
71
  # Batches through all the emails that were scheduled and have come due
72
72
  # sends them out (step many at a time)
73
- def send_outstanding_emails(step=100)
73
+ def send_outstanding_emails(step=100, num_threads=50)
74
74
  raise "No Email service providers installed" unless MailSpy.esps.present?
75
75
 
76
+ pool = MailSpy::ThreadPool.new(num_threads)
76
77
  offset = 0
77
78
  sent = 0
78
79
 
@@ -83,28 +84,35 @@ module MailSpy
83
84
  pony_hash[pony_key] = value if value.present?
84
85
  end
85
86
 
87
+
86
88
  while true
87
89
  emails = MailSpy::Email.
88
90
  limit(step).offset(offset).
89
91
  where(:schedule_at.lte => DateTime.now, :sent => false, :failed => false).all
90
92
  break if emails.blank?
91
93
  emails.each do |email|
92
- begin
93
- mail = MailSpy::CoreMailer.template(email)
94
- #TODO might be nice to flush mail out in debug mode
95
- mail.deliver
96
- email.update_attribute(:sent, true)
97
- sent += 1
98
- rescue Exception => e
99
- email.failed = true
100
- email.error_message = e.try(:message)
101
- email.error_backtrace = e.try(:backtrace)
102
- email.save!
94
+ pool.schedule do
95
+ begin
96
+ MailSpy::CoreMailer.template(email).deliver
97
+ email.update_attribute(:sent, true)
98
+ sent += 1
99
+ rescue Exception => e
100
+ email.failed = true
101
+ email.error_message = e.try(:message)
102
+ email.error_backtrace = e.try(:backtrace)
103
+ email.save!
104
+ end
105
+ end
106
+
107
+ while(pool.job_queue_size > (2 * num_threads))
108
+ sleep(1)
103
109
  end
110
+
104
111
  end
105
112
  offset += step
106
113
  end
107
114
 
115
+ pool.shutdown
108
116
  sent
109
117
  end
110
118
 
@@ -0,0 +1,119 @@
1
+ # Ruby Thread ThreadPool
2
+ # ================
3
+ # A thread pool is useful when you wish to do some work in a thread, but do
4
+ # not know how much work you will be doing in advance. Spawning one thread
5
+ # for each task is potentially expensive, as threads are not free.
6
+ #
7
+ # In this case, it might be more beneficial to start a predefined set of
8
+ # threads and then hand off work to them as it becomes available. This is
9
+ # the pure essence of what a thread pool is: an array of threads, all just
10
+ # waiting to do some work for you!
11
+ #
12
+ # Prerequisites
13
+ # -------------
14
+
15
+ # We need the [Queue](http://rdoc.info/stdlib/thread/1.9.2/Queue), as our
16
+ # thread pool is largely dependent on it. Thanks to this, the implementation
17
+ # becomes very simple!
18
+ require 'thread'
19
+
20
+ module MailSpy
21
+ # Public Interface
22
+ # ----------------
23
+
24
+ # `ThreadPool` is our thread pool class. It will allow us to do three operations:
25
+ #
26
+ # - `.new(size)` creates a thread pool of a given size
27
+ # - `#schedule(*args, &job)` schedules a new job to be executed
28
+ # - `#shutdown` shuts down all threads (after letting them finish working, of course)
29
+ class ThreadPool
30
+
31
+ # ### initialization, or `ThreadPool.new(size)`
32
+ # Creating a new `ThreadPool` involves a certain amount of work. First, however,
33
+ # we need to define its’ `size`. It defines how many threads we will have
34
+ # working internally.
35
+ #
36
+ # Which size is best for you is hard to answer. You do not want it to be
37
+ # too low, as then you won’t be able to do as many things concurrently.
38
+ # However, if you make it too high Ruby will spend too much time switching
39
+ # between threads, and that will also degrade performance!
40
+ def initialize(size)
41
+ # Before we do anything else, we need to store some information about
42
+ # our pool. `@size` is useful later, when we want to shut our pool down,
43
+ # and `@jobs` is the heart of our pool that allows us to schedule work.
44
+ @size = size
45
+ @jobs = Queue.new
46
+
47
+ # #### Creating our pool of threads
48
+ # Once preparation is done, it’s time to create our pool of threads.
49
+ # Each thread store its’ index in a thread-local variable, in case we
50
+ # need to know which thread a job is executing in later on.
51
+ @pool = Array.new(@size) do |i|
52
+ Thread.new do
53
+ Thread.current[:id] = i
54
+
55
+ # We start off by defining a `catch` around our worker loop. This
56
+ # way we’ve provided a method for graceful shutdown of our threads.
57
+ # Shutting down is merely a `#schedule { throw :exit }` away!
58
+ catch(:exit) do
59
+ # The worker thread life-cycle is very simple. We continuously wait
60
+ # for tasks to be put into our job `Queue`. If the `Queue` is empty,
61
+ # we will wait until it’s not.
62
+ loop do
63
+ # Once we have a piece of work to be done, we will pull out the
64
+ # information we need and get to work.
65
+ job, args = @jobs.pop
66
+ job.call(*args)
67
+ end
68
+ end
69
+ end
70
+ end
71
+ end
72
+
73
+ def job_queue_size
74
+ @jobs.size
75
+ end
76
+
77
+ # ### Work scheduling
78
+
79
+ # To schedule a piece of work to be done is to say to the `ThreadPool` that you
80
+ # want something done.
81
+ def schedule(*args, &block)
82
+ # Your given task will not be run immediately; rather, it will be put
83
+ # into the work `Queue` and executed once a thread is ready to work.
84
+ @jobs << [block, args]
85
+ end
86
+
87
+ # ### Graceful shutdown
88
+
89
+ # If you ever wish to close down your application, I took the liberty of
90
+ # making it easy for you to wait for any currently executing jobs to finish
91
+ # before you exit.
92
+ def shutdown
93
+ # A graceful shutdown involves threads exiting cleanly themselves, and
94
+ # since we’ve defined a `catch`-handler around the threads’ worker loop
95
+ # it is simply a matter of throwing `:exit`. Thus, if we throw one `:exit`
96
+ # for each thread in our pool, they will all exit eventually!
97
+ @size.times do
98
+ schedule { throw :exit }
99
+ end
100
+
101
+ # And now one final thing: wait for our `throw :exit` jobs to be run on
102
+ # all our worker threads. This call will not return until all worker threads
103
+ # have exited.
104
+ @pool.map(&:join)
105
+ end
106
+ end
107
+ end
108
+ # example
109
+ #if $0 == __FILE__
110
+ # p = Pool.new(10)
111
+ #
112
+ # 20.times do |i|
113
+ # p.schedule do
114
+ # sleep rand(4) + 2
115
+ # puts "Job #{i} finished by thread #{Thread.current[:id]}"
116
+ # end
117
+ # end
118
+ # at_exit { p.shutdown }
119
+ #end
@@ -1,3 +1,3 @@
1
1
  module MailSpy
2
- VERSION = "0.0.11"
2
+ VERSION = "0.0.12"
3
3
  end
data/lib/mail_spy.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'pp' #For debugging
2
2
  require 'aws-sdk'
3
3
  require 'mail_spy/sendgrid/smtp_api_header'
4
+ require 'mail_spy/thread_pool'
4
5
  require "mongoid"
5
6
  require "mail_spy/engine"
6
7
  require "mail_spy/manager"
@@ -13070,3 +13070,528 @@ MONGODB dummy_test['mail_spy_emails'].remove({})
13070
13070
   (0.1ms) rollback transaction
13071
13071
   (0.1ms) begin transaction
13072
13072
   (0.0ms) rollback transaction
13073
+ MONGODB [WARNING] Please note that logging negatively impacts client-side performance. You should set your logging level no lower than :info in production.
13074
+ MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1)
13075
+  (0.3ms) begin transaction
13076
+ MONGODB dummy_test['system.namespaces'].find({})
13077
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e1661ba12eb016d000001'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:40:48 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:40:49 UTC, "created_at"=>2012-02-05 05:40:49 UTC}])
13078
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e1661ba12eb016d000001')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e1661ba12eb016d000001\"}}"}}})
13079
+ [AWS S3 200 0.818152] get_bucket_versioning(:bucket_name=>"daviacalendar-mailspy")
13080
+
13081
+ [AWS S3 200 0.097626] head_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.text.erb")
13082
+
13083
+ [AWS S3 200 0.114406] get_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.text.erb")
13084
+
13085
+ Rendered inline template (34.3ms)
13086
+ [AWS S3 200 0.094098] get_bucket_versioning(:bucket_name=>"daviacalendar-mailspy")
13087
+
13088
+ [AWS S3 200 0.095562] head_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.html.erb")
13089
+
13090
+ [AWS S3 200 0.138449] get_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.html.erb")
13091
+
13092
+ Rendered inline template (2.4ms)
13093
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13094
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13095
+  (0.1ms) rollback transaction
13096
+  (0.1ms) begin transaction
13097
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e1665ba12eb016d000002'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:40:53 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:40:53 UTC, "created_at"=>2012-02-05 05:40:53 UTC}])
13098
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e1665ba12eb016d000002')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e1665ba12eb016d000002\"}}"}}})
13099
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13100
+ Rendered inline template (2.3ms)
13101
+ Rendered inline template (1.6ms)
13102
+
13103
+ Sent mail to trcarden@gmail.com (4540ms)
13104
+ Date: Sat, 04 Feb 2012 21:40:53 -0800
13105
+ From: test@test.com
13106
+ Reply-To: testGuy
13107
+ To: trcarden@gmail.com
13108
+ Message-ID: <4f2e166597938_16d80434f4c37152@toms-iphone-4.mail>
13109
+ Subject: test subject
13110
+ Mime-Version: 1.0
13111
+ Content-Type: multipart/alternative;
13112
+ boundary="--==_mimepart_4f2e16655d983_16d80434f4c36877";
13113
+ charset=UTF-8
13114
+ Content-Transfer-Encoding: 7bit
13115
+ X-SMTPAPI: {"unique_args": {"eid": "4f2e1665ba12eb016d000002"}}
13116
+
13117
+
13118
+
13119
+ ----==_mimepart_4f2e16655d983_16d80434f4c36877
13120
+ Date: Sat, 04 Feb 2012 21:40:53 -0800
13121
+ Mime-Version: 1.0
13122
+ Content-Type: text/plain;
13123
+ charset=UTF-8
13124
+ Content-Transfer-Encoding: 7bit
13125
+ Content-ID: <4f2e1665843a5_16d80434f4c3698d@toms-iphone-4.mail>
13126
+
13127
+ You should be able to click on the link and have the server record the even
13128
+ and forward you to the correct place.
13129
+
13130
+ A link : <a href="http://localhost:5000/mail/t?eid=4f2e1665ba12eb016d000002&amp;n=1&amp;url=www.google.com">My home</a>
13131
+ ---------------------------
13132
+
13133
+ You should be able to show images in the email client and have the server
13134
+ track the open
13135
+ A Bug is in the parenthesis (<img src='http://localhost:5000/mail/b?eid=4f2e1665ba12eb016d000002' style='display:none' width='1' height='1' border='0' />)
13136
+
13137
+
13138
+
13139
+
13140
+ ----==_mimepart_4f2e16655d983_16d80434f4c36877
13141
+ Date: Sat, 04 Feb 2012 21:40:53 -0800
13142
+ Mime-Version: 1.0
13143
+ Content-Type: text/html;
13144
+ charset=UTF-8
13145
+ Content-Transfer-Encoding: 7bit
13146
+ Content-ID: <4f2e166591611_16d80434f4c3703b@toms-iphone-4.mail>
13147
+
13148
+ <p>
13149
+ You should be able to click on the link and have the server record the even
13150
+ and forward you to the correct place.
13151
+
13152
+ A link : <a href="http://localhost:5000/mail/t?eid=4f2e1665ba12eb016d000002&amp;n=1&amp;url=www.google.com">My home</a>
13153
+ </p>
13154
+
13155
+ <br>
13156
+
13157
+ <p>
13158
+ You should be able to show images in the email client and have the server
13159
+ track the open
13160
+ A Bug is in the parenthesis (<img src='http://localhost:5000/mail/b?eid=4f2e1665ba12eb016d000002' style='display:none' width='1' height='1' border='0' />)
13161
+ </p>
13162
+
13163
+
13164
+
13165
+ ----==_mimepart_4f2e16655d983_16d80434f4c36877--
13166
+
13167
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13168
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13169
+  (0.1ms) rollback transaction
13170
+  (0.0ms) begin transaction
13171
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13172
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13173
+  (0.0ms) rollback transaction
13174
+  (0.0ms) begin transaction
13175
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13176
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13177
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e1669ba12eb016d000003'), "to"=>"test@test.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-02-05 05:40:57 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"test campaign", "utm_term"=>"test stream", "utm_content"=>"test component", "updated_at"=>2012-02-05 05:40:57 UTC, "created_at"=>2012-02-05 05:40:57 UTC}])
13178
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e1669ba12eb016d000003')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e1669ba12eb016d000003\"}}"}}})
13179
+  (0.1ms) rollback transaction
13180
+  (0.0ms) begin transaction
13181
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13182
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13183
+  (0.0ms) rollback transaction
13184
+  (0.0ms) begin transaction
13185
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13186
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13187
+  (0.0ms) rollback transaction
13188
+  (0.0ms) begin transaction
13189
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13190
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13191
+  (0.0ms) rollback transaction
13192
+  (0.1ms) begin transaction
13193
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13194
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13195
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e1669ba12eb016d000004'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:40:57 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:40:57 UTC, "created_at"=>2012-02-05 05:40:57 UTC}])
13196
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e1669ba12eb016d000004')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e1669ba12eb016d000004\"}}"}}})
13197
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13198
+ Processing by MailSpy::TrackingController#action as HTML
13199
+ Parameters: {"eid"=>"4f2e1669ba12eb016d000004", "action_type"=>"Conversion", "count"=>"3"}
13200
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e1669ba12eb016d000004')}).limit(-1).sort([[:_id, :asc]])
13201
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e1669ba12eb016d000004')}, {"$push"=>{"actions"=>{"count"=>3, "_id"=>BSON::ObjectId('4f2e166aba12eb016d000005'), "action_type"=>"Conversion", "updated_at"=>2012-02-05 05:40:58 UTC, "created_at"=>2012-02-05 05:40:58 UTC}}})
13202
+ Completed 200 OK in 4ms (ActiveRecord: 0.0ms)
13203
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e1669ba12eb016d000004')}).limit(-1)
13204
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13205
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13206
+  (0.1ms) rollback transaction
13207
+  (0.0ms) begin transaction
13208
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13209
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13210
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e166aba12eb016d000006'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:40:58 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:40:58 UTC, "created_at"=>2012-02-05 05:40:58 UTC}])
13211
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e166aba12eb016d000006')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e166aba12eb016d000006\"}}"}}})
13212
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13213
+ Processing by MailSpy::TrackingController#bug as HTML
13214
+ Parameters: {"eid"=>"4f2e166aba12eb016d000006"}
13215
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e166aba12eb016d000006')}).limit(-1).sort([[:_id, :asc]])
13216
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e166aba12eb016d000006')}, {"$push"=>{"actions"=>{"count"=>1, "_id"=>BSON::ObjectId('4f2e166aba12eb016d000007'), "action_type"=>"open", "updated_at"=>2012-02-05 05:40:58 UTC, "created_at"=>2012-02-05 05:40:58 UTC}}})
13217
+ Completed 200 OK in 3ms (ActiveRecord: 0.0ms)
13218
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e166aba12eb016d000006')}).limit(-1)
13219
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13220
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13221
+  (0.1ms) rollback transaction
13222
+  (0.0ms) begin transaction
13223
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13224
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13225
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e166aba12eb016d000008'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:40:58 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:40:58 UTC, "created_at"=>2012-02-05 05:40:58 UTC}])
13226
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e166aba12eb016d000008')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e166aba12eb016d000008\"}}"}}})
13227
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13228
+ Processing by MailSpy::TrackingController#link as HTML
13229
+ Parameters: {"eid"=>"4f2e166aba12eb016d000008", "url"=>"http://google.com", "n"=>"0"}
13230
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e166aba12eb016d000008')}).limit(-1).sort([[:_id, :asc]])
13231
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e166aba12eb016d000008')}, {"$push"=>{"actions"=>{"count"=>1, "_id"=>BSON::ObjectId('4f2e166aba12eb016d000009'), "action_type"=>"click", "details"=>{:url=>"http://google.com", :link_number=>"0"}, "updated_at"=>2012-02-05 05:40:58 UTC, "created_at"=>2012-02-05 05:40:58 UTC}}})
13232
+ Redirected to http://google.com?utm_campaign=tests&utm_content=a-helper_test&utm_medium=email&utm_source=mailspy&utm_term=a-stream
13233
+ Completed 302 Found in 3ms (ActiveRecord: 0.0ms)
13234
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13235
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13236
+  (0.1ms) rollback transaction
13237
+  (0.0ms) begin transaction
13238
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13239
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13240
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e166aba12eb016d00000a'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:40:58 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:40:58 UTC, "created_at"=>2012-02-05 05:40:58 UTC}])
13241
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e166aba12eb016d00000a')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e166aba12eb016d00000a\"}}"}}})
13242
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13243
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13244
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13245
+  (0.1ms) rollback transaction
13246
+  (0.0ms) begin transaction
13247
+  (0.0ms) rollback transaction
13248
+ MONGODB [WARNING] Please note that logging negatively impacts client-side performance. You should set your logging level no lower than :info in production.
13249
+ MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1)
13250
+  (0.3ms) begin transaction
13251
+ MONGODB dummy_test['system.namespaces'].find({})
13252
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e1687ba12eb0173000001'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:41:27 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:41:27 UTC, "created_at"=>2012-02-05 05:41:27 UTC}])
13253
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e1687ba12eb0173000001')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e1687ba12eb0173000001\"}}"}}})
13254
+ [AWS S3 200 0.412159] get_bucket_versioning(:bucket_name=>"daviacalendar-mailspy")
13255
+
13256
+ [AWS S3 200 0.098070] head_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.text.erb")
13257
+
13258
+ [AWS S3 200 0.102749] get_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.text.erb")
13259
+
13260
+ Rendered inline template (22.7ms)
13261
+ [AWS S3 200 0.093799] get_bucket_versioning(:bucket_name=>"daviacalendar-mailspy")
13262
+
13263
+ [AWS S3 200 0.098474] head_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.html.erb")
13264
+
13265
+ [AWS S3 200 0.118800] get_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.html.erb")
13266
+
13267
+ Rendered inline template (1.6ms)
13268
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13269
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13270
+  (0.1ms) rollback transaction
13271
+  (0.0ms) begin transaction
13272
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e168bba12eb0173000002'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:41:31 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:41:31 UTC, "created_at"=>2012-02-05 05:41:31 UTC}])
13273
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e168bba12eb0173000002')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e168bba12eb0173000002\"}}"}}})
13274
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13275
+ Rendered inline template (1.5ms)
13276
+ Rendered inline template (1.3ms)
13277
+
13278
+ Sent mail to trcarden@gmail.com (1360ms)
13279
+ Date: Sat, 04 Feb 2012 21:41:31 -0800
13280
+ From: test@test.com
13281
+ Reply-To: testGuy
13282
+ To: trcarden@gmail.com
13283
+ Message-ID: <4f2e168b31304_17380434f4c9277c@toms-iphone-4.mail>
13284
+ Subject: test subject
13285
+ Mime-Version: 1.0
13286
+ Content-Type: multipart/alternative;
13287
+ boundary="--==_mimepart_4f2e168b8e97_17380434f4c924ae";
13288
+ charset=UTF-8
13289
+ Content-Transfer-Encoding: 7bit
13290
+ X-SMTPAPI: {"unique_args": {"eid": "4f2e168bba12eb0173000002"}}
13291
+
13292
+
13293
+
13294
+ ----==_mimepart_4f2e168b8e97_17380434f4c924ae
13295
+ Date: Sat, 04 Feb 2012 21:41:31 -0800
13296
+ Mime-Version: 1.0
13297
+ Content-Type: text/plain;
13298
+ charset=UTF-8
13299
+ Content-Transfer-Encoding: 7bit
13300
+ Content-ID: <4f2e168b23eeb_17380434f4c92518@toms-iphone-4.mail>
13301
+
13302
+ You should be able to click on the link and have the server record the even
13303
+ and forward you to the correct place.
13304
+
13305
+ A link : <a href="http://localhost:5000/mail/t?eid=4f2e168bba12eb0173000002&amp;n=1&amp;url=www.google.com">My home</a>
13306
+ ---------------------------
13307
+
13308
+ You should be able to show images in the email client and have the server
13309
+ track the open
13310
+ A Bug is in the parenthesis (<img src='http://localhost:5000/mail/b?eid=4f2e168bba12eb0173000002' style='display:none' width='1' height='1' border='0' />)
13311
+
13312
+
13313
+
13314
+
13315
+ ----==_mimepart_4f2e168b8e97_17380434f4c924ae
13316
+ Date: Sat, 04 Feb 2012 21:41:31 -0800
13317
+ Mime-Version: 1.0
13318
+ Content-Type: text/html;
13319
+ charset=UTF-8
13320
+ Content-Transfer-Encoding: 7bit
13321
+ Content-ID: <4f2e168b2c3d0_17380434f4c92698@toms-iphone-4.mail>
13322
+
13323
+ <p>
13324
+ You should be able to click on the link and have the server record the even
13325
+ and forward you to the correct place.
13326
+
13327
+ A link : <a href="http://localhost:5000/mail/t?eid=4f2e168bba12eb0173000002&amp;n=1&amp;url=www.google.com">My home</a>
13328
+ </p>
13329
+
13330
+ <br>
13331
+
13332
+ <p>
13333
+ You should be able to show images in the email client and have the server
13334
+ track the open
13335
+ A Bug is in the parenthesis (<img src='http://localhost:5000/mail/b?eid=4f2e168bba12eb0173000002' style='display:none' width='1' height='1' border='0' />)
13336
+ </p>
13337
+
13338
+
13339
+
13340
+ ----==_mimepart_4f2e168b8e97_17380434f4c924ae--
13341
+
13342
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13343
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13344
+  (0.1ms) rollback transaction
13345
+  (0.0ms) begin transaction
13346
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13347
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13348
+  (0.0ms) rollback transaction
13349
+  (0.0ms) begin transaction
13350
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13351
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13352
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e168cba12eb0173000003'), "to"=>"test@test.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-02-05 05:41:32 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"test campaign", "utm_term"=>"test stream", "utm_content"=>"test component", "updated_at"=>2012-02-05 05:41:32 UTC, "created_at"=>2012-02-05 05:41:32 UTC}])
13353
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e168cba12eb0173000003')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e168cba12eb0173000003\"}}"}}})
13354
+  (0.1ms) rollback transaction
13355
+  (0.0ms) begin transaction
13356
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13357
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13358
+  (0.0ms) rollback transaction
13359
+  (0.0ms) begin transaction
13360
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13361
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13362
+  (0.0ms) rollback transaction
13363
+  (0.0ms) begin transaction
13364
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13365
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13366
+  (0.0ms) rollback transaction
13367
+  (0.1ms) begin transaction
13368
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13369
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13370
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e168cba12eb0173000004'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:41:32 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:41:32 UTC, "created_at"=>2012-02-05 05:41:32 UTC}])
13371
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e168cba12eb0173000004')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e168cba12eb0173000004\"}}"}}})
13372
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13373
+ Processing by MailSpy::TrackingController#action as HTML
13374
+ Parameters: {"eid"=>"4f2e168cba12eb0173000004", "action_type"=>"Conversion", "count"=>"3"}
13375
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e168cba12eb0173000004')}).limit(-1).sort([[:_id, :asc]])
13376
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e168cba12eb0173000004')}, {"$push"=>{"actions"=>{"count"=>3, "_id"=>BSON::ObjectId('4f2e168cba12eb0173000005'), "action_type"=>"Conversion", "updated_at"=>2012-02-05 05:41:32 UTC, "created_at"=>2012-02-05 05:41:32 UTC}}})
13377
+ Completed 200 OK in 5ms (ActiveRecord: 0.0ms)
13378
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e168cba12eb0173000004')}).limit(-1)
13379
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13380
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13381
+  (0.1ms) rollback transaction
13382
+  (0.0ms) begin transaction
13383
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13384
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13385
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e168cba12eb0173000006'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:41:32 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:41:32 UTC, "created_at"=>2012-02-05 05:41:32 UTC}])
13386
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e168cba12eb0173000006')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e168cba12eb0173000006\"}}"}}})
13387
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13388
+ Processing by MailSpy::TrackingController#bug as HTML
13389
+ Parameters: {"eid"=>"4f2e168cba12eb0173000006"}
13390
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e168cba12eb0173000006')}).limit(-1).sort([[:_id, :asc]])
13391
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e168cba12eb0173000006')}, {"$push"=>{"actions"=>{"count"=>1, "_id"=>BSON::ObjectId('4f2e168cba12eb0173000007'), "action_type"=>"open", "updated_at"=>2012-02-05 05:41:32 UTC, "created_at"=>2012-02-05 05:41:32 UTC}}})
13392
+ Completed 200 OK in 3ms (ActiveRecord: 0.0ms)
13393
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e168cba12eb0173000006')}).limit(-1)
13394
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13395
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13396
+  (0.1ms) rollback transaction
13397
+  (0.0ms) begin transaction
13398
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13399
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13400
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e168cba12eb0173000008'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:41:32 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:41:32 UTC, "created_at"=>2012-02-05 05:41:32 UTC}])
13401
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e168cba12eb0173000008')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e168cba12eb0173000008\"}}"}}})
13402
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13403
+ Processing by MailSpy::TrackingController#link as HTML
13404
+ Parameters: {"eid"=>"4f2e168cba12eb0173000008", "url"=>"http://google.com", "n"=>"0"}
13405
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e168cba12eb0173000008')}).limit(-1).sort([[:_id, :asc]])
13406
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e168cba12eb0173000008')}, {"$push"=>{"actions"=>{"count"=>1, "_id"=>BSON::ObjectId('4f2e168cba12eb0173000009'), "action_type"=>"click", "details"=>{:url=>"http://google.com", :link_number=>"0"}, "updated_at"=>2012-02-05 05:41:32 UTC, "created_at"=>2012-02-05 05:41:32 UTC}}})
13407
+ Redirected to http://google.com?utm_campaign=tests&utm_content=a-helper_test&utm_medium=email&utm_source=mailspy&utm_term=a-stream
13408
+ Completed 302 Found in 3ms (ActiveRecord: 0.0ms)
13409
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13410
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13411
+  (0.1ms) rollback transaction
13412
+  (0.0ms) begin transaction
13413
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13414
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13415
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e168cba12eb017300000a'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:41:32 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:41:32 UTC, "created_at"=>2012-02-05 05:41:32 UTC}])
13416
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e168cba12eb017300000a')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e168cba12eb017300000a\"}}"}}})
13417
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13418
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13419
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13420
+  (0.0ms) rollback transaction
13421
+  (0.0ms) begin transaction
13422
+  (0.0ms) rollback transaction
13423
+ MONGODB [WARNING] Please note that logging negatively impacts client-side performance. You should set your logging level no lower than :info in production.
13424
+ MONGODB admin['$cmd'].find({:ismaster=>1}).limit(-1)
13425
+  (0.3ms) begin transaction
13426
+ MONGODB dummy_test['system.namespaces'].find({})
13427
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e16d1ba12eb017f000001'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:42:41 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:42:41 UTC, "created_at"=>2012-02-05 05:42:41 UTC}])
13428
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d1ba12eb017f000001')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e16d1ba12eb017f000001\"}}"}}})
13429
+ [AWS S3 200 0.461392] get_bucket_versioning(:bucket_name=>"daviacalendar-mailspy")
13430
+
13431
+ [AWS S3 200 0.102523] head_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.text.erb")
13432
+
13433
+ [AWS S3 200 0.126795] get_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.text.erb")
13434
+
13435
+ Rendered inline template (27.6ms)
13436
+ [AWS S3 200 0.096139] get_bucket_versioning(:bucket_name=>"daviacalendar-mailspy")
13437
+
13438
+ [AWS S3 200 0.098424] head_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.html.erb")
13439
+
13440
+ [AWS S3 200 0.118032] get_object(:bucket_name=>"daviacalendar-mailspy",:key=>"tests/a-stream/a-helper_test.html.erb")
13441
+
13442
+ Rendered inline template (1.6ms)
13443
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13444
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13445
+  (0.1ms) rollback transaction
13446
+  (0.0ms) begin transaction
13447
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e16d4ba12eb017f000002'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:42:44 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:42:44 UTC, "created_at"=>2012-02-05 05:42:44 UTC}])
13448
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d4ba12eb017f000002')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e16d4ba12eb017f000002\"}}"}}})
13449
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13450
+ Rendered inline template (1.5ms)
13451
+ Rendered inline template (1.2ms)
13452
+
13453
+ Sent mail to trcarden@gmail.com (959ms)
13454
+ Date: Sat, 04 Feb 2012 21:42:44 -0800
13455
+ From: test@test.com
13456
+ Reply-To: testGuy
13457
+ To: trcarden@gmail.com
13458
+ Message-ID: <4f2e16d4d1445_17f80434f4c409da@toms-iphone-4.mail>
13459
+ Subject: test subject
13460
+ Mime-Version: 1.0
13461
+ Content-Type: multipart/alternative;
13462
+ boundary="--==_mimepart_4f2e16d4a8fd4_17f80434f4c40683";
13463
+ charset=UTF-8
13464
+ Content-Transfer-Encoding: 7bit
13465
+ X-SMTPAPI: {"unique_args": {"eid": "4f2e16d4ba12eb017f000002"}}
13466
+
13467
+
13468
+
13469
+ ----==_mimepart_4f2e16d4a8fd4_17f80434f4c40683
13470
+ Date: Sat, 04 Feb 2012 21:42:44 -0800
13471
+ Mime-Version: 1.0
13472
+ Content-Type: text/plain;
13473
+ charset=UTF-8
13474
+ Content-Transfer-Encoding: 7bit
13475
+ Content-ID: <4f2e16d4c4237_17f80434f4c4071c@toms-iphone-4.mail>
13476
+
13477
+ You should be able to click on the link and have the server record the even
13478
+ and forward you to the correct place.
13479
+
13480
+ A link : <a href="http://localhost:5000/mail/t?eid=4f2e16d4ba12eb017f000002&amp;n=1&amp;url=www.google.com">My home</a>
13481
+ ---------------------------
13482
+
13483
+ You should be able to show images in the email client and have the server
13484
+ track the open
13485
+ A Bug is in the parenthesis (<img src='http://localhost:5000/mail/b?eid=4f2e16d4ba12eb017f000002' style='display:none' width='1' height='1' border='0' />)
13486
+
13487
+
13488
+
13489
+
13490
+ ----==_mimepart_4f2e16d4a8fd4_17f80434f4c40683
13491
+ Date: Sat, 04 Feb 2012 21:42:44 -0800
13492
+ Mime-Version: 1.0
13493
+ Content-Type: text/html;
13494
+ charset=UTF-8
13495
+ Content-Transfer-Encoding: 7bit
13496
+ Content-ID: <4f2e16d4cc741_17f80434f4c408e4@toms-iphone-4.mail>
13497
+
13498
+ <p>
13499
+ You should be able to click on the link and have the server record the even
13500
+ and forward you to the correct place.
13501
+
13502
+ A link : <a href="http://localhost:5000/mail/t?eid=4f2e16d4ba12eb017f000002&amp;n=1&amp;url=www.google.com">My home</a>
13503
+ </p>
13504
+
13505
+ <br>
13506
+
13507
+ <p>
13508
+ You should be able to show images in the email client and have the server
13509
+ track the open
13510
+ A Bug is in the parenthesis (<img src='http://localhost:5000/mail/b?eid=4f2e16d4ba12eb017f000002' style='display:none' width='1' height='1' border='0' />)
13511
+ </p>
13512
+
13513
+
13514
+
13515
+ ----==_mimepart_4f2e16d4a8fd4_17f80434f4c40683--
13516
+
13517
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13518
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13519
+  (0.1ms) rollback transaction
13520
+  (0.0ms) begin transaction
13521
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13522
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13523
+  (0.0ms) rollback transaction
13524
+  (0.0ms) begin transaction
13525
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13526
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13527
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000003'), "to"=>"test@test.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"test campaign", "stream"=>"test stream", "component"=>"test component", "schedule_at"=>2012-02-05 05:42:45 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"test campaign", "utm_term"=>"test stream", "utm_content"=>"test component", "updated_at"=>2012-02-05 05:42:45 UTC, "created_at"=>2012-02-05 05:42:45 UTC}])
13528
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000003')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e16d5ba12eb017f000003\"}}"}}})
13529
+  (0.1ms) rollback transaction
13530
+  (0.0ms) begin transaction
13531
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13532
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13533
+  (0.0ms) rollback transaction
13534
+  (0.0ms) begin transaction
13535
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13536
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13537
+  (0.0ms) rollback transaction
13538
+  (0.0ms) begin transaction
13539
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13540
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13541
+  (0.0ms) rollback transaction
13542
+  (0.1ms) begin transaction
13543
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13544
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13545
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000004'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:42:45 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:42:45 UTC, "created_at"=>2012-02-05 05:42:45 UTC}])
13546
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000004')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e16d5ba12eb017f000004\"}}"}}})
13547
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13548
+ Processing by MailSpy::TrackingController#action as HTML
13549
+ Parameters: {"eid"=>"4f2e16d5ba12eb017f000004", "action_type"=>"Conversion", "count"=>"3"}
13550
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e16d5ba12eb017f000004')}).limit(-1).sort([[:_id, :asc]])
13551
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000004')}, {"$push"=>{"actions"=>{"count"=>3, "_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000005'), "action_type"=>"Conversion", "updated_at"=>2012-02-05 05:42:45 UTC, "created_at"=>2012-02-05 05:42:45 UTC}}})
13552
+ Completed 200 OK in 4ms (ActiveRecord: 0.0ms)
13553
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e16d5ba12eb017f000004')}).limit(-1)
13554
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13555
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13556
+  (0.1ms) rollback transaction
13557
+  (0.0ms) begin transaction
13558
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13559
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13560
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000006'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:42:45 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:42:45 UTC, "created_at"=>2012-02-05 05:42:45 UTC}])
13561
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000006')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e16d5ba12eb017f000006\"}}"}}})
13562
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13563
+ Processing by MailSpy::TrackingController#bug as HTML
13564
+ Parameters: {"eid"=>"4f2e16d5ba12eb017f000006"}
13565
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e16d5ba12eb017f000006')}).limit(-1).sort([[:_id, :asc]])
13566
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000006')}, {"$push"=>{"actions"=>{"count"=>1, "_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000007'), "action_type"=>"open", "updated_at"=>2012-02-05 05:42:45 UTC, "created_at"=>2012-02-05 05:42:45 UTC}}})
13567
+ Completed 200 OK in 3ms (ActiveRecord: 0.0ms)
13568
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e16d5ba12eb017f000006')}).limit(-1)
13569
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13570
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13571
+  (0.1ms) rollback transaction
13572
+  (0.0ms) begin transaction
13573
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13574
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13575
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000008'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:42:45 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:42:45 UTC, "created_at"=>2012-02-05 05:42:45 UTC}])
13576
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000008')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e16d5ba12eb017f000008\"}}"}}})
13577
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13578
+ Processing by MailSpy::TrackingController#link as HTML
13579
+ Parameters: {"eid"=>"4f2e16d5ba12eb017f000008", "url"=>"http://google.com", "n"=>"0"}
13580
+ MONGODB dummy_test['mail_spy_emails'].find({:_id=>BSON::ObjectId('4f2e16d5ba12eb017f000008')}).limit(-1).sort([[:_id, :asc]])
13581
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000008')}, {"$push"=>{"actions"=>{"count"=>1, "_id"=>BSON::ObjectId('4f2e16d5ba12eb017f000009'), "action_type"=>"click", "details"=>{:url=>"http://google.com", :link_number=>"0"}, "updated_at"=>2012-02-05 05:42:45 UTC, "created_at"=>2012-02-05 05:42:45 UTC}}})
13582
+ Redirected to http://google.com?utm_campaign=tests&utm_content=a-helper_test&utm_medium=email&utm_source=mailspy&utm_term=a-stream
13583
+ Completed 302 Found in 4ms (ActiveRecord: 0.0ms)
13584
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13585
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13586
+  (0.1ms) rollback transaction
13587
+  (0.0ms) begin transaction
13588
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13589
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13590
+ MONGODB dummy_test['mail_spy_emails'].insert([{"headers"=>{}, "template_values"=>{}, "sent"=>false, "failed"=>false, "_id"=>BSON::ObjectId('4f2e16d5ba12eb017f00000a'), "to"=>"trcarden@gmail.com", "from"=>"test@test.com", "reply_to"=>"testGuy", "subject"=>"test subject", "campaign"=>"tests", "stream"=>"a-stream", "component"=>"a-helper_test", "schedule_at"=>2012-02-05 05:42:45 UTC, "email_service_provider"=>"sendgrid", "utm_source"=>"mailspy", "utm_medium"=>"email", "utm_campaign"=>"tests", "utm_term"=>"a-stream", "utm_content"=>"a-helper_test", "updated_at"=>2012-02-05 05:42:45 UTC, "created_at"=>2012-02-05 05:42:45 UTC}])
13591
+ MONGODB dummy_test['mail_spy_emails'].update({"_id"=>BSON::ObjectId('4f2e16d5ba12eb017f00000a')}, {"$set"=>{"headers"=>{"X-SMTPAPI"=>"{\"unique_args\": {\"eid\": \"4f2e16d5ba12eb017f00000a\"}}"}}})
13592
+ MONGODB dummy_test['mail_spy_emails'].find({}).limit(-1).sort([[:_id, :asc]])
13593
+ MONGODB dummy_test['$cmd'].find({"count"=>"mail_spy_emails", "query"=>{}, "fields"=>nil}).limit(-1)
13594
+ MONGODB dummy_test['mail_spy_emails'].remove({})
13595
+  (0.0ms) rollback transaction
13596
+  (0.1ms) begin transaction
13597
+  (0.1ms) rollback transaction
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: mail_spy
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.0.11
5
+ version: 0.0.12
6
6
  platform: ruby
7
7
  authors:
8
8
  - Timothy Cardenas
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2012-02-02 00:00:00 Z
13
+ date: 2012-02-05 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -225,6 +225,7 @@ files:
225
225
  - lib/mail_spy/engine.rb
226
226
  - lib/mail_spy/manager.rb
227
227
  - lib/mail_spy/sendgrid/smtp_api_header.rb
228
+ - lib/mail_spy/thread_pool.rb
228
229
  - lib/mail_spy/version.rb
229
230
  - lib/mail_spy.rb
230
231
  - lib/tasks/mail_spy_tasks.rake