Suppression list improvements (#867)

This commit is contained in:
Will Power
2019-11-22 17:28:11 +00:00
committed by Adam Cooke
parent 10f4808fbf
commit dcb2919cc6
5 changed files with 9 additions and 2 deletions
@@ -23,6 +23,7 @@
.suppressionList__right {
flex: 0 0 auto;
text-align: right;
}
.suppressionList__timestamp {
+5 -1
View File
@@ -14,7 +14,7 @@
- else
%p.pageContent__intro.u-margin
When messages cannot be delivered, addresses are added to the suppression list which stops
future messages to the same recipient being sent through. Recipients are removed from the list after 30 days.
future messages to the same recipient being sent through. Recipients are removed from the list after #{Postal.config.general.suppression_list_removal_delay} days.
%ul.suppressionList
- for suppression in @suppressions[:records]
%li.suppressionList__item
@@ -23,4 +23,8 @@
%p.suppressionList__reason= suppression['reason'].capitalize
.suppressionList__right
%p.suppressionList__timestamp Added #{Time.zone.at(suppression['timestamp']).to_s(:long)}
%p.suppressionList__timestamp
Expires #{Time.zone.at(suppression['keep_until']).to_s(:long)}
- if suppression['keep_until'] > Time.now.to_f
%span.u-red expired
= render 'shared/message_db_pagination', :data => @suppressions, :name => "suppression"
+1
View File
@@ -26,6 +26,7 @@ module Clockwork
every 1.day, 'every-day', :at => ['03:00'] do
ProcessMessageRetentionJob.queue(:main)
PruneSuppressionListsJob.queue(:main)
end
end
+1
View File
@@ -13,6 +13,7 @@ general:
exception_url:
maximum_delivery_attempts: 18
maximum_hold_expiry_days: 7
suppression_list_removal_delay: 30
use_local_ns_for_domains: false
web_server:
+1 -1
View File
@@ -7,7 +7,7 @@ module Postal
end
def add(type, address, options = {})
keep_until = (options[:days] || 30).days.from_now.to_f
keep_until = (options[:days] || Postal.config.general.suppression_list_removal_delay).days.from_now.to_f
if existing = @database.select('suppressions', :where => {:type => type, :address => address}, :limit =>1).first
reason = options[:reason] || existing['reason']
@database.update('suppressions', {:reason => reason, :keep_until => keep_until}, :where => {:id => existing['id']})