notificationevents

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: Apache-2.0 Imports: 22 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package notificationevents evaluates the ticket notification rules managed under Admin -> Ticket Notifications (the OTRS notification_event, notification_event_item and notification_event_message tables) and queues the resulting email on mail_queue for the email runner to send.

Index

Constants

This section is empty.

Variables

View Source
var ArticleEvents = []string{
	"ArticleCreate",
}

ArticleEvents are the article events a notification rule can subscribe to.

View Source
var TicketEvents = []string{
	"TicketCreate",
	"TicketTitleUpdate",
	"TicketQueueUpdate",
	"TicketTypeUpdate",
	"TicketCustomerUpdate",
	"TicketPendingTimeUpdate",
	"TicketLockUpdate",
	"TicketStateUpdate",
	"TicketOwnerUpdate",
	"TicketResponsibleUpdate",
	"TicketPriorityUpdate",
	"TicketMerge",
	"EscalationResponseTimeNotifyBefore",
	"EscalationResponseTimeStart",
	"EscalationResponseTimeStop",
	"EscalationUpdateTimeNotifyBefore",
	"EscalationUpdateTimeStart",
	"EscalationUpdateTimeStop",
	"EscalationSolutionTimeNotifyBefore",
	"EscalationSolutionTimeStart",
	"EscalationSolutionTimeStop",
	"NotificationNewTicket",
	"NotificationAddNote",
	"NotificationMove",
	"NotificationOwnerUpdate",
	"NotificationResponsibleUpdate",
	"NotificationEscalation",
	"NotificationEscalationNotifyBefore",
}

TicketEvents are the ticket events a notification rule can subscribe to, in the order the admin form lists them. Each one is raised from a row GoatFlow writes: TicketCreate from the ticket table, the others from ticket_history (see historyEvents). The Notification* names are the OTRS legacy events used by notifications imported from OTRS.

Functions

func ValidateRecipientEmail

func ValidateRecipientEmail(value string) error

ValidateRecipientEmail checks a RecipientEmail value as the admin form stores it: bare addresses separated by commas, semicolons or whitespace, at most 200 characters (notification_event_item.event_value).

Types

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service evaluates notification rules for new ticket, article and history rows. Run it periodically from one goroutine per process (the runner task does); several processes may run it concurrently, the cursor update in each transaction makes sure every row is evaluated once.

func NewService

func NewService(db *sql.DB, logger *log.Logger) *Service

NewService returns a service on db.

func (*Service) RunOnce

func (s *Service) RunOnce(ctx context.Context) (int, error)

RunOnce evaluates the rows that settled since the previous run and returns how many emails it queued.

Jump to

Keyboard shortcuts

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