Monitor Date And Send Email Notification To Users
I have created a plugin in OctoberCMS to store users information and products expiry date.
I want to make Event fire when expiry date is close to current date and send email to the user, how can I monitor the date (should I use contrib shell command)? how do I approach this?
Probably you need
Server will execute scheduler based on time you define in your
cron-job, In Your case it will be good to schedule it every day.
now every day it will fire you scheduler > then it will call your
Task (https://octobercms.com/docs/plugin/scheduling#introduction) with your logic.
You will fetch records with condition like :
current_date + 1/2/3 day convert that date in to timestamp and store to variable
And add condition on field
expiry_date > today_time_stamp AND expiry_date < future_date
It will give you records which are about to expire in next 1/2/3 days
notify [send email]or
fire eventfor these records
You can add master cron job to your server just follow this guidehttps://octobercms.com/docs/setup/installation#crontab-setup
Then you can just write you logic how you want thing to be donehttps://octobercms.com/docs/plugin/scheduling#introduction
if any doubt please comment
- → OctoberCMS Backend Loging Hash Error
- → "failed to open stream" error when executing "migrate:make"
- → OctoberCMS - How to make collapsible list default to active only on non-mobile
- → Create plugin that makes objects from model in back-end
- → October CMS Plugin Routes.php not registering
- → OctoberCMS Migrate Table
- → How to install console for plugin development in October CMS
- → OctoberCMS Rain User plugin not working or redirecting
- → October CMS Custom Mail Layout
- → October CMS - How to correctly route
- → October CMS create a multi select Form field
- → How to update data attribute on Ajax complete
- → October CMS - Conditionally Load a Different Page