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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9aca20aafd1e56b9e9ad18a3cfb20687f5d7103ecfadb7922e84bc3118f20bfe
4
- data.tar.gz: bba60e05f4c42a2ed4503857cabe3850ecc7ad2a69141a8b557aeda34291cddc
3
+ metadata.gz: fa8df14c5e40849d2ad21254078fb29ec82db0f2d5a26d2db84f40fad10dd52a
4
+ data.tar.gz: 2458f39fc29d97736b31be766b673b7259be8760ed1dfe1e2c1decc78738ba79
5
5
  SHA512:
6
- metadata.gz: 36d2fc6af679b3764430b0751b15d5b19eeb138b3bda70f7029a41855742be21ed91d57a0c132676c1a50b8d9d31347530bb87b5537b7610458536340fb9ea3f
7
- data.tar.gz: d3559e960ac46c6cfa7ad786789d80b614cb40fa1416f4edd0cd19c70c6c448c77f247aa0829dbfd3e1cda370246e94dde6083ed8a9156bc41f2db244e75c849
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("../test/dummy/Rakefile", __FILE__)
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,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Mailout::ApplicationCable::Channel < ActionCable::Channel::Base
2
4
  end
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Mailout::ApplicationCable::Connection < ActionCable::Connection::Base
2
4
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Mailout
3
5
  class ApplicationController < ActionController::Base
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ class Admin::Tramway::Mailout::SessionForm < ::Tramway::Core::ApplicationForm
4
+ properties :campaign_id, :campaign_type, :mailing_state, :mailing_state_event
5
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Mailout
3
5
  module ApplicationHelper
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Mailout
3
5
  class ApplicationJob < ActiveJob::Base
@@ -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, &block)
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.send :just_message, contact.email, template.title, template.body
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(email, title, body)
6
+ def just_message(receiver_email, sender_email, title, body)
5
7
  @body = body
6
- mail from: 'Test', to: email, subject: title
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
- :later,
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
 
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  Tramway::Mailout::Engine.routes.draw do
2
4
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # desc "Explaining what the task does"
2
4
  # task :tramway_mailout do
3
5
  # # Task goes here
@@ -1,4 +1,6 @@
1
- require "tramway/mailout/engine"
1
+ # frozen_string_literal: true
2
+
3
+ require 'tramway/mailout/engine'
2
4
  require 'tramway/mailout/generates/install_generator'
3
5
  require 'tramway/mailout/job_proxy'
4
6
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'sidekiq'
2
4
 
3
5
  module Tramway
@@ -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('../templates', __FILE__)
9
+ source_root File.expand_path('templates', __dir__)
8
10
 
9
11
  def run_other_generators
10
12
  generate 'tramway:core:install'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class CreateTramwayMailoutSessions < ActiveRecord::Migration[5.1]
2
4
  def change
3
5
  create_table :tramway_mailout_sessions do |t|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway::Mailout::JobProxy
2
4
  class << self
3
5
  def perform_job(job_class, mode, *args)
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Tramway
2
4
  module Mailout
3
- VERSION = '0.1.0.2'
5
+ VERSION = '0.1.0.3'
4
6
  end
5
7
  end
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.2
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: 2018-02-05 00:00:00.000000000 Z
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: tramway-core
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: sidekiq
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
- rubyforge_project:
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
@@ -1,3 +0,0 @@
1
- class Tramway::Mailout::SessionForm < ::Tramway::Core::ApplicationForm
2
- properties :campaign_id, :campaign_type, :mailing_state, :mailing_state_event
3
- end