Documentation ¶
Overview ¶
Interface for all notification capabilities (sending emails to users and the UI)
Index ¶
- type NotificationManager
- type NotificationStack
- func (n *NotificationStack) GetTrack(userid string) (bool, bool)
- func (n *NotificationStack) GetUINotifications(userid string) ([]pixlUser.UINotificationItem, error)
- func (n *NotificationStack) SendAll(topic string, templateInput map[string]interface{}, userOverride []string, ...) error
- func (n *NotificationStack) SendAllDataSource(topic string, templateInput map[string]interface{}, userOverride []string, ...) error
- func (n *NotificationStack) SendGlobalEmail(content string, subject string) error
- func (n *NotificationStack) SendUINotification(newNotification pixlUser.UINotificationItem) error
- func (n *NotificationStack) SetTrack(userid string, track bool)
- type TemplateContents
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NotificationManager ¶
type NotificationManager interface { // Sending notifications SendGlobalEmail(content string, subject string) error SendAll(topic string, templateInput map[string]interface{}, userOverride []string, includeadmin bool) error SendAllDataSource(topic string, templateInput map[string]interface{}, userOverride []string, includeadmin bool, topicoverride string) error // UI-specific notifications SendUINotification(newNotification pixlUser.UINotificationItem) error GetUINotifications(userid string) ([]pixlUser.UINotificationItem, error) // Run-time cached list of users who are tracked GetTrack(userid string) (bool, bool) SetTrack(userid string, track bool) }
type NotificationStack ¶
type NotificationStack struct { Track cmap.ConcurrentMap //map[string]bool // contains filtered or unexported fields }
NotificationStack - Thing that manages user notifications on UI and email including preferences
func MakeNotificationStack ¶
func MakeNotificationStack(mongoClient *mongo.Client, envName string, timestamper timestamper.ITimeStamper, log logger.ILogger, adminEmails []string) (*NotificationStack, error)
func (*NotificationStack) GetTrack ¶
func (n *NotificationStack) GetTrack(userid string) (bool, bool)
func (*NotificationStack) GetUINotifications ¶
func (n *NotificationStack) GetUINotifications(userid string) ([]pixlUser.UINotificationItem, error)
GetUINotifications - Return Notifications for user and remove from stack
func (*NotificationStack) SendAll ¶
func (n *NotificationStack) SendAll(topic string, templateInput map[string]interface{}, userOverride []string, includeadmin bool) error
SendAll - Generic function to trigger the same notification across all services to users who are signed up to receive them.
func (*NotificationStack) SendAllDataSource ¶
func (n *NotificationStack) SendAllDataSource(topic string, templateInput map[string]interface{}, userOverride []string, includeadmin bool, topicoverride string) error
SendAllDataSource - Slight tweak to allow us to lookup topics for updates by the same tag and define emails instead of userids
func (*NotificationStack) SendGlobalEmail ¶
func (n *NotificationStack) SendGlobalEmail(content string, subject string) error
SendGlobalEmail - Send an email to all users.
func (*NotificationStack) SendUINotification ¶
func (n *NotificationStack) SendUINotification(newNotification pixlUser.UINotificationItem) error
SendUINotification - Dispatch notification to the stack
func (*NotificationStack) SetTrack ¶
func (n *NotificationStack) SetTrack(userid string, track bool)
type TemplateContents ¶
type TemplateContents struct { ContentMap pixlUser.UserStruct TemplateMap map[string]interface{} }
TemplateContents - Structure for template injection