Skip to content

Commit 6de53bc

Browse files
committed
feat: be able to share the hauk url from the gotify notification
This will be nice to be able to share the url with chat apps for example without open the link ourself. I did the gotify android PR to make this working. This can be merge before the gotify android but will not work while not merged gotify/android#236.
1 parent 261fe45 commit 6de53bc

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

notification/notifier.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ func (t *notifier) NotifyNewSession(topic string, URL string) {
4040
"contentType": "text/markdown",
4141
},
4242
"client::notification": map[string]interface{}{
43-
"click": map[string]interface{}{"url": URL},
43+
"click": map[string]interface{}{"url": URL},
44+
"actions": map[string]interface{}{"share": URL},
4445
},
4546
}
4647

@@ -62,8 +63,8 @@ func (t *notifier) NotifyNewSession(topic string, URL string) {
6263
if t.config.Smtp.Enabled {
6364
host := fmt.Sprintf("%s:%d", t.config.Smtp.Host, t.config.Smtp.Port)
6465
var auth smtp.Auth
65-
if t.config.Smtp.Login != "" {
66-
auth = smtp.PlainAuth("", t.config.Smtp.Login, t.config.Smtp.Password, t.config.Smtp.Host)
66+
if t.config.Smtp.Login != "" {
67+
auth = smtp.PlainAuth("", t.config.Smtp.Login, t.config.Smtp.Password, t.config.Smtp.Host)
6768
}
6869
err := smtp.SendMail(host, auth, t.config.Smtp.From, []string{t.config.Smtp.To}, []byte(fmt.Sprintf("Subject: Forwarding %s to Hauk\r\n\r\nNew session: %s", topic, URL)))
6970
if err != nil {

0 commit comments

Comments
 (0)