summaryrefslogtreecommitdiff
path: root/content/blog/email_scripts.md
diff options
context:
space:
mode:
authorMark Powers <mark@marks.kitchen>2022-07-19 21:12:41 -0500
committerMark Powers <mark@marks.kitchen>2022-07-19 21:12:41 -0500
commit4e965c7d9a66d6a72b24c7b319c10d8006f2026e (patch)
tree4021ef67be5ed3a76e0632c3cfec5d6428806850 /content/blog/email_scripts.md
Initial Commit
Diffstat (limited to 'content/blog/email_scripts.md')
-rw-r--r--content/blog/email_scripts.md24
1 files changed, 24 insertions, 0 deletions
diff --git a/content/blog/email_scripts.md b/content/blog/email_scripts.md
new file mode 100644
index 0000000..601ee38
--- /dev/null
+++ b/content/blog/email_scripts.md
@@ -0,0 +1,24 @@
+---
+title: "Email_scripts"
+date: 2020-09-19T21:24:43-05:00
+---
+Email is great. It is a time tested standard, reliable, and federated. Today I spent some time cleaning up a couple scripts I have regarding email. Ever since I set up my own server with mailinabox.email/, I have been scripting some IMAP and SMTP things. It is much easier to do things with a custom server than with a large email provider like Gmail since you don't have their proprietary system on top of everything. The scripts reside in this repository.
+
+## email_helper.py
+
+This file handles all the shared code regarding IMAP and SMTP, like sending and parsing the inbox. I did not have this before today, and foolishly was just copying the send mail method in every script. In refactoring this, I accidentally sent out an email about an old post to all the subscribers on my website from the email sign up (sorry about that). I'm not quite sure how old this post was, as I don't show years for some reason in posts, which is something I need to fix.
+
+## config.py
+
+Manages the config file for everything. If no config file exists, it will prompt you to create one with a creation tool.
+
+## kitchen-update-email.py
+
+This script is fairly specific, and it checks if there is a new post on my website and if so sends out the email. Most of this code is DB logic, since that's where the information for when the last email was sent is kept. I run it in crontab, and so emails are send when my server hits midnight.
+## reminder.py
+
+This is where things begin to get a bit interesting. I set up this script to send an email starting with the subject "REMINDER: " with the rest of the subject and body coming from the command arguments. This makes it really easy to set up a crontab line with the script for things like "pay rent near the end of the month" or "backup computer on the 5th". I can see the email in my inbox when it comes, and it is a reminder to do that thing.
+
+## daily-update.py
+
+This script does the most, and I run it every day. First, it will check my inbox for any emails that contain "REMINDER" in the subject and include their subjects in a list, just so the unread emails don't get buried in my inbox. Next, it will go to the [Library of Congress newspaper archives](https://chroniclingamerica.loc.gov/) to find a newspaper from 100 years ago and if there is one it will appear also in the email. I find old news to be fascinating, and in the future would be interested in including some more "this day in history" features. Lastly, this script will also include a detailed weather forecast table. I have more ideas of things to include, and I am excited to extend this daily email with even more things.