Skip to content

Commit 0c1e25e

Browse files
authored
Merge pull request #1611 from sonntam/feat/signalapi_text_mode
feat: add text mode feature for signal REST API
2 parents b5b6367 + a43935b commit 0c1e25e

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

docs/notif/signalrest.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,9 @@ You can send Signal notifications via the Signal REST API with the following set
1515
recipients:
1616
- "+00472323111337"
1717
timeout: 10s
18+
textMode: styled
1819
templateBody: |
19-
Docker tag {{ .Entry.Image }} which you subscribed to through {{ .Entry.Provider }} provider has been released.
20+
Docker tag **{{ .Entry.Image }}** which you subscribed to through {{ .Entry.Provider }} provider has been released.
2021
```
2122

2223
| Name | Default | Description |
@@ -25,6 +26,7 @@ You can send Signal notifications via the Signal REST API with the following set
2526
| `number`[^1] | | The senders number you registered |
2627
| `recipients`[^1] | | A list of recipients, either phone numbers or group ID's |
2728
| `timeout` | `10s` | Timeout specifies a time limit for the request to be made |
29+
| `textMode` | | Sets the text mode for messages. Use `styled` for formatted text. |
2830
| `tlsSkipVerify` | `false` | Skip TLS certificate verification |
2931
| `tlsCaCertFiles` | | List of paths to custom CA certificate files to use for TLS verification |
3032
| `templateBody`[^1] | See [below](#default-templatebody) | [Notification template](../faq.md#notification-template) for message body |
@@ -36,6 +38,7 @@ You can send Signal notifications via the Signal REST API with the following set
3638
* `DIUN_NOTIF_SIGNALREST_TLSSKIPVERIFY`
3739
* `DIUN_NOTIF_SIGNALREST_TLSCACERTFILES`
3840
* `DIUN_NOTIF_SIGNALREST_TIMEOUT`
41+
* `DIUN_NOTIF_SIGNALREST_TEXTMODE`
3942

4043
### Default `templateBody`
4144

internal/model/notif_signalrest.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type NotifSignalRest struct {
1919
TLSSkipVerify bool `yaml:"tlsSkipVerify,omitempty" json:"tlsSkipVerify,omitempty" validate:"omitempty"`
2020
TLSCACertFiles []string `yaml:"tlsCaCertFiles,omitempty" json:"tlsCaCertFiles,omitempty" validate:"omitempty"`
2121
TemplateBody string `yaml:"templateBody,omitempty" json:"templateBody,omitempty" validate:"required"`
22+
TextMode string `yaml:"textMode,omitempty" json:"textMode,omitempty" validate:"omitempty"`
2223
}
2324

2425
// GetDefaults gets the default values

internal/notif/signalrest/client.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,12 @@ func (c *Client) Send(entry model.NotifEntry) error {
5555
Message string `json:"message"`
5656
Number string `json:"number"`
5757
Recipients []string `json:"recipients"`
58+
TextMode string `json:"text_mode"`
5859
}{
5960
Message: string(bodyrender),
6061
Number: c.cfg.Number,
6162
Recipients: c.cfg.Recipients,
63+
TextMode: c.cfg.TextMode,
6264
})
6365
if err != nil {
6466
return err

0 commit comments

Comments
 (0)