effective_postmark 0.1.2 → 0.1.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fa5fb599ef1e178681b95d7853d6215ea51446851e6ea2fed4087b3927a6832f
|
4
|
+
data.tar.gz: 804b2ffcd11bc5f6a20df339b0ab4aa4bb5d3370eff443fbf807e71262846a6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dbe67ada0c62f056d6b1c8c5a373cee8470f7ad811409b4c25c5026a37ef66e0c879b1b9efd3386191f1ed8b565bb380228ea2e1feee9c5dd5f69ce37c5d4d68
|
7
|
+
data.tar.gz: 68f60078392756c29eefe54e43ecdd8e437d7b885b1ec3c3f101c641228d73a9cddd091a0c158537a7bec4797d676e0c876b5299e90e1c25ea26d46517863857
|
@@ -9,8 +9,23 @@ module EffectivePostmarkMailer
|
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
12
|
-
rescue_from
|
13
|
-
rescue_from
|
12
|
+
rescue_from(::StandardError, with: :effective_postmark_error) unless Rails.env.test? || Rails.env.development?
|
13
|
+
rescue_from(::Postmark::InactiveRecipientError, with: :effective_postmark_inactive_recipient_error)
|
14
|
+
end
|
15
|
+
|
16
|
+
module ClassMethods
|
17
|
+
def postmark_settings
|
18
|
+
tenant = if defined?(Tenant)
|
19
|
+
Tenant.current || raise("Missing tenant in effective_postmark postmark_settings")
|
20
|
+
end
|
21
|
+
|
22
|
+
api_token = EffectivePostmark.api_token.presence || begin
|
23
|
+
raise("Missing effective_postmark api_token for tenant :#{tenant}. Please see config/initializers/effective_postmark.rb") if tenant.present?
|
24
|
+
raise("Missing effective_postmark api_token. Please see config/initializers/effective_postmark.rb")
|
25
|
+
end
|
26
|
+
|
27
|
+
{ api_token: api_token }
|
28
|
+
end
|
14
29
|
end
|
15
30
|
|
16
31
|
def effective_postmark_inactive_recipient_error(exception)
|
@@ -41,6 +56,9 @@ module EffectivePostmarkMailer
|
|
41
56
|
end
|
42
57
|
|
43
58
|
def effective_postmark_error(exception)
|
59
|
+
Rails.logger.info "\e[31m\e[1mEMAIL FAILED\e[0m\e[22m" # bold red
|
60
|
+
Rails.logger.info "#{exception.inspect}"
|
61
|
+
|
44
62
|
true
|
45
63
|
end
|
46
64
|
|
@@ -4,7 +4,7 @@ EffectivePostmark.setup do |config|
|
|
4
4
|
# config.layout = { application: 'application', admin: 'admin' }
|
5
5
|
|
6
6
|
# API Key
|
7
|
-
config.api_token = ENV.fetch('POSTMARK_API_TOKEN')
|
7
|
+
# config.api_token = ENV.fetch('POSTMARK_API_TOKEN')
|
8
8
|
|
9
9
|
# Mailer Settings
|
10
10
|
# Please see config/initializers/effective_resources.rb for default effective_* gem mailer settings
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: effective_postmark
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
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-09-
|
11
|
+
date: 2024-09-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -219,7 +219,6 @@ files:
|
|
219
219
|
- app/controllers/admin/postmark_controller.rb
|
220
220
|
- app/controllers/admin/postmark_reports_controller.rb
|
221
221
|
- app/datatables/admin/report_inactive_recipients_datatable.rb
|
222
|
-
- app/datatables/effective_postmark_datatable.rb
|
223
222
|
- app/helpers/effective_postmark_helper.rb
|
224
223
|
- app/mailers/concerns/effective_postmark_mailer.rb
|
225
224
|
- app/mailers/effective/postmark_mailer.rb
|
@@ -1,29 +0,0 @@
|
|
1
|
-
class EffectivePostmarkDatatable < Effective::Datatable
|
2
|
-
datatable do
|
3
|
-
order :subject, :asc
|
4
|
-
length :all
|
5
|
-
|
6
|
-
col :updated_at, visible: false
|
7
|
-
col :created_at, visible: false
|
8
|
-
col :id, visible: false
|
9
|
-
|
10
|
-
col :template_name, label: 'Name'
|
11
|
-
|
12
|
-
col :from, search: EffectivePostmark.mailer_froms do |email_template|
|
13
|
-
ERB::Util.html_escape_once(email_template.from)
|
14
|
-
end
|
15
|
-
|
16
|
-
col :cc
|
17
|
-
col :bcc
|
18
|
-
col :subject
|
19
|
-
col :body
|
20
|
-
|
21
|
-
col :content_type, visible: false
|
22
|
-
|
23
|
-
actions_col
|
24
|
-
end
|
25
|
-
|
26
|
-
collection do
|
27
|
-
Effective::EmailTemplate.all
|
28
|
-
end
|
29
|
-
end
|