Add event reminder workflows #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jobs: | ||
send_email: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
- name: Install dependencies | ||
run: pip install smtplib email | ||
- name: Send email | ||
run: "python - <<EOF\nimport smtplib\nfrom email.mime.multipart import MIMEMultipart\n\ | ||
from email.mime.text import MIMEText\n\nsender_email = \"[email protected]\"\ | ||
\nreceiver_email = \"[email protected]\"\ncc_email = \"[email protected],\ | ||
\ [email protected]\"\nsubject = \"Weekly Wednesday Woccoms Reminder\"\ | ||
\n\nmsg = MIMEMultipart()\nmsg['From'] = sender_email\nmsg['To'] = receiver_email\n\ | ||
msg['Cc'] = cc_email\nmsg['Subject'] = subject\n\nbody = \"\"\"Hi Michelle,\n\ | ||
\nCould you please send out the announcement below to the department?\n\n\ | ||
Thanks very much!\n\nBest,\nThe PBS Social Committee\n\n===BEGIN===\nPBS Social\ | ||
\ Committee Calendar of Events\n\nWeekly Wednesday Woccoms \U0001F6B6\U0001F332\ | ||
\U0001F333\n\nThat computer screen can wait! Step away from your desk and\ | ||
\ join us for a walk around Occom Pond. Extend your lab meeting, problem-solve,\ | ||
\ or simply enjoy the fresh air with colleagues.\n\n**Date:** Wednesdays throughout\ | ||
\ the term\n**Time:** 2:30 \u2013 3:30 PM\n**Location:** Meet in Moore lobby\ | ||
\ then walk around Occom Pond\n\nLooking forward to walking with you!\n\n\ | ||
Best,\nThe PBS Social Committee\n\n\n===END===\n\"\"\"\nmsg.attach(MIMEText(body,\ | ||
\ 'plain'))\n\nserver = smtplib.SMTP('smtp.gmail.com', 587)\nserver.starttls()\n\ | ||
server.login(sender_email, \"eswl nrrh khqw aoex\")\ntext = msg.as_string()\n\ | ||
server.sendmail(sender_email, receiver_email.split(\", \") + cc_email.split(\"\ | ||
, \"), text)\nserver.quit()\n\nEOF" | ||
name: Reminder for Weekly Wednesday Woccoms | ||
'on': | ||
schedule: | ||
- cron: '2024-09-24T14:00:00Z' |