I already had set up a reminder process using which I get periodic notification to back up my data. This time I applied the same thought along with email reminder for my due insurance premiums. It’s true that insurance providers send a reminder SMS/ email just before the due date; but I’ve had the experience when their SMS gateway was jammed due to heavy traffic and I got reminder post one month of my due date! So better to be safe than sorry. I kept those due dates in my reminder service.
Yeah, I know setting up the same in google calendar or using any other available reminder service is much more easy. I accept that. But what if, I want to get at least the notification when I’m not even connected to Internet? Moreover, solving this kind of own problems are nothing but fun. Especially when I’m a coder and supposed to solve my basic problems.
At first I’d set up sSMTP so that I can receive email from my local system. Here I’d listed the steps how to set up sSMTP.
Then I updated my anacrontab to execute the reminder process monthly-
30 10 insurancereminder /etc/check-premium.bash
The bash script is a simple one like my weekly backup reminder
#!/bin/bash eval "export $(egrep -z DBUS_SESSION_BUS_ADDRESS /proc/$(pgrep -u $LOGNAME gnome-session)/environ)"; output=`php /etc/checkDuePremium.php` if [ $output -gt 0 ] then notify-send 'Hello Kuntal!' "$output premium is due. Check your inbox for details" --icon=dialog-information fi exec echo insurance reminder job ran at `date` >> /var/log/check_premium.log
And the php script it executes is again another simple one, checks if this month has any due premiums then sum up the due amount and send all the details over email.