mail_spy 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +2 -7
- data/app/helpers/mail_spy/email_helper.rb +17 -3
- data/app/mailers/mail_spy/core_mailer.rb +11 -8
- data/app/models/mail_spy/email.rb +33 -14
- data/lib/generators/mail_spy/templates/mail_spy.rb +17 -1
- data/lib/mail_spy/manager.rb +9 -24
- data/lib/mail_spy/version.rb +1 -1
- data/lib/mail_spy.rb +29 -4
- data/test/dummy/app/views/email_templates/helper_test.html.erb +15 -0
- data/test/dummy/app/views/email_templates/helper_test.text.erb +11 -0
- data/test/dummy/config/environments/development.rb +1 -1
- data/test/dummy/config/environments/production.rb +5 -1
- data/test/dummy/config/environments/test.rb +4 -1
- data/test/dummy/config/initializers/mail_spy.rb +38 -0
- data/test/dummy/config/routes.rb +0 -1
- data/test/dummy/lib/tasks/emails.rake +8 -0
- data/test/dummy/log/development.log +12 -0
- data/test/dummy/log/test.log +3545 -0
- data/test/functional/mail_spy/core_mailer_test.rb +16 -9
- data/test/functional/mail_spy/tracking_controller_test.rb +1 -9
- data/test/test_email_credentials.yml +2 -2
- data/test/test_email_credentials.yml.sample +0 -8
- data/test/test_helper.rb +15 -41
- data/test/unit/mail_spy/manager_test.rb +91 -125
- metadata +37 -23
- data/app/models/mail_spy/email_template.rb +0 -17
- data/test/fixtures/mail_spy/email_templates.yml +0 -9
- data/test/unit/mail_spy/email_template_test.rb +0 -9
@@ -1,10 +1,9 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
3
|
module MailSpy
|
4
|
-
class CoreMailerTest < ActionMailer::TestCase
|
4
|
+
class CoreMailerTest < ActiveSupport::TestCase #ActionMailer::TestCase
|
5
5
|
|
6
6
|
def teardown
|
7
|
-
MailSpy::EmailTemplate.delete_all
|
8
7
|
MailSpy::Email.delete_all
|
9
8
|
end
|
10
9
|
|
@@ -12,17 +11,25 @@ module MailSpy
|
|
12
11
|
assert true
|
13
12
|
end
|
14
13
|
|
15
|
-
def
|
16
|
-
|
14
|
+
def test_subject_evaluation
|
15
|
+
emails = create_emails(:campaign => "tests", :stream => "a-stream", :component => "a-helper_test")
|
16
|
+
|
17
17
|
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
email = emails.first
|
19
|
+
email.template_values = {:user_name => "bob"}
|
20
|
+
email.subject = "hi <%= @template_values[:user_name] %>"
|
21
|
+
|
22
|
+
mail = MailSpy::CoreMailer.template(emails.first)
|
23
|
+
assert(mail.subject == "hi bob", "subject lines should be interpreted")
|
24
|
+
end
|
25
|
+
|
26
|
+
|
27
|
+
def test_template_email_helpers
|
28
|
+
create_emails(:campaign => "tests", :stream => "a-stream", :component => "a-helper_test")
|
21
29
|
|
22
|
-
template = MailSpy.create_template("a test template", html_erb, text_erb, template_values_definition)
|
23
|
-
create_emails(template)
|
24
30
|
email = MailSpy::Email.first
|
25
31
|
mail = MailSpy::CoreMailer.template(email)
|
32
|
+
mail.deliver
|
26
33
|
|
27
34
|
assert(mail.present?, "Mail should render without error")
|
28
35
|
assert(mail.html_part.body.present?, "Mail should have a html part")
|
@@ -4,19 +4,11 @@ module MailSpy
|
|
4
4
|
class TrackingControllerTest < ActionController::TestCase
|
5
5
|
|
6
6
|
def setup
|
7
|
-
|
8
|
-
|
9
|
-
html_erb = "A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>"
|
10
|
-
text_erb = "A link : <%= track_link 'My home', 'www.google.com' %> <br> A Bug <%= tracking_bug %>"
|
11
|
-
template_values_definition = {}
|
12
|
-
|
13
|
-
template = MailSpy.create_template("a test template", html_erb, text_erb, template_values_definition)
|
14
|
-
create_emails(template)
|
7
|
+
create_emails(:campaign => "tests", :stream => "a-stream", :component => "a-helper_test")
|
15
8
|
@email = MailSpy::Email.first
|
16
9
|
end
|
17
10
|
|
18
11
|
def teardown
|
19
|
-
MailSpy::EmailTemplate.delete_all
|
20
12
|
MailSpy::Email.delete_all
|
21
13
|
end
|
22
14
|
|
@@ -2,8 +2,8 @@ name: sendgrid
|
|
2
2
|
address: smtp.sendgrid.net
|
3
3
|
port: 587
|
4
4
|
domain: herokuapp.com
|
5
|
-
user_name:
|
6
|
-
password:
|
5
|
+
user_name: app2602840@heroku.com
|
6
|
+
password: qb6qnim0
|
7
7
|
authentication: plain
|
8
8
|
enable_starttls_auto: 1
|
9
9
|
test_email_address: trcarden@gmail.com
|
data/test/test_helper.rb
CHANGED
@@ -33,23 +33,6 @@ class ActiveSupport::TestCase
|
|
33
33
|
# Add more helper methods to be used by all tests here...
|
34
34
|
|
35
35
|
|
36
|
-
|
37
|
-
# Adds the ESP settings for a test email
|
38
|
-
def initialize_mail_spy_test_esp
|
39
|
-
path = File.expand_path ".././test_email_credentials.yml", __FILE__
|
40
|
-
credentials = YAML.load(File.open(path)).to_options
|
41
|
-
MailSpy.add_email_service_provider do |esp|
|
42
|
-
esp.name = credentials[:name]
|
43
|
-
esp.address = credentials[:address]
|
44
|
-
esp.port = credentials[:port]
|
45
|
-
esp.domain = credentials[:domain]
|
46
|
-
esp.user_name = credentials[:user_name]
|
47
|
-
esp.password = credentials[:password]
|
48
|
-
esp.authentication = credentials[:authentication]
|
49
|
-
esp.enable_starttls_auto = (credentials[:enable_starttls_auto].to_i == 1)
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
36
|
# Gets the test email address from the setup file
|
54
37
|
def email_address_for_test
|
55
38
|
path = File.expand_path ".././test_email_credentials.yml", __FILE__
|
@@ -57,36 +40,26 @@ class ActiveSupport::TestCase
|
|
57
40
|
credentials[:test_email_address]
|
58
41
|
end
|
59
42
|
|
60
|
-
#
|
61
|
-
def
|
62
|
-
|
63
|
-
html_erb = "Hello World"
|
64
|
-
text_erb = "Hello World"
|
65
|
-
template_values_definition = {}
|
66
|
-
|
67
|
-
template = MailSpy.create_template(template_name, html_erb, text_erb, template_values_definition)
|
68
|
-
block.call(template)
|
69
|
-
end
|
43
|
+
# Creates a test email
|
44
|
+
def create_emails( options={}, num_emails=1)
|
45
|
+
options.to_options!
|
70
46
|
|
71
|
-
|
72
|
-
def create_emails(template, num_emails=1)
|
47
|
+
emails = []
|
73
48
|
num_emails.times do
|
74
|
-
to = email_address_for_test
|
75
|
-
from = "test@test.com"
|
76
|
-
reply_to = "testGuy"
|
77
|
-
subject = "test subject"
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
MailSpy.create_email(
|
49
|
+
to = options[:to] || email_address_for_test
|
50
|
+
from = options[:from]|| "test@test.com"
|
51
|
+
reply_to = options[:reply_to] || "testGuy"
|
52
|
+
subject = options[:subject] || "test subject"
|
53
|
+
campaign = options[:campaign] || "test campaign"
|
54
|
+
stream = options[:stream] || "test stream"
|
55
|
+
component = options[:component] || "test component"
|
56
|
+
schedule_at = options[:schedule_at] || DateTime.now
|
57
|
+
|
58
|
+
emails << MailSpy.create_email(
|
85
59
|
:to => to,
|
86
60
|
:from => from,
|
87
61
|
:reply_to => reply_to,
|
88
62
|
:subject => subject,
|
89
|
-
:template_name => template_name,
|
90
63
|
:template_values => {},
|
91
64
|
:campaign => campaign,
|
92
65
|
:stream => stream,
|
@@ -94,6 +67,7 @@ class ActiveSupport::TestCase
|
|
94
67
|
:schedule_at => schedule_at
|
95
68
|
)
|
96
69
|
end
|
70
|
+
return emails
|
97
71
|
end
|
98
72
|
|
99
73
|
|
@@ -7,158 +7,124 @@ module MailSpy
|
|
7
7
|
end
|
8
8
|
|
9
9
|
def setup
|
10
|
-
MailSpy::EmailTemplate.delete_all
|
11
10
|
MailSpy::Email.delete_all
|
12
11
|
end
|
13
12
|
|
14
|
-
# ------------------------------------------- ADD_TEMPLATE
|
15
|
-
def test_create_template
|
16
|
-
template_name = "test"
|
17
|
-
html_erb = "Hello World"
|
18
|
-
text_erb = "Hello World"
|
19
|
-
template_values_definition = {}
|
20
|
-
|
21
|
-
template = MailSpy.create_template(template_name, html_erb, text_erb, template_values_definition)
|
22
|
-
|
23
|
-
assert(template.html_erb == html_erb, "values should be written")
|
24
|
-
assert(template.text_erb == text_erb, "values should be written")
|
25
|
-
assert(template.template_values_definition == template_values_definition, "values should be written")
|
26
|
-
assert(template.name == template_name, "values should be written")
|
27
|
-
end
|
28
13
|
|
29
14
|
# ------------------------------------------- CREATE EMAIL
|
30
15
|
def test_create_email
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
16
|
+
to = "test@test.com"
|
17
|
+
from = "test@test.com"
|
18
|
+
reply_to = "testGuy"
|
19
|
+
subject = "test subject"
|
20
|
+
campaign = "test campaign"
|
21
|
+
stream = "test stream"
|
22
|
+
component = "test component"
|
23
|
+
schedule_at = DateTime.now
|
24
|
+
|
25
|
+
email = MailSpy.create_email(
|
26
|
+
:to => to,
|
27
|
+
:from => from,
|
28
|
+
:reply_to => reply_to,
|
29
|
+
:subject => subject,
|
30
|
+
:template_values => {},
|
31
|
+
:campaign => campaign,
|
32
|
+
:stream => stream,
|
33
|
+
:component => component,
|
34
|
+
:schedule_at => schedule_at
|
35
|
+
)
|
36
|
+
|
37
|
+
assert(email.to == to, "email subject must be set")
|
38
|
+
assert(email.subject == subject, "email subject must be set")
|
39
|
+
assert(email.campaign == campaign, "email campaign must be set")
|
40
|
+
assert(email.stream == stream, "email stream must be set")
|
41
|
+
assert(email.component == component, "email component must be set")
|
42
|
+
assert(email.schedule_at.to_i == schedule_at.to_i, "email schedule_at must be set")
|
43
|
+
end
|
44
|
+
|
45
|
+
def test_missing_sender
|
46
|
+
from = "test@test.com"
|
47
|
+
reply_to = "testGuy"
|
48
|
+
subject = "test subject"
|
49
|
+
campaign = "test campaign"
|
50
|
+
stream = "test stream"
|
51
|
+
component = "test component"
|
52
|
+
schedule_at = DateTime.now
|
53
|
+
|
54
|
+
assert_raise RuntimeError do
|
55
|
+
MailSpy.create_email(
|
44
56
|
:from => from,
|
45
57
|
:reply_to => reply_to,
|
46
58
|
:subject => subject,
|
47
|
-
:template_name => template_name,
|
48
59
|
:template_values => {},
|
49
60
|
:campaign => campaign,
|
50
61
|
:stream => stream,
|
51
62
|
:component => component,
|
52
63
|
:schedule_at => schedule_at
|
53
64
|
)
|
54
|
-
|
55
|
-
assert(email.to == to, "email subject must be set")
|
56
|
-
assert(email.subject == subject, "email subject must be set")
|
57
|
-
assert(email.template_name == template_name, "email template_name must be set")
|
58
|
-
assert(email.campaign == campaign, "email campaign must be set")
|
59
|
-
assert(email.stream == stream, "email stream must be set")
|
60
|
-
assert(email.component == component, "email component must be set")
|
61
|
-
assert(email.schedule_at.to_i == schedule_at.to_i, "email schedule_at must be set")
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
def test_missing_sender
|
66
|
-
do_with_template do |template|
|
67
|
-
from = "test@test.com"
|
68
|
-
reply_to = "testGuy"
|
69
|
-
subject = "test subject"
|
70
|
-
template_name = template.name
|
71
|
-
campaign = "test campaign"
|
72
|
-
stream = "test stream"
|
73
|
-
component = "test component"
|
74
|
-
schedule_at = DateTime.now
|
75
|
-
|
76
|
-
assert_raise RuntimeError do
|
77
|
-
MailSpy.create_email(
|
78
|
-
:from => from,
|
79
|
-
:reply_to => reply_to,
|
80
|
-
:subject => subject,
|
81
|
-
:template_name => template_name,
|
82
|
-
:template_values => {},
|
83
|
-
:campaign => campaign,
|
84
|
-
:stream => stream,
|
85
|
-
:component => component,
|
86
|
-
:schedule_at => schedule_at
|
87
|
-
)
|
88
|
-
end
|
89
65
|
end
|
90
66
|
end
|
91
67
|
|
92
68
|
def test_missing_required_field
|
93
69
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
component = "test component"
|
102
|
-
schedule_at = DateTime.now
|
103
|
-
|
104
|
-
assert_raise RuntimeError do
|
105
|
-
MailSpy.create_email(
|
106
|
-
:to => to,
|
107
|
-
:from => from,
|
108
|
-
:reply_to => reply_to,
|
109
|
-
:template_name => template_name,
|
110
|
-
:template_values => {},
|
111
|
-
:campaign => campaign,
|
112
|
-
:stream => stream,
|
113
|
-
:component => component,
|
114
|
-
:schedule_at => schedule_at
|
115
|
-
)
|
116
|
-
end
|
117
|
-
end
|
118
|
-
|
119
|
-
end
|
70
|
+
to = "test@test.com"
|
71
|
+
from = "test@test.com"
|
72
|
+
reply_to = "testGuy"
|
73
|
+
campaign = "test campaign"
|
74
|
+
stream = "test stream"
|
75
|
+
component = "test component"
|
76
|
+
schedule_at = DateTime.now
|
120
77
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
assert_raise RuntimeError do
|
133
|
-
MailSpy.create_email(
|
134
|
-
:to => to,
|
135
|
-
:subject => subject,
|
136
|
-
:from => from,
|
137
|
-
:reply_to => reply_to,
|
138
|
-
:template_name => "NOT HERE",
|
139
|
-
:template_values => {},
|
140
|
-
:campaign => campaign,
|
141
|
-
:stream => stream,
|
142
|
-
:component => component,
|
143
|
-
:schedule_at => schedule_at
|
144
|
-
)
|
145
|
-
end
|
78
|
+
assert_raise RuntimeError do
|
79
|
+
MailSpy.create_email(
|
80
|
+
:to => to,
|
81
|
+
:from => from,
|
82
|
+
:reply_to => reply_to,
|
83
|
+
:template_values => {},
|
84
|
+
:campaign => campaign,
|
85
|
+
:stream => stream,
|
86
|
+
:component => component,
|
87
|
+
:schedule_at => schedule_at
|
88
|
+
)
|
146
89
|
end
|
147
90
|
end
|
148
91
|
|
149
|
-
|
92
|
+
end
|
150
93
|
|
151
|
-
|
152
|
-
|
153
|
-
|
94
|
+
def test_referencing_missing_template
|
95
|
+
to = "test@test.com"
|
96
|
+
from = "test@test.com"
|
97
|
+
reply_to = "testGuy"
|
98
|
+
subject = "test subject"
|
99
|
+
campaign = "NO SUCH CAMPAIGN"
|
100
|
+
stream = "NO SUCH STREAM"
|
101
|
+
component = "NO SUCH COMPONENT"
|
102
|
+
schedule_at = DateTime.now
|
103
|
+
|
104
|
+
assert_raise RuntimeError do
|
105
|
+
MailSpy.create_email(
|
106
|
+
:to => to,
|
107
|
+
:subject => subject,
|
108
|
+
:from => from,
|
109
|
+
:reply_to => reply_to,
|
110
|
+
:template_values => {},
|
111
|
+
:campaign => campaign,
|
112
|
+
:stream => stream,
|
113
|
+
:component => component,
|
114
|
+
:schedule_at => schedule_at
|
115
|
+
)
|
116
|
+
end
|
117
|
+
end
|
154
118
|
|
155
|
-
|
156
|
-
|
157
|
-
|
119
|
+
# ------------------------------------------- SEND_OUTSTANDING_EMAILS
|
120
|
+
|
121
|
+
#TODO need to document the testing methods for setting up the test_email
|
122
|
+
def test_send_outstanding_emails
|
123
|
+
create_emails(:campaign => "tests", :stream => "a-stream", :component => "a-helper_test")
|
158
124
|
|
159
|
-
num_sent = MailSpy.send_outstanding_emails
|
160
|
-
assert(num_sent == 1, "We should have sent a email")
|
161
|
-
end
|
162
125
|
|
126
|
+
num_sent = MailSpy.send_outstanding_emails
|
127
|
+
assert(num_sent == 1, "We should have sent a email")
|
163
128
|
end
|
129
|
+
|
164
130
|
end
|
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.
|
5
|
+
version: 0.0.5
|
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-01-
|
13
|
+
date: 2012-01-31 00:00:00 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -57,18 +57,18 @@ dependencies:
|
|
57
57
|
type: :runtime
|
58
58
|
version_requirements: *id004
|
59
59
|
- !ruby/object:Gem::Dependency
|
60
|
-
name:
|
60
|
+
name: aws-sdk
|
61
61
|
prerelease: false
|
62
62
|
requirement: &id005 !ruby/object:Gem::Requirement
|
63
63
|
none: false
|
64
64
|
requirements:
|
65
65
|
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
68
|
-
type: :
|
67
|
+
version: 1.3.2
|
68
|
+
type: :runtime
|
69
69
|
version_requirements: *id005
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
|
-
name:
|
71
|
+
name: sqlite3
|
72
72
|
prerelease: false
|
73
73
|
requirement: &id006 !ruby/object:Gem::Requirement
|
74
74
|
none: false
|
@@ -79,7 +79,7 @@ dependencies:
|
|
79
79
|
type: :development
|
80
80
|
version_requirements: *id006
|
81
81
|
- !ruby/object:Gem::Dependency
|
82
|
-
name:
|
82
|
+
name: turn
|
83
83
|
prerelease: false
|
84
84
|
requirement: &id007 !ruby/object:Gem::Requirement
|
85
85
|
none: false
|
@@ -90,7 +90,7 @@ dependencies:
|
|
90
90
|
type: :development
|
91
91
|
version_requirements: *id007
|
92
92
|
- !ruby/object:Gem::Dependency
|
93
|
-
name:
|
93
|
+
name: rr
|
94
94
|
prerelease: false
|
95
95
|
requirement: &id008 !ruby/object:Gem::Requirement
|
96
96
|
none: false
|
@@ -101,7 +101,7 @@ dependencies:
|
|
101
101
|
type: :development
|
102
102
|
version_requirements: *id008
|
103
103
|
- !ruby/object:Gem::Dependency
|
104
|
-
name:
|
104
|
+
name: factory_girl
|
105
105
|
prerelease: false
|
106
106
|
requirement: &id009 !ruby/object:Gem::Requirement
|
107
107
|
none: false
|
@@ -112,29 +112,29 @@ dependencies:
|
|
112
112
|
type: :development
|
113
113
|
version_requirements: *id009
|
114
114
|
- !ruby/object:Gem::Dependency
|
115
|
-
name:
|
115
|
+
name: factory_girl_rails
|
116
116
|
prerelease: false
|
117
117
|
requirement: &id010 !ruby/object:Gem::Requirement
|
118
118
|
none: false
|
119
119
|
requirements:
|
120
|
-
- - "
|
120
|
+
- - ">="
|
121
121
|
- !ruby/object:Gem::Version
|
122
|
-
version: 0
|
122
|
+
version: "0"
|
123
123
|
type: :development
|
124
124
|
version_requirements: *id010
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name: spork
|
126
|
+
name: spork
|
127
127
|
prerelease: false
|
128
128
|
requirement: &id011 !ruby/object:Gem::Requirement
|
129
129
|
none: false
|
130
130
|
requirements:
|
131
|
-
- - "
|
131
|
+
- - ">"
|
132
132
|
- !ruby/object:Gem::Version
|
133
|
-
version:
|
133
|
+
version: 0.9.0.rc
|
134
134
|
type: :development
|
135
135
|
version_requirements: *id011
|
136
136
|
- !ruby/object:Gem::Dependency
|
137
|
-
name:
|
137
|
+
name: spork-testunit
|
138
138
|
prerelease: false
|
139
139
|
requirement: &id012 !ruby/object:Gem::Requirement
|
140
140
|
none: false
|
@@ -145,7 +145,7 @@ dependencies:
|
|
145
145
|
type: :development
|
146
146
|
version_requirements: *id012
|
147
147
|
- !ruby/object:Gem::Dependency
|
148
|
-
name:
|
148
|
+
name: ruby-prof
|
149
149
|
prerelease: false
|
150
150
|
requirement: &id013 !ruby/object:Gem::Requirement
|
151
151
|
none: false
|
@@ -156,7 +156,7 @@ dependencies:
|
|
156
156
|
type: :development
|
157
157
|
version_requirements: *id013
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
|
-
name:
|
159
|
+
name: minitest
|
160
160
|
prerelease: false
|
161
161
|
requirement: &id014 !ruby/object:Gem::Requirement
|
162
162
|
none: false
|
@@ -166,6 +166,17 @@ dependencies:
|
|
166
166
|
version: "0"
|
167
167
|
type: :development
|
168
168
|
version_requirements: *id014
|
169
|
+
- !ruby/object:Gem::Dependency
|
170
|
+
name: timecop
|
171
|
+
prerelease: false
|
172
|
+
requirement: &id015 !ruby/object:Gem::Requirement
|
173
|
+
none: false
|
174
|
+
requirements:
|
175
|
+
- - ">="
|
176
|
+
- !ruby/object:Gem::Version
|
177
|
+
version: "0"
|
178
|
+
type: :development
|
179
|
+
version_requirements: *id015
|
169
180
|
description: Mailspy allows for quick and easy creation, sending and tracking of email campaigns
|
170
181
|
email:
|
171
182
|
- trcarden@gmail.com
|
@@ -189,7 +200,6 @@ files:
|
|
189
200
|
- app/models/mail_spy/campaign_report.rb
|
190
201
|
- app/models/mail_spy/component_report.rb
|
191
202
|
- app/models/mail_spy/email.rb
|
192
|
-
- app/models/mail_spy/email_template.rb
|
193
203
|
- app/models/mail_spy/stream_report.rb
|
194
204
|
- app/views/layouts/mail_spy/application.html.erb
|
195
205
|
- config/routes.rb
|
@@ -207,6 +217,8 @@ files:
|
|
207
217
|
- test/dummy/app/assets/stylesheets/application.css
|
208
218
|
- test/dummy/app/controllers/application_controller.rb
|
209
219
|
- test/dummy/app/helpers/application_helper.rb
|
220
|
+
- test/dummy/app/views/email_templates/helper_test.html.erb
|
221
|
+
- test/dummy/app/views/email_templates/helper_test.text.erb
|
210
222
|
- test/dummy/app/views/layouts/application.html.erb
|
211
223
|
- test/dummy/config/application.rb
|
212
224
|
- test/dummy/config/boot.rb
|
@@ -217,6 +229,7 @@ files:
|
|
217
229
|
- test/dummy/config/environments/test.rb
|
218
230
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
219
231
|
- test/dummy/config/initializers/inflections.rb
|
232
|
+
- test/dummy/config/initializers/mail_spy.rb
|
220
233
|
- test/dummy/config/initializers/mime_types.rb
|
221
234
|
- test/dummy/config/initializers/secret_token.rb
|
222
235
|
- test/dummy/config/initializers/session_store.rb
|
@@ -228,6 +241,7 @@ files:
|
|
228
241
|
- test/dummy/db/development.sqlite3
|
229
242
|
- test/dummy/db/seeds.rb
|
230
243
|
- test/dummy/db/test.sqlite3
|
244
|
+
- test/dummy/lib/tasks/emails.rake
|
231
245
|
- test/dummy/log/development.log
|
232
246
|
- test/dummy/log/test.log
|
233
247
|
- test/dummy/public/404.html
|
@@ -240,7 +254,6 @@ files:
|
|
240
254
|
- test/fixtures/mail_spy/actions.yml
|
241
255
|
- test/fixtures/mail_spy/campaign_reports.yml
|
242
256
|
- test/fixtures/mail_spy/component_reports.yml
|
243
|
-
- test/fixtures/mail_spy/email_templates.yml
|
244
257
|
- test/fixtures/mail_spy/emails.yml
|
245
258
|
- test/fixtures/mail_spy/stream_reports.yml
|
246
259
|
- test/functional/mail_spy/core_mailer_test.rb
|
@@ -254,7 +267,6 @@ files:
|
|
254
267
|
- test/unit/mail_spy/action_test.rb
|
255
268
|
- test/unit/mail_spy/campaign_report_test.rb
|
256
269
|
- test/unit/mail_spy/component_report_test.rb
|
257
|
-
- test/unit/mail_spy/email_template_test.rb
|
258
270
|
- test/unit/mail_spy/email_test.rb
|
259
271
|
- test/unit/mail_spy/manager_test.rb
|
260
272
|
- test/unit/mail_spy/stream_report_test.rb
|
@@ -290,6 +302,8 @@ test_files:
|
|
290
302
|
- test/dummy/app/assets/stylesheets/application.css
|
291
303
|
- test/dummy/app/controllers/application_controller.rb
|
292
304
|
- test/dummy/app/helpers/application_helper.rb
|
305
|
+
- test/dummy/app/views/email_templates/helper_test.html.erb
|
306
|
+
- test/dummy/app/views/email_templates/helper_test.text.erb
|
293
307
|
- test/dummy/app/views/layouts/application.html.erb
|
294
308
|
- test/dummy/config/application.rb
|
295
309
|
- test/dummy/config/boot.rb
|
@@ -300,6 +314,7 @@ test_files:
|
|
300
314
|
- test/dummy/config/environments/test.rb
|
301
315
|
- test/dummy/config/initializers/backtrace_silencers.rb
|
302
316
|
- test/dummy/config/initializers/inflections.rb
|
317
|
+
- test/dummy/config/initializers/mail_spy.rb
|
303
318
|
- test/dummy/config/initializers/mime_types.rb
|
304
319
|
- test/dummy/config/initializers/secret_token.rb
|
305
320
|
- test/dummy/config/initializers/session_store.rb
|
@@ -311,6 +326,7 @@ test_files:
|
|
311
326
|
- test/dummy/db/development.sqlite3
|
312
327
|
- test/dummy/db/seeds.rb
|
313
328
|
- test/dummy/db/test.sqlite3
|
329
|
+
- test/dummy/lib/tasks/emails.rake
|
314
330
|
- test/dummy/log/development.log
|
315
331
|
- test/dummy/log/test.log
|
316
332
|
- test/dummy/public/404.html
|
@@ -323,7 +339,6 @@ test_files:
|
|
323
339
|
- test/fixtures/mail_spy/actions.yml
|
324
340
|
- test/fixtures/mail_spy/campaign_reports.yml
|
325
341
|
- test/fixtures/mail_spy/component_reports.yml
|
326
|
-
- test/fixtures/mail_spy/email_templates.yml
|
327
342
|
- test/fixtures/mail_spy/emails.yml
|
328
343
|
- test/fixtures/mail_spy/stream_reports.yml
|
329
344
|
- test/functional/mail_spy/core_mailer_test.rb
|
@@ -337,7 +352,6 @@ test_files:
|
|
337
352
|
- test/unit/mail_spy/action_test.rb
|
338
353
|
- test/unit/mail_spy/campaign_report_test.rb
|
339
354
|
- test/unit/mail_spy/component_report_test.rb
|
340
|
-
- test/unit/mail_spy/email_template_test.rb
|
341
355
|
- test/unit/mail_spy/email_test.rb
|
342
356
|
- test/unit/mail_spy/manager_test.rb
|
343
357
|
- test/unit/mail_spy/stream_report_test.rb
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module MailSpy
|
2
|
-
class EmailTemplate
|
3
|
-
include Mongoid::Document
|
4
|
-
include Mongoid::Timestamps
|
5
|
-
field :name, :type => String
|
6
|
-
field :html_erb, :type => String
|
7
|
-
field :text_erb, :type => String
|
8
|
-
field :template_values_definition, :type => Hash
|
9
|
-
|
10
|
-
index :name, :unique => true
|
11
|
-
|
12
|
-
has_many :emails, :class_name => 'MailSpy::Email'
|
13
|
-
|
14
|
-
validates_presence_of :name
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|