-
Notifications
You must be signed in to change notification settings - Fork 371
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Mailgun send email github action
- Loading branch information
1 parent
2a5b7f6
commit 83f4405
Showing
6 changed files
with
2,482 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,59 @@ | ||
# Send Email GitHub Action | ||
|
||
This is a minimalistic GitHub Action for sending emails via Mailgun. | ||
Specify the Mailgun API key along with the Mailgun domain and message to | ||
be sent. | ||
|
||
## Inputs | ||
|
||
### `api-key` | ||
|
||
**Required** Mailgun API key. | ||
|
||
### `domain` | ||
|
||
**Required** Mailgun domain name. | ||
|
||
### `from` | ||
|
||
Senders name and email address 'Hello User <hello@example.com>'. | ||
|
||
### `to` | ||
|
||
**Required** Recipient's email address. You can use commas to separate multiple recipients. | ||
|
||
### `cc` | ||
|
||
Email addresses to Cc. | ||
|
||
### `subject` | ||
|
||
**Required** Message subject. | ||
|
||
### `text` | ||
|
||
Text body of the message. | ||
|
||
### `html` | ||
|
||
HTML body of the message. | ||
|
||
## Example usage | ||
|
||
``` | ||
- name: Send Email | ||
uses: firebase/firebase-admin-node/.github/actions/send-email | ||
with: | ||
api-key: ${{ secrets.MAILGUN_API_KEY }} | ||
domain: ${{ secrets.MAILGUN_DOMAIN }} | ||
from: 'User <you@yourdomain.com>' | ||
html: '<h1>Testing some Mailgun awesomness!</h1>' | ||
to: 'foo@example.com' | ||
``` | ||
|
||
## Implementation | ||
|
||
This Action uses the `mailgun.js` NPM package to send Emails. | ||
|
||
When making a code change remember to run `npm run pack` to rebuild the | ||
`dist/index.js` file which is the executable of this Action. |
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Copyright 2021 Google Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
name: 'Send email Action' | ||
description: 'Send emails using Mailgun from GitHub Actions workflows.' | ||
inputs: | ||
api-key: | ||
description: Mailgun API key. | ||
required: true | ||
domain: | ||
description: Mailgun domain name. | ||
required: true | ||
from: | ||
description: Senders name and email address 'Hello User <hello@useremail.com>'. | ||
required: false | ||
to: | ||
description: Recipient's email address. You can use commas to separate multiple recipients. | ||
required: true | ||
cc: | ||
description: Email addresses to Cc. | ||
required: false | ||
subject: | ||
description: Message subject. | ||
required: true | ||
text: | ||
description: Text body of the message. | ||
required: false | ||
html: | ||
description: HTML body of the message. | ||
required: false | ||
runs: | ||
using: 'node12' | ||
main: 'dist/index.js' |
Oops, something went wrong.