Skip to content

Send_Automated_Email #24

Send_Automated_Email

Send_Automated_Email #24

name: Send_Automated_Email
on:
workflow_run:
workflows: ["Generate_RespiCast_Forecasts"] # Trigger when this workflow finishes
types:
- completed
# Or you can manually trigger the workflow
workflow_dispatch:
jobs:
send_email_job:
runs-on: ubuntu-latest
steps:
# Step 1: Check out the repository to access the files
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Prepare the email content and attach files
- name: Send email via gmail
uses: dawidd6/action-send-mail@v3
with:
server_address: smtp.gmail.com # gmail SMTP server
server_port: 587 # Port for TLS
username: ${{ secrets.GMAIL_EMAIL }}
password: ${{ secrets.GMAIL_APP_PASSWORD }}
subject: RespiCast Forecast Workflow Completed
body: Test test
to: [email protected] # Replace with the recipient's email address
#from: ${{ secrets.GMAIL_EMAIL }}
from: [email protected]
secure: false
attachments: |
./models/Forecasting-hubs_models/model_output/figures/2024-12-04-ECDC-soca_simplex_ILI.jpg
./models/Forecasting-hubs_models/model_output/figures/2024-12-04-ECDC-soca_simplex_ARI.jpg
./models/Forecasting-hubs_models/model_output/figures/2024-12-04-ECDC-soca_simplex_hosp.jpg