File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ interface EndingRemindersOptions {
4040}
4141
4242interface RenewalRemindersOptions {
43+ monthlyReminderDays ?: number ;
4344 yearlyReminderDays ?: number ;
4445}
4546
@@ -81,6 +82,11 @@ export class SubscriptionReminders {
8182 this . statsd = statsd ;
8283 this . planDuration = Duration . fromObject ( { days : planLength } ) ;
8384 this . reminderDuration = Duration . fromObject ( { days : reminderLength } ) ;
85+ if ( renewalRemindersOptions . monthlyReminderDays ) {
86+ this . reminderDuration = Duration . fromObject ( {
87+ days : renewalRemindersOptions . monthlyReminderDays ,
88+ } ) ;
89+ }
8490 if ( renewalRemindersOptions . yearlyReminderDays ) {
8591 this . yearlyRenewalReminderDuration = Duration . fromObject ( {
8692 days : renewalRemindersOptions . yearlyReminderDays ,
Original file line number Diff line number Diff line change @@ -87,7 +87,7 @@ async function init() {
8787 const subscriptionReminders = new SubscriptionReminders (
8888 log ,
8989 parseInt ( program . planLength ) ,
90- parseInt ( program . reminderLength ) ,
90+ parseInt ( program . monthlyRenewalReminderLength ) ,
9191 {
9292 enabled : parseBooleanArg ( program . enableEndingReminders ) ,
9393 paymentsNextUrl : config . smtp . subscriptionSettingsUrl ,
@@ -96,6 +96,7 @@ async function init() {
9696 yearlyReminderDays : parseInt ( program . endingReminderYearlyLength ) ,
9797 } ,
9898 {
99+ monthlyReminderDays : parseInt ( program . monthlyRenewalReminderLength ) ,
99100 yearlyReminderDays : parseInt ( program . yearlyRenewalReminderLength ) ,
100101 } ,
101102 database ,
You can’t perform that action at this time.
0 commit comments