diff --git a/channels/database/database.go b/channels/database/database.go index 02cd91f..3334816 100644 --- a/channels/database/database.go +++ b/channels/database/database.go @@ -34,6 +34,7 @@ func (database *Database) Send(message *notification.Message, context *qor.Conte Title: message.Title, Body: message.Body, MessageType: message.MessageType, + Data: message.Data, ResolvedAt: message.ResolvedAt, } diff --git a/message.go b/message.go index ebf5f54..28ccf68 100644 --- a/message.go +++ b/message.go @@ -13,6 +13,7 @@ type Message struct { Title string Body string MessageType string + Data []byte ResolvedAt *time.Time } @@ -23,6 +24,7 @@ type QorNotification struct { Title string Body string `sql:"size:65532"` MessageType string + Data []byte `sql:"size:65532"` ResolvedAt *time.Time } diff --git a/views/notifications/notification.tmpl b/views/notifications/notification.tmpl index 157e080..f62567c 100644 --- a/views/notifications/notification.tmpl +++ b/views/notifications/notification.tmpl @@ -2,42 +2,42 @@ {{$context := .}}
-

+

{{$message.Title}} -

+ -
+
{{raw $message.Body}} -
+
-
+
{{range $action := $message.Actions $context}} - {{if (and $action.URL (eq $action.Method "GET"))}} + {{if (and $action.URL (eq $action.Method "GET"))}} - {{t (printf "qor_notification.actions.%v" $action.Label) $action.Label}} + {{t (printf "qor_notification.actions.%v" $action.Label) $action.Label}} - {{else}} + {{else}} - + - {{end}} {{end}} -
+ {{end}} +