Option do Change Hold Time

This commit is contained in:
Luiz Eduardo
2019-02-25 12:01:15 +00:00
committed by Charlie Smurthwaite
parent 48daec1328
commit e55b081721
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -12,6 +12,7 @@ general:
use_ip_pools: false
exception_url:
maximum_delivery_attempts: 18
maximum_hold_expiry_days: 7
use_local_ns_for_domains: false
web_server:
+1 -1
View File
@@ -126,7 +126,7 @@ module Postal
#
def create_delivery(status, options = {})
delivery = Delivery.create(self, options.merge(:status => status))
hold_expiry = status == 'Held' ? 7.days.from_now.to_f : nil
hold_expiry = status == 'Held' ? Postal.config.general.maximum_hold_expiry_days.days.from_now.to_f : nil
self.update(:status => status, :last_delivery_attempt => delivery.timestamp.to_f, :held => status == 'Held' ? 1 : 0, :hold_expiry => hold_expiry)
delivery
end