mail_manager 3.2.1 → 3.2.2
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.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/app/models/mail_manager/mailing.rb +6 -2
- data/app/views/mail_manager/mailings/index.html.erb +5 -4
- data/lib/mail_manager/version.rb +1 -1
- data/lib/tasks/mail_manager.rake +4 -0
- data/mail_manager.gemspec +2 -2
- data/spec/test_app/db/structure.sql +3 -3
- data/spec/test_app/spec/features/mail_manager/mailing_spec.rb +1 -1
- data/spec/test_app/spec/models/mail_manager/mailing_spec.rb +10 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b444aa191cc3f0026ee9f5934f8ff6d64e7a2a5
|
4
|
+
data.tar.gz: d8f188339a7d1e3799348b560348c182cbdd9d9b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bab64c443443b55a2e3b0158c46a4971b37c6b45926ea91acd8e90c8b807d6e43c145c01e908e47c3c3f2bc394c62c2bad7f7ea8cd91f9a492b0de852d4ec220
|
7
|
+
data.tar.gz: 7ad7d02707c79454a10c0b2d9b18c8f5d507576f773df76e689589019797c4d3ed16406dd4e053e8012c13293796f0ed66c9277644f017ccc1dddd89861ed923
|
data/README.md
CHANGED
@@ -3,6 +3,8 @@ Mail Manager
|
|
3
3
|
|
4
4
|
The goal of this project will be to create a plugin for use in any site which will provide an interface to manage mailing lists, scheduling of email mailings, subscribe/unsubscribe from lists by contacts, and view reports of bounces and possible track views of emails. Currently, only one list is supported for subscribe/unsubscribe by contact. An interface is available to provide mailable objects from other plugins.
|
5
5
|
|
6
|
+
See the latest docs at the [Homepage](http://ireachnews.com) or the [Wiki](https://github.com/LoneStarInternet/mail_manager/wiki)
|
7
|
+
|
6
8
|
Requirements
|
7
9
|
------------
|
8
10
|
* Rails 3.2.x (currently tested with rails 3.2.21)
|
@@ -53,7 +53,7 @@ module MailManager
|
|
53
53
|
def deliver
|
54
54
|
Rails.logger.info "Starting to Process Mailing '#{subject}' ID:#{id}"
|
55
55
|
Lock.with_lock("mail_mgr_mailing_send[#{id}]") do |lock|
|
56
|
-
unless
|
56
|
+
unless can_run?
|
57
57
|
raise Exception.new("Mailing was not scheduled when job tried to run!")
|
58
58
|
end
|
59
59
|
unless scheduled_at <= Time.now
|
@@ -210,6 +210,10 @@ module MailManager
|
|
210
210
|
def can_cancel?
|
211
211
|
['pending','scheduled','processing'].include?(status.to_s)
|
212
212
|
end
|
213
|
+
|
214
|
+
def can_run?
|
215
|
+
['scheduled','processing'].include?(status.to_s)
|
216
|
+
end
|
213
217
|
|
214
218
|
def can_schedule?
|
215
219
|
['pending'].include?(status.to_s) && scheduled_at.present?
|
@@ -230,7 +234,7 @@ module MailManager
|
|
230
234
|
end
|
231
235
|
|
232
236
|
def mailing_jobs
|
233
|
-
Delayed::Job.where("handler like ?","%MailManager::Mailing
|
237
|
+
Delayed::Job.where("handler like ?","%MailManager::Mailing% id: #{self.id}\n%")
|
234
238
|
end
|
235
239
|
|
236
240
|
def cancel
|
@@ -20,11 +20,12 @@
|
|
20
20
|
<% if mailing.can_edit? %>
|
21
21
|
<%= link_to 'Edit', mail_manager.edit_mailing_path(mailing), :class => 'button' %>
|
22
22
|
<% if mailing.can_schedule? %>
|
23
|
-
<%= link_to 'Schedule', mail_manager.schedule_mailing_path(mailing), :method => :put, :class => 'button', :confirm => "Are you sure you want to start the mailing at #{l(mailing.scheduled_at) rescue "N/A"}?" %>
|
24
|
-
<% elsif mailing.can_cancel? %>
|
25
|
-
<%= link_to 'Cancel', mail_manager.cancel_mailing_path(mailing), :method => :put, :class => 'button', :id => "cancel_mailing_#{mailing.id}" %>
|
26
|
-
<% end %>
|
23
|
+
<%= link_to 'Schedule', mail_manager.schedule_mailing_path(mailing), :method => :put, :class => 'button', :id => "schedule_mailing_#{mailing.id}", :confirm => "Are you sure you want to start the mailing at #{l(mailing.scheduled_at) rescue "N/A"}?" %>
|
27
24
|
<% end %>
|
25
|
+
<% end %>
|
26
|
+
<% if mailing.can_cancel? %>
|
27
|
+
<%= link_to 'Cancel', mail_manager.cancel_mailing_path(mailing), :method => :put, :class => 'button', :id => "cancel_mailing_#{mailing.id}" %>
|
28
|
+
<% end %>
|
28
29
|
<% if mailing.messages.size > 0 %>
|
29
30
|
<%= link_to 'Messages', mail_manager.mailing_messages_path(mailing), :class => 'button' %>
|
30
31
|
<% end %>
|
data/lib/mail_manager/version.rb
CHANGED
data/lib/tasks/mail_manager.rake
CHANGED
@@ -13,6 +13,10 @@ def get_config(env,filename='config/mail_manager.yml')
|
|
13
13
|
end
|
14
14
|
|
15
15
|
namespace :mail_manager do
|
16
|
+
desc "Upgrade tasks" do
|
17
|
+
Rake::Task['mail_manager:import_migrations'].invoke
|
18
|
+
Rake::Task['db:migrate'].invoke
|
19
|
+
end
|
16
20
|
desc "Add mlm defaults to config/mail_manager.yml"
|
17
21
|
task :default_app_config, :table_prefix do |t,args|
|
18
22
|
Rails.logger.warn "Adding defaults to config/mail_manager.yml"
|
data/mail_manager.gemspec
CHANGED
@@ -7,11 +7,11 @@ Gem::Specification.new do |gem|
|
|
7
7
|
gem.name = "mail_manager"
|
8
8
|
gem.version = MailManager::VERSION
|
9
9
|
gem.authors = ["Lone Star Internet"]
|
10
|
-
gem.email = ["biz@lone-star.net"]
|
10
|
+
gem.email = ["biz@lone-star.net", 'chauboldt@lone-star.net']
|
11
11
|
gem.licenses = ["MIT"]
|
12
12
|
gem.description = %q{Manages the delivery of mailable items. Handles bounces, unsubscribe, opt-in, etc.}
|
13
13
|
gem.summary = %q{Mailing list management tool}
|
14
|
-
gem.homepage = "http://
|
14
|
+
gem.homepage = "http://ireachnews.com"
|
15
15
|
|
16
16
|
gem.add_dependency "rails", "~>3.2"
|
17
17
|
gem.add_dependency 'jquery-rails', "~>3.1"
|
@@ -13,7 +13,7 @@ CREATE TABLE `delayed_jobs` (
|
|
13
13
|
`updated_at` datetime NOT NULL,
|
14
14
|
PRIMARY KEY (`id`),
|
15
15
|
KEY `delayed_jobs_priority` (`priority`,`run_at`)
|
16
|
-
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
16
|
+
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
17
17
|
|
18
18
|
CREATE TABLE `mail_manager_bounces` (
|
19
19
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
@@ -43,7 +43,7 @@ CREATE TABLE `mail_manager_contacts` (
|
|
43
43
|
`login_token` varchar(255) DEFAULT NULL,
|
44
44
|
`login_token_created_at` datetime DEFAULT NULL,
|
45
45
|
PRIMARY KEY (`id`)
|
46
|
-
) ENGINE=InnoDB
|
46
|
+
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
|
47
47
|
|
48
48
|
CREATE TABLE `mail_manager_mailables` (
|
49
49
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
@@ -91,7 +91,7 @@ CREATE TABLE `mail_manager_mailings` (
|
|
91
91
|
`messages_count` int(11) DEFAULT '0',
|
92
92
|
`deleted_at` datetime DEFAULT NULL,
|
93
93
|
PRIMARY KEY (`id`)
|
94
|
-
) ENGINE=InnoDB AUTO_INCREMENT=
|
94
|
+
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;
|
95
95
|
|
96
96
|
CREATE TABLE `mail_manager_messages` (
|
97
97
|
`id` int(11) NOT NULL AUTO_INCREMENT,
|
@@ -27,7 +27,7 @@ RSpec.feature MailManager::Mailing, type: :feature do
|
|
27
27
|
click_link "Schedule"
|
28
28
|
expect(page).to have_content "Mailing scheduled"
|
29
29
|
@mailing = MailManager::Mailing.find(@mailing)
|
30
|
-
|
30
|
+
expect(@mailing.status).to eq "scheduled"
|
31
31
|
expect(Delayed::Job.count).to eq 1
|
32
32
|
and_it "can then be cancelled and its job removed" do
|
33
33
|
mailing2 = FactoryGirl.create(:mailing)
|
@@ -10,6 +10,16 @@ RSpec.describe MailManager::Mailing do
|
|
10
10
|
Delayed::Worker.delay_jobs = false
|
11
11
|
ActionMailer::Base.deliveries.clear
|
12
12
|
end
|
13
|
+
it "allows a processing mailing to run(for resetting a failed job)" do
|
14
|
+
mailing = MailManager::Mailing.create(valid_attributes)
|
15
|
+
mailing.change_status(:processing)
|
16
|
+
expect(mailing.can_run?).to be true
|
17
|
+
end
|
18
|
+
it "allows a processing mailing to run(for resetting a failed job)" do
|
19
|
+
mailing = MailManager::Mailing.create(valid_attributes)
|
20
|
+
mailing.change_status(:processing)
|
21
|
+
expect(mailing.can_run?).to be true
|
22
|
+
end
|
13
23
|
it "sets its initial status properly" do
|
14
24
|
attributes = valid_attributes
|
15
25
|
attributes.delete('status')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mail_manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lone Star Internet
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-04-
|
11
|
+
date: 2015-04-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -196,6 +196,7 @@ description: Manages the delivery of mailable items. Handles bounces, unsubscrib
|
|
196
196
|
opt-in, etc.
|
197
197
|
email:
|
198
198
|
- biz@lone-star.net
|
199
|
+
- chauboldt@lone-star.net
|
199
200
|
executables: []
|
200
201
|
extensions: []
|
201
202
|
extra_rdoc_files: []
|
@@ -484,7 +485,7 @@ files:
|
|
484
485
|
- spec/test_app/spec/views/users/index.html.erb_spec.rb
|
485
486
|
- spec/test_app/spec/views/users/new.html.erb_spec.rb
|
486
487
|
- spec/test_app/spec/views/users/show.html.erb_spec.rb
|
487
|
-
homepage: http://
|
488
|
+
homepage: http://ireachnews.com
|
488
489
|
licenses:
|
489
490
|
- MIT
|
490
491
|
metadata: {}
|