Reminder for Game Night #3
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
name: Reminder for Game Night | |
'on': | |
workflow_dispatch: {} | |
schedule: | |
- cron: 0 9 5 11 * | |
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 markdown | |
- name: Send email | |
run: "python - <<EOF\n\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 = \"Game Night Reminder\"\n\n\ | |
msg = MIMEMultipart()\nmsg['From'] = sender_email\nmsg['To'] = receiver_email\n\ | |
msg['Cc'] = cc_email\nmsg['Subject'] = subject\n\nbody = \"\"\"<p>Hi Michelle,</p>\n\ | |
<p>Could you please send out the announcement below to the department?</p>\n\ | |
<p>Thanks very much!</p>\n<p>Best,\nThe PBS Social Committee</p>\n<p>===BEGIN===\n\ | |
PBS Social Committee Calendar of Events</p>\n<p>Game Night \U0001F3B2</p>\n\ | |
<p>Join us for a fun Game Night! Bring your favorite games and enjoy an evening\ | |
\ of laughter and friendly competition.</p>\n<p><strong>Date:</strong> Wednesday,\ | |
\ November 6\n<strong>Time:</strong> TBD\n<strong>Location:</strong> TBD</p>\n\ | |
<p>Looking forward to a fun night!</p>\n<p>Best,\nThe PBS Social Committee</p>\n\ | |
<p>===END===</p>\"\"\"\nmsg.attach(MIMEText(body, 'html'))\n\nserver = smtplib.SMTP('smtp.gmail.com',\ | |
\ 587)\nserver.starttls()\nserver.login(sender_email, \"${ secrets.GMAIL_PASSWORD\ | |
\ }\")\ntext = msg.as_string()\nserver.sendmail(sender_email, receiver_email.split(',\ | |
\ ') + cc_email.split(', '), text)\nserver.quit()\n\nEOF" |