tramway-mailout 0.1.0.2 → 0.1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -5
- data/app/channels/tramway/mailout/application_cable/channel.rb +2 -0
- data/app/channels/tramway/mailout/application_cable/connection.rb +2 -0
- data/app/controllers/tramway/mailout/application_controller.rb +2 -0
- data/app/forms/admin/tramway/mailout/session_form.rb +5 -0
- data/app/helpers/tramway/mailout/application_helper.rb +2 -0
- data/app/jobs/tramway/mailout/application_job.rb +2 -0
- data/app/jobs/tramway/mailout/mailing_job.rb +4 -2
- data/app/mailers/tramway/mailout/application_mailer.rb +4 -2
- data/app/models/tramway/mailout/session.rb +5 -2
- data/app/views/tramway/mailout/application_mailer/just_message.html.haml +1 -0
- data/config/routes.rb +2 -0
- data/lib/tasks/tramway/mailout_tasks.rake +2 -0
- data/lib/tramway/mailout.rb +3 -1
- data/lib/tramway/mailout/engine.rb +2 -0
- data/lib/tramway/mailout/generates/install_generator.rb +3 -1
- data/lib/tramway/mailout/generates/templates/create_tramway_mailout_sessions.rb +2 -0
- data/lib/tramway/mailout/job_proxy.rb +2 -0
- data/lib/tramway/mailout/version.rb +3 -1
- metadata +7 -7
- data/app/forms/tramway/mailout/session_form.rb +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa8df14c5e40849d2ad21254078fb29ec82db0f2d5a26d2db84f40fad10dd52a
|
4
|
+
data.tar.gz: 2458f39fc29d97736b31be766b673b7259be8760ed1dfe1e2c1decc78738ba79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5807e0824a92e91aa5616132e4e9fe3555a03994a3790154109f724d6b32b5ede2e856e8d67eebb9ded537e1c6568c75960774d9ef014d1a6c4cc4a6437eaf9
|
7
|
+
data.tar.gz: 2aeedaf1103dd8fe156030d933fd90dea6dc522cdd159b9cbde32cdd85b78dc225177e4bf136667aaf02e5e7cac64ab6f87104fbf168521e390a5750804c8f9c
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
begin
|
2
4
|
require 'bundler/setup'
|
3
5
|
rescue LoadError
|
@@ -14,14 +16,11 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
16
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
17
|
end
|
16
18
|
|
17
|
-
APP_RAKEFILE = File.expand_path(
|
19
|
+
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
|
18
20
|
load 'rails/tasks/engine.rake'
|
19
21
|
|
20
|
-
|
21
22
|
load 'rails/tasks/statistics.rake'
|
22
23
|
|
23
|
-
|
24
|
-
|
25
24
|
require 'bundler/gem_tasks'
|
26
25
|
|
27
26
|
require 'rake/testtask'
|
@@ -32,5 +31,4 @@ Rake::TestTask.new(:test) do |t|
|
|
32
31
|
t.verbose = false
|
33
32
|
end
|
34
33
|
|
35
|
-
|
36
34
|
task default: :test
|
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Tramway::Mailout::MailingJob < ActiveJob::Base
|
2
4
|
queue_as :default
|
3
5
|
|
4
|
-
def perform(contacts, template, mailer,
|
6
|
+
def perform(contacts, template, mailer, sender_email)
|
5
7
|
contacts.each_slice(100) do |combination|
|
6
8
|
combination.each do |contact|
|
7
|
-
mailer.constantize.delay.
|
9
|
+
mailer.constantize.delay.just_message contact.email, sender_email, template.title, template.filled_body(contact)
|
8
10
|
yield if block_given?
|
9
11
|
end
|
10
12
|
end
|
@@ -1,9 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Tramway
|
2
4
|
module Mailout
|
3
5
|
class ApplicationMailer < ActionMailer::Base
|
4
|
-
def just_message(
|
6
|
+
def just_message(receiver_email, sender_email, title, body)
|
5
7
|
@body = body
|
6
|
-
mail from:
|
8
|
+
mail from: sender_email, to: receiver_email, subject: title
|
7
9
|
end
|
8
10
|
end
|
9
11
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'tramway/mailout/job_proxy'
|
2
4
|
|
3
5
|
module Tramway::Mailout
|
@@ -30,10 +32,11 @@ module Tramway::Mailout
|
|
30
32
|
|
31
33
|
after_transition aborted: :during do |session|
|
32
34
|
::Tramway::Mailout::JobProxy.perform_job ::Tramway::Mailout::MailingJob,
|
33
|
-
:
|
35
|
+
:now,
|
34
36
|
session.campaign.contacts,
|
35
37
|
session.campaign.strategy.touches.first.mail_template,
|
36
|
-
::Tramway::Mailout::ApplicationMailer
|
38
|
+
::Tramway::Mailout::ApplicationMailer,
|
39
|
+
session.campaign.sender_email
|
37
40
|
end
|
38
41
|
end
|
39
42
|
|
@@ -0,0 +1 @@
|
|
1
|
+
!= @body
|
data/config/routes.rb
CHANGED
data/lib/tramway/mailout.rb
CHANGED
@@ -1,10 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rails/generators'
|
2
4
|
require 'tramway/core/generators/install_generator'
|
3
5
|
|
4
6
|
module Tramway::Mailout::Generators
|
5
7
|
class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
|
6
8
|
include Rails::Generators::Migration
|
7
|
-
source_root File.expand_path('
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
8
10
|
|
9
11
|
def run_other_generators
|
10
12
|
generate 'tramway:core:install'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-mailout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.0.
|
4
|
+
version: 0.1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -25,7 +25,7 @@ dependencies:
|
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 5.1.4
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: sidekiq
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: tramway-core
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -68,12 +68,13 @@ files:
|
|
68
68
|
- app/channels/tramway/mailout/application_cable/channel.rb
|
69
69
|
- app/channels/tramway/mailout/application_cable/connection.rb
|
70
70
|
- app/controllers/tramway/mailout/application_controller.rb
|
71
|
-
- app/forms/tramway/mailout/session_form.rb
|
71
|
+
- app/forms/admin/tramway/mailout/session_form.rb
|
72
72
|
- app/helpers/tramway/mailout/application_helper.rb
|
73
73
|
- app/jobs/tramway/mailout/application_job.rb
|
74
74
|
- app/jobs/tramway/mailout/mailing_job.rb
|
75
75
|
- app/mailers/tramway/mailout/application_mailer.rb
|
76
76
|
- app/models/tramway/mailout/session.rb
|
77
|
+
- app/views/tramway/mailout/application_mailer/just_message.html.haml
|
77
78
|
- config/locales/state_machines.yml
|
78
79
|
- config/routes.rb
|
79
80
|
- lib/tasks/tramway/mailout_tasks.rake
|
@@ -102,8 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
102
103
|
- !ruby/object:Gem::Version
|
103
104
|
version: '0'
|
104
105
|
requirements: []
|
105
|
-
|
106
|
-
rubygems_version: 2.7.3
|
106
|
+
rubygems_version: 3.0.3
|
107
107
|
signing_key:
|
108
108
|
specification_version: 4
|
109
109
|
summary: Rails Engine for your mailouts
|