notification

package
v0.0.0-...-e31961d Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	TypeSMS         = 1
	TypeEmail       = 2
	TypePushMessage = 3

	TemplateTypePushMessage = "pushmessage"
	TemplateTypeSMS         = "sms"
	TemplateTypeEmail       = "email"
)

type of notification

View Source
var (
	ProviderNexmo = 1
)

notification providers

Functions

This section is empty.

Types

type Client

type Client interface {
	Send(templateName string) error
}

Client interface

type EmailNotification

type EmailNotification struct {
	To string
	Cc string
}

EmailNotification struct

type Notification

type Notification struct {
	UserID     int64
	Title      string
	Message    string
	DetailBody string
	Image      string
	WebLink    string
	Purpose    int
	DeviceID   device.Device
	// either push, sms or email
	NotifData interface{}
}

Notification struct

func (Notification) Validate

func (n Notification) Validate() error

Validate notification param

type Options

type Options struct {
	InboxSave bool
	Fake      bool
}

Options of notification

type Purpose

type Purpose int

Purpose of notification

var (
	PurposeEmpty                  Purpose = 0
	PurposeSystemUpdate           Purpose = 1
	PurposeAuthenticationOTP      Purpose = 2
	PurposeAuthenticationPayment  Purpose = 3
	PurposeAuthenticationWithdraw Purpose = 4
	PurposePromotion              Purpose = 5
	PurposeReminder               Purpose = 6
)

purpose of notification

type PushNotification

type PushNotification struct {
	// if device token is present, then the device token is used rather than seeking in session
	// this is useful in user register flow
	DeviceToken string
}

PushNotification struct

type SMSNotification

type SMSNotification struct {
	From     string
	ToMSISDN string
}

SMSNotification struct

type SendOptions

type SendOptions struct {
	DryRun bool
}

SendOptions struct

type UserNotification

type UserNotification struct {
	ID             string
	UserID         int64
	ProviderType   int
	ProviderID     int
	ProviderSendID string
	Purpose        int
	IsWebpage      bool
	Status         int
	Title          string
	Message        string
	Show           bool
	HasDetail      bool
	Read           bool
	CreatedAt      time.Time
	UpdatedAt      time.Time
	IsDeleted      bool
	IsTest         bool
	Detail         UserNotificationDetail
}

UserNotification struct

type UserNotificationDetail

type UserNotificationDetail struct {
	NotificationID string
	Body           string
	WebLink        string
	CreatedAt      time.Time
	IsDeleted      bool
	IsTest         bool
}

UserNotificationDetail struct

Jump to

Keyboard shortcuts

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