feat: turn off notification via email (#14520)

This commit is contained in:
Joobi S B
2024-09-11 11:10:24 -03:00
committed by GitHub
parent 5bd19f8ba3
commit 3301212972
9 changed files with 153 additions and 14 deletions
+10 -7
View File
@@ -3499,6 +3499,7 @@ func (q *sqlQuerier) EnqueueNotificationMessage(ctx context.Context, arg Enqueue
const fetchNewMessageMetadata = `-- name: FetchNewMessageMetadata :one
SELECT nt.name AS notification_name,
nt.id AS notification_template_id,
nt.actions AS actions,
nt.method AS custom_method,
u.id AS user_id,
@@ -3517,13 +3518,14 @@ type FetchNewMessageMetadataParams struct {
}
type FetchNewMessageMetadataRow struct {
NotificationName string `db:"notification_name" json:"notification_name"`
Actions []byte `db:"actions" json:"actions"`
CustomMethod NullNotificationMethod `db:"custom_method" json:"custom_method"`
UserID uuid.UUID `db:"user_id" json:"user_id"`
UserEmail string `db:"user_email" json:"user_email"`
UserName string `db:"user_name" json:"user_name"`
UserUsername string `db:"user_username" json:"user_username"`
NotificationName string `db:"notification_name" json:"notification_name"`
NotificationTemplateID uuid.UUID `db:"notification_template_id" json:"notification_template_id"`
Actions []byte `db:"actions" json:"actions"`
CustomMethod NullNotificationMethod `db:"custom_method" json:"custom_method"`
UserID uuid.UUID `db:"user_id" json:"user_id"`
UserEmail string `db:"user_email" json:"user_email"`
UserName string `db:"user_name" json:"user_name"`
UserUsername string `db:"user_username" json:"user_username"`
}
// This is used to build up the notification_message's JSON payload.
@@ -3532,6 +3534,7 @@ func (q *sqlQuerier) FetchNewMessageMetadata(ctx context.Context, arg FetchNewMe
var i FetchNewMessageMetadataRow
err := row.Scan(
&i.NotificationName,
&i.NotificationTemplateID,
&i.Actions,
&i.CustomMethod,
&i.UserID,
@@ -1,6 +1,7 @@
-- name: FetchNewMessageMetadata :one
-- This is used to build up the notification_message's JSON payload.
SELECT nt.name AS notification_name,
nt.id AS notification_template_id,
nt.actions AS actions,
nt.method AS custom_method,
u.id AS user_id,