mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-01-07 04:40:05 -06:00
add share url to email text
Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
@@ -1 +1,3 @@
|
||||
{{ .ShareSharer }} has shared {{ .ShareFolder }} with you.
|
||||
{{ .ShareSharer }} has shared {{ .ShareFolder }} with you.
|
||||
|
||||
Link: {{ .ShareLink }}
|
||||
@@ -2,6 +2,7 @@ package service
|
||||
|
||||
import (
|
||||
"context"
|
||||
"net/url"
|
||||
"os"
|
||||
"os/signal"
|
||||
"syscall"
|
||||
@@ -228,10 +229,21 @@ func (s eventsNotifier) handleShareCreated(e events.ShareCreated) {
|
||||
return
|
||||
}
|
||||
|
||||
shareLink, err := url.JoinPath(e.Executant.Idp, "files/shares/with-me")
|
||||
|
||||
if err != nil {
|
||||
s.logger.Error().
|
||||
Err(err).
|
||||
Str("event", "ShareCreated").
|
||||
Msg("could not create link to the share")
|
||||
return
|
||||
}
|
||||
|
||||
msg, err := email.RenderEmailTemplate("shareCreated.email.tmpl", map[string]string{
|
||||
// TODO: add additional fields here (like link etc.)
|
||||
"ShareSharer": userResponse.User.DisplayName,
|
||||
"ShareFolder": md.Info.Name,
|
||||
"ShareLink": shareLink,
|
||||
}, s.emailTemplatePath)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user