-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
312f748
commit 568cff1
Showing
1 changed file
with
55 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,28 +8,61 @@ jobs: | |
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 = \"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 = \"\"\"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\nGame Night \U0001F3B2\n\nJoin us for a fun\ | ||
\ Game Night! Bring your favorite games and enjoy an evening of laughter and\ | ||
\ friendly competition.\n\n**Date:** Wednesday, November 6\n**Time:** TBD\n\ | ||
**Location:** TBD\n\nLooking forward to a fun night!\n\nBest,\nThe PBS Social\ | ||
\ Committee\n\n\n===END===\n\"\"\"\nmsg.attach(MIMEText(body, 'plain'))\n\n\ | ||
server = 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" | ||
run: | | ||
python - <<EOF | ||
import smtplib | ||
from email.mime.multipart import MIMEMultipart | ||
from email.mime.text import MIMEText | ||
sender_email = "[email protected]" | ||
receiver_email = "[email protected]" | ||
cc_email = "[email protected], [email protected]" | ||
subject = "Game Night Reminder" | ||
msg = MIMEMultipart() | ||
msg['From'] = sender_email | ||
msg['To'] = receiver_email | ||
msg['Cc'] = cc_email | ||
msg['Subject'] = subject | ||
body = """Hi Michelle, | ||
Could you please send out the announcement below to the department? | ||
Thanks very much! | ||
Best, | ||
The PBS Social Committee | ||
===BEGIN=== | ||
PBS Social Committee Calendar of Events | ||
Game Night 🎲 | ||
Join us for a fun Game Night! Bring your favorite games and enjoy an evening of laughter and friendly competition. | ||
**Date:** Wednesday, November 6 | ||
**Time:** TBD | ||
**Location:** TBD | ||
Looking forward to a fun night! | ||
Best, | ||
The PBS Social Committee | ||
===END=== | ||
""" | ||
msg.attach(MIMEText(body, 'plain')) | ||
server = smtplib.SMTP('smtp.gmail.com', 587) | ||
server.starttls() | ||
server.login(sender_email, "${{ secrets.GMAIL_PASSWORD }}") | ||
text = msg.as_string() | ||
server.sendmail(sender_email, receiver_email.split(", ") + cc_email.split(", "), text) | ||
server.quit() | ||
EOF | ||
name: Reminder for Game Night | ||
'on': | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: 0 0 5 11 * | ||
workflow_dispatch: {} | ||
- cron: "0 0 5 11 *" |