chore: udpate docs, fix config binding

pull/57/head
charconstpointer 3 years ago
parent 628a168de1
commit 51a59136f5

@ -754,3 +754,53 @@ jobs:
| WECHAT_RECEIVER_IDS | "" | | WECHAT_RECEIVER_IDS | "" |
| WECHAT_MSG_TITLE | "" | | WECHAT_MSG_TITLE | "" |
| WECHAT_MESSAGE | "" | | WECHAT_MESSAGE | "" |
## TextMagic
TextMagic allows you to send SMS to multiple receivers provided by comma separated string.
```bash
pingme textmagic \
--token 'tokenabc' \
--user 'sid123' \
--subject '+140001442' \
--receiver '+140001442' \
--msg 'some message'
```
- GitHub Action
```yaml
on: [push]
jobs:
pingme-job:
runs-on: ubuntu-latest
name: PingMe
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Ping me On
uses: kha7iq/pingme-action@v1
env:
TEAMS_WEBHOOK: ${{ secrets.TEAMS_WEBHOOK }}
TEAMS_MSG_TITLE: 'Reference: ${{ github.ref }}'
TEAMS_MESSAGE: 'Event is triggered by ${{ github.event_name }}'
with:
# Chose the messaging platform.
# slack / telegram / rocketchat / teams /
# pushover / discord / email / mattermost / textmagic
service: textmagic
```
- **Variables**
| Variables | Default Value |
| -------------------------- | :----------------: |
| TEAMS_USER | "" |
| TEAMS_TOKEN | "" |
| TEAMS_SUBJECT | "" |
| TEAMS_MESSAGE | "" |
| TEAMS_RECEIVER | "" |

@ -5,6 +5,7 @@ import (
"os" "os"
"github.com/kha7iq/pingme/service/gotify" "github.com/kha7iq/pingme/service/gotify"
"github.com/kha7iq/pingme/service/textmagic"
"github.com/kha7iq/pingme/service/mastodon" "github.com/kha7iq/pingme/service/mastodon"
"github.com/kha7iq/pingme/service/twillio" "github.com/kha7iq/pingme/service/twillio"
@ -56,6 +57,7 @@ email address, Line, Gotify and Wechat.`
line.Send(), line.Send(),
wechat.Send(), wechat.Send(),
gotify.Send(), gotify.Send(),
textmagic.Send(),
} }
err := app.Run(os.Args) err := app.Run(os.Args)

@ -23,7 +23,7 @@ type TextMagic struct {
func Send() *cli.Command { func Send() *cli.Command {
var textMagicOpts TextMagic var textMagicOpts TextMagic
return &cli.Command{ return &cli.Command{
Name: "textMagic", Name: "textmagic",
Usage: "Send message via TextMagic", Usage: "Send message via TextMagic",
UsageText: "pingme textmagic --token 'tokenabc' --user 'sid123' " + UsageText: "pingme textmagic --token 'tokenabc' --user 'sid123' " +
"--receiver '+140001442' --msg 'some message'", "--receiver '+140001442' --msg 'some message'",
@ -55,7 +55,7 @@ You can specify multiple receivers by separating the value with a comma.`,
EnvVars: []string{"TEXTMAGIC_SUBJECT"}, EnvVars: []string{"TEXTMAGIC_SUBJECT"},
}, },
&cli.StringFlag{ &cli.StringFlag{
Destination: &textMagicOpts.Message, Destination: &textMagicOpts.Receivers,
Name: "receiver", Name: "receiver",
Usage: "Receiver(s) of the message", Usage: "Receiver(s) of the message",
Aliases: []string{"r"}, Aliases: []string{"r"},

Loading…
Cancel
Save