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 ¶
var ArticleEvents = []string{
"ArticleCreate",
}
ArticleEvents are the article events a notification rule can subscribe to.
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 ¶
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 ¶
NewService returns a service on db.