Expiring of rules. [ Deprecated – update 1.0.3 or older ]

This article relative to the "Email Reminders" update 1.0.3 or older

Imagine a situation, where you are sending email reminders for contacts before 1 day to specific event (or check in day).

Step #1
Usually  your rules condition  have to  be like this:
check_in = TODAY + 1 DAY
or in case, if your event also  have some times,  you have to  use such  2 conditions:

check_in > TODAY + 1 DAY
check_in <= TODAY + 2 DAYS - 1 SECOND

Step #2
For creating email-reminders from  your contacts,  you have to  insert  shortcode for creation  of such  email-reminders into  page A:
[email-reminders-rule id=4 max_count=1500 is_silent=1]
Please check more here https://oplugins.com/faq/email-reminders-how-to-set-up-run-rule-automatically-to-create-reminders/

Step #3
Also you need to inserted the shortcode, for sending these newly created email reminders into the page B:
[email-reminders-send status='init' max_count=100 keyword='United States|Canada|Mexico']
Please check more here https://oplugins.com/faq/email-reminders-how-to-set-up-automatic-sending-of-reminders/

Now when someone visit the page A (with shortcode for creation of email reminders), plugin will run rule (starting from contact ID that you have defined during creation of that rule (usually contact ID = 0), and process 1500 contacts (it's number that you have defined in the shortcode with parameter max_count=1500, e.g. [email-reminders-rule id=4 max_count=1500 is_silent=1]).
If you have more than  1500  contacts (for example 14700),  then  when  someone opens this page A for another time,  the system  will  start to run  rule from  last processed contact  (in our case it's contact  with  ID = 1500)  and process the next  1500  contacts. During this time the plugin processed 3000 contacts. It means that  for processing all  14700 contacts,  page A has to  be opened 10 times - for execution  shortcode [email-reminders-rule id=4 max_count=1500 is_silent=1] for 10  times.

Why  do we not process all  contacts during one step ?
Imagine a situation, if you are having 1 000 000 contacts or more,  so  in this case,  your server just  does not process such a big amount of data during one time,  and you will  have a timeout error. That's why such an option for setting the number of contacts to  process gives us great  flexibility and scalability for a huge number of contacts to process. This is also useful in situations, where the execution was interrupted for some reason, and the next time you start with the last processed contact lists.

Now back to our subject.
Probably some visitors opened page A during 10 times,  and we have processed all  our contacts with this shortcode [email-reminders-rule id=4 max_count=1500 is_silent=1]. It means that the plugin has stopped at 14700 contact ID.
Probably during today was created several email reminders. And another shortcode at page B was sent all such  email reminders,  that is to remind customers before 1 day  to  specific event.
Such a rule will  have status FINISHED at the Rules listing page.

But what will be during tomorrow with such a rule?
Nothing. Because we are having status of this rule as finished and we have processed all  our contacts.
Probably  during tomorrow,  we need to  start  this rule again from the beginning of the contact list. In other words we need to  set  contact  ID to 0  for such a rule,  and check  all  our contacts again  about creation  of email reminders that  will  be sent for 1 day  before the event (but during tomorrow, and etc...)

And because of all  this in version 1.0.2 you are having the ability to  define when  specific rule will be EXPIRED.
During creation or editing of the rule, you can  define "Expire period" and start time when  this period is starting.
So  in our example we need to  define the expiration period as 1 day.
And during tomorrow system will reset contact  ID to 0  and will start  processing our contacts from  beginning.
It means that during each  next  day  we will  process all  contacts and create relative correct email reminders for specific dates.