May possibly possibly additionally trustworthy 24, 2020
After forgetting however another birthday, I made up my thoughts to location up an easy on every day basis e mail reminder machine. It comprises a Python program that’s scheduled to flee on every day basis utilizing GitHub Actions. The whole birthdays and diversified anniversaries are maintained in a
csv file and the on every day basis e mail is ship utilizing Sendgrid API. Attributable to the low volumes, the ultimate corporations and merchandise passe – are on FREE plans.
Since environment it up, I expose built-in some foreign exchange and stock mark information into the on every day basis mail. The code is built-in on this program nevertheless might furthermore be commented out if no longer passe as confirmed extra beneath.
GitHub Repository: https://github.com/whoek/birthday-reminder
Instruments and API’s passe
- Birthday guidelines and Python program is on GitHub
- Github Actions set off the on every day basis e mail
- SendGrid API to ship emails
Native set up
- Clone this GitHub Repository
- In the event you occur to don’t have religion to embody stock prices and foreign exchange data, remark out
def predominant(): html_content = # get_forex_html() + # get_stock_html() + get_birthday_html()
- Arrange Python dependencies with
pip set up environs requests sendgrid.
- Win a SendGrid API key. It is a great distance free when you despatched a low amount of emails per day
- Replace the important thing data within the
- Journey with
- Accomplish sure GitHub Actions is Enabled internal Settings of your repository
- Swap the scheduled time in file
.github/workflows/pythonapp.yml. Use crontab guru as guide whereas it is good to possibly presumably successfully be now to not lunge with cron settings
- To hint residing or re-flee an Motion, see data under the
Runtime is under 1 minute. On the GitHub free thought, it is good to possibly presumably furthermore trustworthy have religion 2,000 Actions minutes/month readily available. So no sing there.
Affirming the birthday file
I passe normal csv file construction in place of yaml, json or any diversified. Proper right here is in say that I am able to retain the guidelines with out misery on my native machine utilizing Excel. It additionally shows effectively on GitHub.
birthday,age,identify,level to 2020-06-21,as quickly as,Father's Day,Ireland 2021-06-20,as quickly as,Father's Day,Ireland 2022-06-19,as quickly as,Father's Day,Ireland 2020-05-26,45,Adrian Bruce,birthday 1964-05-27,0,Alexander MacDonald,birthday
birthday– Ought to be in
age– Likelihood is excessive you will furthermore enter the age of the particular particular person on the required date. Accomplish this Zero if date of beginning grew to become entered. Proper right here is passe to level to the calculated age of the particular particular person within the e mail. If age of specific particular person is unknown , proceed the
ageenviornment clean. The place the
ageenviornment is clean, the twelve months enviornment of birthday is missed. For as quickly as-off reminders or events, add the remember
as quickly aswithin the
ageenviornment. The reminder will final be confirmed on date indicated.
Day-to-day e mail