Skip to content

Commit

Permalink
Merge pull request #996 from szerencl/pushover-sound
Browse files Browse the repository at this point in the history
Added sound option for pushover
  • Loading branch information
crazy-max authored Oct 7, 2023
2 parents 7af0099 + 6ab5a97 commit 92c1a6a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/notif/pushover.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ You can send notifications using [Pushover](https://pushover.net/).
pushover:
token: uQiRzpo4DXghDmr9QzzfQu27cmVRsG
recipient: gznej3rKEVAvPUxu9vvNnqpmZpokzF
priority: -2
sound: none
templateTitle: "{{ .Entry.Image }} released"
templateBody: |
Docker tag {{ .Entry.Image }} which you subscribed to through {{ .Entry.Provider }} provider has been released.
Expand All @@ -21,6 +23,8 @@ You can send notifications using [Pushover](https://pushover.net/).
| `tokenFile` | | Use content of secret file as Pushover application/API token if `token` not defined |
| `recipient` | | User key to send notification to |
| `recipientFile` | | Use content of secret file as User key if `recipient` not defined |
| `priority` | | Priority of the notification |
| `sound` | | Notification sound to be used |
| `templateTitle`[^1] | See [below](#default-templatetitle) | [Notification template](../faq.md#notification-template) for message title |
| `templateBody`[^1] | See [below](#default-templatebody) | [Notification template](../faq.md#notification-template) for message body |

Expand All @@ -29,6 +33,8 @@ You can send notifications using [Pushover](https://pushover.net/).
* `DIUN_NOTIF_PUSHOVER_TOKENFILE`
* `DIUN_NOTIF_PUSHOVER_RECIPIENT`
* `DIUN_NOTIF_PUSHOVER_RECIPIENTFILE`
* `DIUN_NOTIF_PUSHOVER_PRIORITY`
* `DIUN_NOTIF_PUSHOVER_SOUND`
* `DIUN_NOTIF_PUSHOVER_TEMPLATETITLE`
* `DIUN_NOTIF_PUSHOVER_TEMPLATEBODY`

Expand Down
1 change: 1 addition & 0 deletions internal/model/notif_pushover.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ type NotifPushover struct {
Recipient string `yaml:"recipient,omitempty" json:"recipient,omitempty" validate:"omitempty"`
RecipientFile string `yaml:"recipientFile,omitempty" json:"recipientFile,omitempty" validate:"omitempty,file"`
Priority int `yaml:"priority,omitempty" json:"priority,omitempty" validate:"omitempty,min=-2,max=2"`
Sound string `yaml:"sound,omitempty" json:"sound,omitempty" validate:"omitempty"`
TemplateTitle string `yaml:"templateTitle,omitempty" json:"templateTitle,omitempty" validate:"required"`
TemplateBody string `yaml:"templateBody,omitempty" json:"templateBody,omitempty" validate:"required"`
}
Expand Down
1 change: 1 addition & 0 deletions internal/notif/pushover/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (c *Client) Send(entry model.NotifEntry) error {
Title: string(title),
Message: string(body),
Priority: c.cfg.Priority,
Sound: c.cfg.Sound,
URL: c.meta.URL,
URLTitle: c.meta.Name,
Timestamp: time.Now().Unix(),
Expand Down

0 comments on commit 92c1a6a

Please sign in to comment.