add method for direct notification sending
This commit is contained in:
@@ -120,12 +120,16 @@ func (c *controller) handle(ctx echo.Context) error {
|
||||
return routeutils.HandleAPIError(ctx, err)
|
||||
}
|
||||
|
||||
fmt.Println("\n\nSend email\n\n")
|
||||
//Send email notification to Authorized user
|
||||
notifications := make([]viewmodel.Notification, 1)
|
||||
notifications = append(notifications, viewmodel.Notification{Type: "email", From: c.cfg.Email.Sender, To: *user.Email, Subject: notificationEmailSubject, Message: notificationEmailBody})
|
||||
notification := viewmodel.Notification{
|
||||
Type: "email",
|
||||
From: c.cfg.Email.Sender,
|
||||
To: *user.Email,
|
||||
Subject: notificationEmailSubject,
|
||||
Message: notificationEmailBody,
|
||||
}
|
||||
|
||||
notifications, err = c.svc.Notification.SendNotifications(notifications)
|
||||
notification, err = c.svc.Notification.SendNotificationWithoutWritingToDatabase(notification)
|
||||
if err != nil {
|
||||
return routeutils.HandleAPIError(ctx, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user