effective_events 0.14.1 → 0.15.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: 418833792fdacf3ee145ead72e1bac6aee5933e9ca8eaad3cf26afc589ec8e3b
4
- data.tar.gz: 1a105035e07a3ff8dde869ff9ed9b28830ff9739fde2bae7d6d7a59be2ba0437
3
+ metadata.gz: aeed000b9c4ccbe02f6fcc29eb381caf0612cb8c7caa35155e3b122299dcddd9
4
+ data.tar.gz: d4556b21e76cdb1484a315d4f9b74cdaea405f9fc569c0794b1f0946d8c6a54f
5
5
  SHA512:
6
- metadata.gz: 36464803efef6e30bcac251faa6251080e1fdf8cf1f1504695e102ee82f0b65320102c13ccfe61410d0d7a29c22734e5cf27d535b854ec6f00652e0a05f5b1dc
7
- data.tar.gz: d135b844f28edde57fa67bcda5a2bf03935db3a3d33b49db09d32be8381cf6e7e478c67e4ac7195f450a1ab74718f980c8a7de6c8aeb52ce7347e974dad5f0db
6
+ metadata.gz: a744ca3b393c87820ed2aa100bf9ea01e92d41688cbbd6c84412d5eafae3f74d8e3ea7af7900f45e7e6f810f47b51f34e6335a89983a39100948fdba21a2db32
7
+ data.tar.gz: e9f1bbe0bc3931f7f41c761eb502f50913259bb2f7dd22b315573d7c7c5e92fcf8b6260de7e631f36e9ab0f9ea6797a1687ae8c96fed065b6076bce7a0ef0337
@@ -12,7 +12,10 @@ class Admin::EffectiveEventNotificationsDatatable < Effective::Datatable
12
12
 
13
13
  col :event
14
14
  col :category
15
- col :from
15
+
16
+ col :from, visible: false do |notification|
17
+ ERB::Util.html_escape_once(notification.from)
18
+ end
16
19
 
17
20
  # col :reminder do |poll_notification|
18
21
  # case poll_notification.category
@@ -37,8 +40,12 @@ class Admin::EffectiveEventNotificationsDatatable < Effective::Datatable
37
40
  simple_format(notification.body)
38
41
  end
39
42
 
40
- # col :started_at, visible: false
41
- # col :completed_at
43
+ col :cc, visible: false
44
+ col :bcc, visible: false
45
+ col :content_type, visible: false
46
+
47
+ col :started_at, visible: false
48
+ col :completed_at
42
49
 
43
50
  actions_col
44
51
  end
@@ -2,6 +2,7 @@ module Effective
2
2
  class EventNotification < ActiveRecord::Base
3
3
  self.table_name = (EffectiveEvents.event_notifications_table_name || :event_notifications).to_s
4
4
 
5
+ acts_as_email_notification # effective_resources
5
6
  log_changes(to: :event) if respond_to?(:log_changes)
6
7
 
7
8
  belongs_to :event
@@ -54,6 +55,10 @@ module Effective
54
55
  subject :string
55
56
  body :text
56
57
 
58
+ cc :string
59
+ bcc :string
60
+ content_type :string
61
+
57
62
  # Tracking background jobs email send out
58
63
  started_at :datetime
59
64
  completed_at :datetime
@@ -72,13 +77,6 @@ module Effective
72
77
 
73
78
  validates :category, presence: true, inclusion: { in: CATEGORIES }
74
79
 
75
- validates :from, presence: true, email: true
76
- validates :subject, presence: true
77
- validates :body, presence: true
78
-
79
- validates :body, liquid: true
80
- validates :subject, liquid: true
81
-
82
80
  # validates :reminder, if: -> { reminder? || upcoming_reminder? || before_event_ends? },
83
81
  # presence: true, uniqueness: { scope: [:event_id, :category], message: 'already exists' }
84
82
 
@@ -147,10 +145,14 @@ module Effective
147
145
 
148
146
  update_column(:started_at, Time.zone.now)
149
147
 
150
- opts = { from: from, subject: subject, body: body }
151
-
152
148
  event_registrants.each do |event_registrant|
153
- EffectiveEvents.send_email(email_template, event_registrant, opts)
149
+ begin
150
+ EffectiveEvents.send_email(email_template, event_registrant, email_notification_params)
151
+ rescue => e
152
+ EffectiveLogger.error(e.message, associated: event_registrant) if defined?(EffectiveLogger)
153
+ ExceptionNotifier.notify_exception(e, data: { event_registrant_id: event_registrant.id, event_notification_id: id }) if defined?(ExceptionNotifier)
154
+ raise(e) if Rails.env.test? || Rails.env.development?
155
+ end
154
156
  end
155
157
 
156
158
  update_column(:completed_at, Time.zone.now)
@@ -12,26 +12,7 @@
12
12
  - template = 'event_' + category.parameterize.underscore
13
13
 
14
14
  = f.show_if :category, category do
15
- = render "/admin/event_notifications/form_#{template}", f: f
16
-
17
- - if f.object.category == category && f.object.persisted?
18
- = f.select :from, mailer_froms_collection(), label: 'From'
19
- = f.text_field :subject
20
- = f.text_area :body, rows: 10
21
- - else
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
26
- = f.text_field :subject, value: email_template.subject
27
- = f.text_area :body, rows: 10, value: email_template.body
28
-
29
- %p The available variables are:
30
-
31
- %ul
32
- - Effective::EventNotification::EMAIL_TEMPLATE_VARIABLES.each do |variable|
33
- %li {{ #{variable} }}
34
-
35
- %small.text-muted Please contact us to add additional variables
15
+ .my-3= render "/admin/event_notifications/form_#{template}", f: f
16
+ = email_notification_fields(f, template, variables: Effective::EventNotification::EMAIL_TEMPLATE_VARIABLES)
36
17
 
37
18
  = effective_submit(f)
@@ -21,11 +21,11 @@
21
21
  .mb-4
22
22
  %small.text-muted Please refresh the page after archiving/unarchiving here to display an accurate Registered count on the Tickets & Products tab
23
23
 
24
- - datatable = Admin::EffectiveEventRegistrantsDatatable.new(event_id: event.id)
24
+ - datatable = EffectiveResources.best('Admin::EffectiveEventRegistrantsDatatable').new(event_id: event.id)
25
25
  .mb-4= render_inline_datatable(datatable)
26
26
 
27
27
  %h2 Add-ons
28
- - datatable = Admin::EffectiveEventAddonsDatatable.new(event_id: event.id)
28
+ - datatable = EffectiveResources.best('Admin::EffectiveEventAddonsDatatable').new(event_id: event.id)
29
29
  .mb-4= render_inline_datatable(datatable)
30
30
 
31
31
  = tab 'Wizard' do
@@ -183,6 +183,10 @@ class CreateEffectiveEvents < ActiveRecord::Migration[6.0]
183
183
  t.string :subject
184
184
  t.text :body
185
185
 
186
+ t.string :cc
187
+ t.string :bcc
188
+ t.string :content_type
189
+
186
190
  t.datetime :started_at
187
191
  t.datetime :completed_at
188
192
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveEvents
2
- VERSION = '0.14.1'.freeze
2
+ VERSION = '0.15.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_events
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.15.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: 2024-06-11 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails