effective_messaging 0.5.6 → 0.6.1

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: f5dec3f88c3675b7800df94393a54f315c3377d98456783bf8d0ff351b051f33
4
- data.tar.gz: 4c5cc8aec73f2b1d1781cbaac4f2d4bc97a1485a703d19992b9a655378315e95
3
+ metadata.gz: e8f7b3818a8990fe5e7fcb8c6babf0e8e16496005adc802797a84d47909ed34d
4
+ data.tar.gz: 6026f09a4290bcd7e9dea0a0e894186587a33d4e86e46389369b8435a84fce3a
5
5
  SHA512:
6
- metadata.gz: 416f802b1119a8df270817fa4424837e61c71d0c0b2ca9f7321b3920072c9d02f4cece3986420d5143a82e5b35544ae02d5e084bb7035553a963edf23d0586b2
7
- data.tar.gz: 6453ba7211a7a052c246992fc056d920b13ce73b0a254b8f5ee442caed4297792e93d6e0c095a1f55f19c0459f3d896dc61daf20a993774473a9ca0e69e6b6b3
6
+ metadata.gz: e15970010165ba1a8ff458b0dc4799a351045f920e1ebb03e206f0b2ba733413e7d389d38acbd741358db30baff0d7b8fbdbb3df757f3fc7995017d9c2a5f791
7
+ data.tar.gz: 13eabe664412672eb12a698e26093b32c211a504b56d5f3778c8cf0d7831228ee66349fc3588e38bbbf7f48b10b7600287a3bd00904cff913f79949911796150
@@ -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.1'.freeze
3
3
  end
@@ -9,8 +9,7 @@ module EffectiveMessaging
9
9
  [
10
10
  :chats_table_name, :chat_users_table_name, :chat_messages_table_name, :notifications_table_name, :notification_logs_table_name,
11
11
  :layout,
12
- :froms,
13
- :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_admin, :mailer_subject
12
+ :mailer, :parent_mailer, :deliver_method, :mailer_layout, :mailer_sender, :mailer_froms, :mailer_admin, :mailer_subject
14
13
  ]
15
14
  end
16
15
 
@@ -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.1
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