This GitHub Action enables you to send emails via Gmail using HTML templates directly from your GitHub workflows.
- Send emails to multiple recipients (up to 5)
- Supports custom HTML templates
- Secure authentication using Gmail App Password
- Rich HTML email formatting
- Seamless integration with GitHub Actions
You can use this Gmail Sender GitHub Action for various automation scenarios, including:
- Automated Reports – Send test reports, build logs, or CI/CD results via email.
- Release Notifications – Notify stakeholders when a new version is released.
- Deployment Alerts – Send emails upon successful deployment or failures.
- Issue Tracking – Email updates when an issue is created or resolved.
- Scheduled Reminders – Set up periodic emails for reminders or team updates.
- Security Alerts – Notify the team about security vulnerabilities or warnings.
Input | Description | Required |
---|---|---|
sender_email |
Gmail address used for sending emails | ✅ |
app_password |
Gmail App Password for authentication | ✅ |
receiver_emails |
Comma-separated list of recipient emails (max 5) | ✅ |
template_path |
Path to the HTML template file in the repository | ✅ |
subject |
Email subject line (optional) | ❌ |
- Go to Google Account Settings
- Navigate to Security > 2-Step Verification > App Passwords
- Generate a new App Password for "Mail"
Go to GitHub Repo → Settings → Secrets and Variables → Actions and add:
GMAIL_SENDER
→ Your Gmail addressGMAIL_APP_PASSWORD
→ Your Gmail App PasswordRECIPIENTS
→ Your Recipients upto 5 eg : [email protected], [email protected]
Inside .github/workflows/{your-filename}.yml
, add the following workflow:
name: Send Email
on: [push]
jobs:
send-email:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Send Email via Gmail
uses: Raghul-M/gmail-sender-action@v1
with:
sender_email: ${{ secrets.GMAIL_SENDER }}
app_password: ${{ secrets.GMAIL_APP_PASSWORD }}
receiver_emails: ${{ secrets.RECIPIENTS }}
template_path: "templates/email_template.html"
subject: "Notification from GitHub Action"
- Maximum 5 recipients per email.
- HTML template file must exist in the repository.
- Requires Gmail account with 2FA enabled.
- App Password must have mail permissions.
This email template is customizable, allowing you to design your email with images, styles, and dynamic content.
Please report any issues or feature requests via the GitHub repository's issue tracker.
This project is open-source, and contributions are welcome! Feel free to submit issues, feature requests, or pull requests.
Want to discuss? Connect with me on Linkedin Raghul-M!