notifications

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 15, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationMDField

type NotificationMDField struct {
	Name string
	// contains filtered or unexported fields
}

NotificationMDField is used to represented a Metadata parameter used for templating a message

func (NotificationMDField) Is

Is sets the 'Value' field of the notificationMDField

func (NotificationMDField) TemplateName

func (n NotificationMDField) TemplateName() string

TemplateName returns the template version of the MDField's name

type NotificationPayload

type NotificationPayload struct {
	ToEntity   string            `json:"toEntity"`
	FromEntity string            `json:"fromEntity"`
	Template   string            `json:"template"`
	Metadata   map[string]string `json:"metadata"`
	Code       string            `json:"code"`
}

NotificationPayload is a struct to represent an instantiated notification of a specific type

type NotificationType

type NotificationType struct {
	Code string
	//IsEnabled bool
	Fields   []NotificationMDField
	Template string
}

NotificationType is a struct to represent a non-instantiated notification

func (NotificationType) Send

func (n NotificationType) Send(rh models.RequestHandler, to, from string, mdFields ...NotificationMDField)

Send creates a new instantiation of the given notification type with the supplied metadata and sends it

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL