messaging

package
v0.0.0-...-1cf31ce Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COLLECTION_NAME_EMAIL_TEMPLATES = "email-templates"
	COLLECTION_NAME_EMAIL_SCHEDULES = "auto-messages"
	COLLECTION_NAME_OUTGOING_EMAILS = "outgoing-emails"
	COLLECTION_NAME_SENT_EMAILS     = "sent-emails"
)

collection names

Variables

This section is empty.

Functions

This section is empty.

Types

type MessagingDBService

type MessagingDBService struct {
	DBClient *mongo.Client

	DBNamePrefix string
	InstanceIDs  []string
	// contains filtered or unexported fields
}

func NewMessagingDBService

func NewMessagingDBService(configs db.DBConfig) (*MessagingDBService, error)

func (*MessagingDBService) DeleteEmailTemplate

func (messagingDBService *MessagingDBService) DeleteEmailTemplate(instanceID string, messageType string, studyKey string) error

delete an email template by message type and study key

func (*MessagingDBService) DeleteScheduledEmail

func (dbService *MessagingDBService) DeleteScheduledEmail(instanceID string, id string) error

delete scheduled email

func (*MessagingDBService) GetAllScheduledEmails

func (dbService *MessagingDBService) GetAllScheduledEmails(instanceID string) ([]messagingTypes.ScheduledEmail, error)

get all scheduled emails

func (*MessagingDBService) GetEmailTemplateByID

func (messagingDBService *MessagingDBService) GetEmailTemplateByID(instanceID string, id string) (*messagingTypes.EmailTemplate, error)

find one email template by id

func (*MessagingDBService) GetEmailTemplatesForAllStudies

func (messagingDBService *MessagingDBService) GetEmailTemplatesForAllStudies(instanceID string) ([]messagingTypes.EmailTemplate, error)

find all email templates with study key non-empty

func (*MessagingDBService) GetGlobalEmailTemplateByMessageType

func (messagingDBService *MessagingDBService) GetGlobalEmailTemplateByMessageType(instanceID string, messageType string) (*messagingTypes.EmailTemplate, error)

find one email template by message type and study key empty

func (*MessagingDBService) GetGlobalEmailTemplates

func (messagingDBService *MessagingDBService) GetGlobalEmailTemplates(instanceID string) ([]messagingTypes.EmailTemplate, error)

find all email templates with study key empty

func (*MessagingDBService) GetScheduledEmailByID

func (dbService *MessagingDBService) GetScheduledEmailByID(instanceID string, id string) (*messagingTypes.ScheduledEmail, error)

get scheduled email by id

func (*MessagingDBService) GetStudyEmailTemplateByMessageType

func (messagingDBService *MessagingDBService) GetStudyEmailTemplateByMessageType(instanceID string, studyKey string, messageType string) (*messagingTypes.EmailTemplate, error)

find one email template by message type and study key

func (*MessagingDBService) GetStudyEmailTemplates

func (messagingDBService *MessagingDBService) GetStudyEmailTemplates(instanceID string, studyKey string) ([]messagingTypes.EmailTemplate, error)

find all email templates by study key

func (*MessagingDBService) SaveEmailTemplate

func (messagingDBService *MessagingDBService) SaveEmailTemplate(instanceID string, emailTemplate messagingTypes.EmailTemplate) (messagingTypes.EmailTemplate, error)

save email template (if id is empty, insert, else update)

func (*MessagingDBService) SaveScheduledEmail

func (dbService *MessagingDBService) SaveScheduledEmail(instanceID string, scheduledEmail messagingTypes.ScheduledEmail) (messagingTypes.ScheduledEmail, error)

save scheduled email

Jump to

Keyboard shortcuts

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