effective_messaging 0.5.6 → 0.6.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5dec3f88c3675b7800df94393a54f315c3377d98456783bf8d0ff351b051f33
4
- data.tar.gz: 4c5cc8aec73f2b1d1781cbaac4f2d4bc97a1485a703d19992b9a655378315e95
3
+ metadata.gz: fc984bf85e3e2cf47b5ceaae61d98dc2b336ea34d1ed802c439c7854beabc3b0
4
+ data.tar.gz: 2c695ed99c62e9b4d0d9a42f64d557fdabc8f151d0d5c32b28ed881c4de13385
5
5
  SHA512:
6
- metadata.gz: 416f802b1119a8df270817fa4424837e61c71d0c0b2ca9f7321b3920072c9d02f4cece3986420d5143a82e5b35544ae02d5e084bb7035553a963edf23d0586b2
7
- data.tar.gz: 6453ba7211a7a052c246992fc056d920b13ce73b0a254b8f5ee442caed4297792e93d6e0c095a1f55f19c0459f3d896dc61daf20a993774473a9ca0e69e6b6b3
6
+ metadata.gz: 462f2e88796ea1a1b9e0af27abafe25c580f42ee8b75259ecde6af4a99c1044ba765f7f9c13c2764337f82e179fc2cf9e72e1e33420ff1a270fffef35b0df75d
7
+ data.tar.gz: 95c16f285e650a356c08c85b922385246912bb6c14fab53d406e722e9010bc123266bcc0941a94ca93ec98fb27d3e83fd3f7ccb4b1623bf90a3a7b66a2da73e4
@@ -43,7 +43,7 @@ module Admin
43
43
  col :subject
44
44
  col :body, visible: false
45
45
 
46
- col :from, visible: false, search: Array(EffectiveMessaging.froms).presence
46
+ col :from, visible: false, search: EffectiveMessaging.mailer_froms
47
47
  col :cc, visible: false
48
48
  col :bcc, visible: false
49
49
 
@@ -83,7 +83,7 @@ module Effective
83
83
  scope :disabled, -> { where(enabled: false) }
84
84
 
85
85
  before_validation do
86
- self.from ||= EffectiveMessaging.froms.first
86
+ self.from ||= EffectiveMessaging.mailer_froms.first
87
87
  end
88
88
 
89
89
  # Emails or Report
@@ -55,13 +55,8 @@
55
55
  %h2 Notification
56
56
  %p The following email notification will be sent
57
57
 
58
- - froms = Array(EffectiveMessaging.froms) - [nil, '']
59
-
60
- - if froms.present?
61
- = f.radios :from, froms
62
- - else
63
- = f.email_field :from
64
-
58
+ - f.object.from ||= EffectiveMessaging.mailer_froms.first
59
+ = f.select :from, EffectiveMessaging.mailer_froms
65
60
  = f.email_field :bcc
66
61
  = f.text_field :subject
67
62
  = f.text_area :body, rows: 20
@@ -3,10 +3,6 @@ EffectiveMessaging.setup do |config|
3
3
  # Configure the Layout per controller, or all at once
4
4
  # config.layout = { application: 'application', admin: 'admin' }
5
5
 
6
- # From Settings
7
- # For the Admin new notification form. Set to an array to use a select, or nil to use a freeform text entry
8
- config.froms = ['noreply@example.com']
9
-
10
6
  # Mailer Settings
11
7
  # Please see config/initializers/effective_messaging.rb for default effective_* gem mailer settings
12
8
  #
@@ -19,6 +15,7 @@ EffectiveMessaging.setup do |config|
19
15
  # config.deliver_method = nil # The deliver method, deliver_later or deliver_now
20
16
  # config.mailer_layout = nil # Default mailer layout
21
17
  # config.mailer_sender = nil # Default From value
18
+ # config.mailer_froms = nil # Default Froms collection
22
19
  # config.mailer_admin = nil # Default To value for Admin correspondence
23
20
  # config.mailer_subject = nil # Proc.new method used to customize Subject
24
21
 
@@ -1,3 +1,3 @@
1
1
  module EffectiveMessaging
2
- VERSION = '0.5.6'.freeze
2
+ VERSION = '0.6.0'.freeze
3
3
  end
@@ -10,7 +10,7 @@ module EffectiveMessaging
10
10
  :chats_table_name, :chat_users_table_name, :chat_messages_table_name, :notifications_table_name, :notification_logs_table_name,
11
11
  :layout,
12
12
  :froms,
13
- :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject
13
+ :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_froms, :mailer_admin, :mailer_subject
14
14
  ]
15
15
  end
16
16
 
@@ -14,10 +14,10 @@ namespace :effective_messaging do
14
14
  begin
15
15
  notification.notify!
16
16
  Rails.logger.info "Sent notifications for #{notification} and #{notification.report}"
17
- rescue => e
17
+ rescue StandardError => e
18
18
  data = { notification_id: notification.id, report_id: notification.report_id, resource_id: notification.current_resource&.id }
19
19
  ExceptionNotifier.notify_exception(e, data: data) if defined?(ExceptionNotifier)
20
- puts "Error with effective_messaging #{notification.id} resource #{notification.current_resource&.id}: #{e.errors.inspect}"
20
+ puts "Error with effective_messaging #{notification.id} resource #{notification.current_resource&.id}: #{notification.errors.inspect}"
21
21
  end
22
22
  end
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.6.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-09-07 00:00:00.000000000 Z
11
+ date: 2023-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails