Skip to content

This GitHub Action enables you to send emails via Gmail using Custom HTML templates directly from your GitHub workflows.

License

Notifications You must be signed in to change notification settings

Raghul-M/gmail-sender-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gmail Sender Action 📩

This GitHub Action enables you to send emails via Gmail using HTML templates directly from your GitHub workflows.

image

📌 Features

  • 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

📌 Use Cases

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.

📥 Required Inputs

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)

⚙️ Setup Instructions

1️⃣ Generate a Gmail App Password

  1. Go to Google Account Settings
  2. Navigate to Security > 2-Step Verification > App Passwords
  3. Generate a new App Password for "Mail"

2️⃣ Add Repository Secrets

Go to GitHub Repo → Settings → Secrets and Variables → Actions and add:

3️⃣ Create Workflow File

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"

📌 Important Notes

  • 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.

📖 Example Usage

Example HTML Template (templates/email_template.html)

This email template is customizable, allowing you to design your email with images, styles, and dynamic content.

Workflow Image

🐛 Bug Reports & Feedback

Please report any issues or feature requests via the GitHub repository's issue tracker.

🤝 Contributing

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!

About

This GitHub Action enables you to send emails via Gmail using Custom HTML templates directly from your GitHub workflows.

Resources

License

Stars

Watchers

Forks

Packages

No packages published