effective_polls 0.4.1 → 0.5.0

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: e2a4120a9cd2b5fbc37b308c90a3a7be20ce79fb037397a6636ddfdbac3d282c
4
- data.tar.gz: 56b216f17de807b939d873abd94a4e01d51d4db0e87b3b70cc10c7a3c29e9b61
3
+ metadata.gz: e014f4462a07752d6e06f332934f392c6b396c0f7f6279501f11036005d627fa
4
+ data.tar.gz: a108863da8039d6aa608d10aa043fef580b435c5c8dff564d382e69120338027
5
5
  SHA512:
6
- metadata.gz: 9578aa8b280568129a0f6e08e50bd7d468bcf1b437ad4cdbbd33674f6b16e9d84cea00dde23c054619d31f4d04f83d8aa44d66dc1a891f514c93e6a5243db300
7
- data.tar.gz: c70422cee9227111893240ba47d54f7779fb65a5a3abd5f8e9c19aaa71756abf46b1a08b28749774a4dc97287e561281ffeefc3c073ca44c8f31373bfda558d7
6
+ metadata.gz: e790818639b367c3357f162ff66ee9f795242e337f01d79bab869d0fd63da2b6a9b7b82b097793149f8e1576460253945535161d5e982023e471fa7f3c47b431
7
+ data.tar.gz: 7197c7a2dcec5fb46a781e5979998ed9602e2dda492f9c885b1f8b3b0be28dc9796255b0e7a9f9a7ccf42b3a4ced34f6e61b81d32fc8fa8cb41699b4fe13d196
@@ -2,7 +2,7 @@ module Effective
2
2
  class PollsMailer < EffectivePolls.parent_mailer_class
3
3
 
4
4
  include EffectiveMailer
5
- include EffectiveEmailTemplatesMailer if EffectivePolls.use_effective_email_templates
5
+ include EffectiveEmailTemplatesMailer
6
6
 
7
7
  def poll_upcoming_reminder(poll_notification, user)
8
8
  @assigns = effective_email_templates_assigns(poll_notification, user)
@@ -70,7 +70,6 @@ module Effective
70
70
  raise('expected poll to be persisted') unless poll&.persisted?
71
71
 
72
72
  {
73
- subject: poll_notification.subject,
74
73
  available_date: poll.available_date,
75
74
  title: poll.title,
76
75
  url: effective_polls.poll_url(poll),
@@ -72,10 +72,8 @@ module Effective
72
72
  validates :subject, presence: true
73
73
  validates :body, presence: true
74
74
 
75
- with_options(if: -> { EffectivePolls.use_effective_email_templates }) do
76
- validates :body, liquid: true
77
- validates :subject, liquid: true
78
- end
75
+ validates :body, liquid: true
76
+ validates :subject, liquid: true
79
77
 
80
78
  validates :reminder, if: -> { reminder? || upcoming_reminder? || before_poll_ends? },
81
79
  presence: true, uniqueness: { scope: [:poll_id, :category], message: 'already exists' }
@@ -14,18 +14,15 @@
14
14
  = f.show_if :category, category do
15
15
  .my-3= render "/admin/poll_notifications/form_#{template}", f: f
16
16
 
17
- = f.select :from, EffectivePolls.mailer_froms
18
-
19
- - if f.object.category == category
17
+ - if f.object.category == category && f.object.persisted?
18
+ = f.select :from, mailer_froms_collection(), label: 'From'
20
19
  = f.text_field :subject
21
20
  = f.text_area :body, rows: 10
22
-
23
- - elsif EffectivePolls.use_effective_email_templates == false
24
- = f.text_field :subject, value: ''
25
- = f.text_area :body, rows: 10, value: ''
26
-
27
21
  - else
28
22
  - email_template = Effective::EmailTemplate.where(template_name: template).first!
23
+ - from_value = email_template.from || EffectiveResources.mailer_froms.first
24
+
25
+ = f.select :from, mailer_froms_collection(), label: 'From', value: from_value
29
26
  = f.text_field :subject, value: email_template.subject
30
27
  = f.text_area :body, rows: 10, value: email_template.body
31
28
 
@@ -35,6 +32,6 @@
35
32
  - Effective::PollNotification::EMAIL_TEMPLATE_VARIABLES.each do |variable|
36
33
  %li {{ #{variable} }}
37
34
 
38
- %small.text-muted Only a developer can add additional variables
35
+ %small.text-muted Please contact us to add additional variables
39
36
 
40
37
  = effective_submit(f)
@@ -21,7 +21,7 @@ EffectivePolls.setup do |config|
21
21
  # config.mailer_sender = nil # Default From value
22
22
  # config.mailer_froms = nil # Default Froms collection
23
23
  # config.mailer_admin = nil # Default To value for Admin correspondence
24
+ #
25
+ # We always use effective_email_templates
24
26
 
25
- # Use effective email templates for event notifications
26
- config.use_effective_email_templates = true
27
27
  end
@@ -1,3 +1,3 @@
1
1
  module EffectivePolls
2
- VERSION = '0.4.1'
2
+ VERSION = '0.5.0'
3
3
  end
@@ -8,7 +8,7 @@ module EffectivePolls
8
8
  def self.config_keys
9
9
  [
10
10
  :layout,
11
- :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_froms, :mailer_admin, :mailer_subject, :use_effective_email_templates
11
+ :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_froms, :mailer_admin, :mailer_subject
12
12
  ]
13
13
  end
14
14
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_polls
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-10-25 00:00:00.000000000 Z
11
+ date: 2023-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -53,7 +53,7 @@ dependencies:
53
53
  - !ruby/object:Gem::Version
54
54
  version: 4.0.0
55
55
  - !ruby/object:Gem::Dependency
56
- name: effective_resources
56
+ name: effective_email_templates
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
@@ -67,7 +67,7 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
69
  - !ruby/object:Gem::Dependency
70
- name: wicked
70
+ name: effective_resources
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - ">="
@@ -81,7 +81,7 @@ dependencies:
81
81
  - !ruby/object:Gem::Version
82
82
  version: '0'
83
83
  - !ruby/object:Gem::Dependency
84
- name: sassc
84
+ name: wicked
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
@@ -95,13 +95,13 @@ dependencies:
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  - !ruby/object:Gem::Dependency
98
- name: sqlite3
98
+ name: sassc
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - ">="
102
102
  - !ruby/object:Gem::Version
103
103
  version: '0'
104
- type: :development
104
+ type: :runtime
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
@@ -109,7 +109,7 @@ dependencies:
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: devise
112
+ name: sqlite3
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - ">="
@@ -123,7 +123,7 @@ dependencies:
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
125
  - !ruby/object:Gem::Dependency
126
- name: haml
126
+ name: devise
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - ">="
@@ -137,7 +137,7 @@ dependencies:
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
139
  - !ruby/object:Gem::Dependency
140
- name: pry-byebug
140
+ name: haml
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - ">="
@@ -151,7 +151,7 @@ dependencies:
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
153
  - !ruby/object:Gem::Dependency
154
- name: effective_test_bot
154
+ name: pry-byebug
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - ">="
@@ -165,7 +165,7 @@ dependencies:
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
167
  - !ruby/object:Gem::Dependency
168
- name: effective_email_templates
168
+ name: effective_test_bot
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="