mail_spy 0.0.2 → 0.1.1

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.
Files changed (56) hide show
  1. data/README.rdoc +86 -24
  2. data/app/assets/images/mail_spy/background_tile.gif +0 -0
  3. data/app/assets/images/mail_spy/mailspy_sprite.png +0 -0
  4. data/app/assets/images/mail_spy/spy.ico +0 -0
  5. data/app/assets/javascripts/mail_spy/lib/backbone.js +1256 -0
  6. data/app/assets/javascripts/mail_spy/lib/underscore.js +999 -0
  7. data/app/assets/javascripts/mail_spy/reports.js +2 -0
  8. data/app/assets/javascripts/mail_spy/sendgrid.js +2 -0
  9. data/app/assets/stylesheets/mail_spy/application.css +62 -1
  10. data/app/assets/stylesheets/mail_spy/reports.css.scss +128 -0
  11. data/app/assets/stylesheets/mail_spy/sendgrid.css +4 -0
  12. data/app/controllers/mail_spy/reports_controller.rb +29 -0
  13. data/app/controllers/mail_spy/sendgrid_controller.rb +26 -0
  14. data/app/controllers/mail_spy/tracking_controller.rb +19 -11
  15. data/app/helpers/mail_spy/email_helper.rb +21 -3
  16. data/app/helpers/mail_spy/reports_helper.rb +4 -0
  17. data/app/helpers/mail_spy/sendgrid_helper.rb +4 -0
  18. data/app/mailers/mail_spy/core_mailer.rb +15 -18
  19. data/app/models/mail_spy/email.rb +127 -19
  20. data/app/models/mail_spy/process_log.rb +25 -0
  21. data/app/views/layouts/mail_spy/application.html.erb +3 -0
  22. data/app/views/mail_spy/reports/campaigns.html.erb +138 -0
  23. data/config/routes.rb +6 -0
  24. data/lib/generators/mail_spy/templates/mail_spy.rb +25 -1
  25. data/lib/mail_spy/manager.rb +100 -54
  26. data/lib/mail_spy/sendgrid/smtp_api_header.rb +68 -0
  27. data/lib/mail_spy/version.rb +1 -1
  28. data/lib/mail_spy.rb +39 -5
  29. data/test/dummy/app/views/email_templates/helper_test.html.erb +15 -0
  30. data/test/dummy/app/views/email_templates/helper_test.text.erb +11 -0
  31. data/test/dummy/config/environments/development.rb +1 -1
  32. data/test/dummy/config/environments/production.rb +5 -1
  33. data/test/dummy/config/environments/test.rb +4 -1
  34. data/test/dummy/config/initializers/mail_spy.rb +42 -0
  35. data/test/dummy/config/routes.rb +1 -2
  36. data/test/dummy/db/schema.rb +16 -0
  37. data/test/dummy/db/seeds.rb +16 -13
  38. data/test/dummy/lib/tasks/emails.rake +8 -0
  39. data/test/dummy/log/development.log +782 -0
  40. data/test/dummy/log/test.log +9952 -0
  41. data/test/fixtures/mail_spy/process_logs.yml +15 -0
  42. data/test/functional/mail_spy/core_mailer_test.rb +16 -9
  43. data/test/functional/mail_spy/reports_controller_test.rb +9 -0
  44. data/test/functional/mail_spy/sendgrid_controller_test.rb +9 -0
  45. data/test/functional/mail_spy/tracking_controller_test.rb +16 -11
  46. data/test/test_email_credentials.yml +2 -2
  47. data/test/test_email_credentials.yml.sample +0 -8
  48. data/test/test_helper.rb +15 -41
  49. data/test/unit/helpers/mail_spy/reports_helper_test.rb +6 -0
  50. data/test/unit/helpers/mail_spy/sendgrid_helper_test.rb +6 -0
  51. data/test/unit/mail_spy/manager_test.rb +101 -122
  52. data/test/unit/mail_spy/{email_template_test.rb → process_log_test.rb} +1 -1
  53. metadata +122 -34
  54. data/app/models/mail_spy/email_template.rb +0 -17
  55. data/test/fixtures/mail_spy/email_templates.yml +0 -9
  56. /data/lib/generators/mail_spy/{initialize_generator.rb → initializer_generator.rb} +0 -0
@@ -1,16 +1,19 @@
1
1
  (0..10).each do |i|
2
- MailSpy::Email.create(
3
- {
4
- :email_address => "trcarden@gmail.com",
5
- :user_id => 1,
6
- :campaign =>"testCampaign#{i%2}",
7
- :stream => "testStream#{i}",
8
- :component => "a",
9
- :actions => [
10
- {:action_type => "open"},
11
- {:action_type => "delivered"}
12
- ]
13
- }
14
- )
2
+ 3.times.each do
3
+ MailSpy::Email.create!(
4
+ {
5
+ :email_address => "trcarden@gmail.com",
6
+ :user_id => 1,
7
+ :campaign => "testCampaign#{i%2}",
8
+ :stream => "testStream#{i}",
9
+ :component => "a",
10
+ :email_service_provider => 'sendgrid',
11
+ :actions => [
12
+ {:action_type => "open"},
13
+ {:action_type => "delivered"}
14
+ ]
15
+ }
16
+ )
17
+ end
15
18
  end
16
19
 
@@ -0,0 +1,8 @@
1
+ namespace :emails do
2
+
3
+ desc "Send helper test emails to test email"
4
+ task :send_helper_test => :environment do
5
+
6
+ end
7
+
8
+ end