dolibarr 19.0.3
InterfaceTicketEmail Class Reference

Class of triggers for ticket module. More...

Inheritance diagram for InterfaceTicketEmail:
Collaboration diagram for InterfaceTicketEmail:

Public Member Functions

 __construct ($db)
 Constructor.
 
 runTrigger ($action, $object, User $user, Translate $langs, Conf $conf)
 Function called when a Dolibarrr business event is done.
 
- Public Member Functions inherited from DolibarrTriggers
 __construct (DoliDB $db)
 Constructor.
 
 getName ()
 Returns the name of the trigger file.
 
 getDesc ()
 Returns the description of trigger file.
 
 getVersion ()
 Returns the version of the trigger file.
 
 setErrorsFromObject ($object)
 setErrorsFromObject
 

Private Member Functions

 composeAndSendAdminMessage ($sendto, $base_subject, $body, Ticket $object, Translate $langs)
 Composes and sends a message concerning a ticket, to be sent to admin address.
 
 composeAndSendCustomerMessage ($sendto, $base_subject, $body, $see_ticket, Ticket $object, Translate $langs)
 Composes and sends a message concerning a ticket, to be sent to customer addresses.
 

Detailed Description

Class of triggers for ticket module.

Definition at line 32 of file interface_50_modTicket_TicketEmail.class.php.

Constructor & Destructor Documentation

◆ __construct()

InterfaceTicketEmail::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

Definition at line 39 of file interface_50_modTicket_TicketEmail.class.php.

References description, and name.

Member Function Documentation

◆ composeAndSendAdminMessage()

InterfaceTicketEmail::composeAndSendAdminMessage ( $sendto,
$base_subject,
$body,
Ticket $object,
Translate $langs )
private

Composes and sends a message concerning a ticket, to be sent to admin address.

Parameters
string$sendtoAddresses to send the mail, format "first@address.net, second@address.net," etc.
string$base_subjectemail subject. Non-translated string.
string$bodyemail body (first line). Non-translated string.
Ticket$objectthe ticket thet the email refers to
Translate$langsthe translation object
Returns
void

Definition at line 307 of file interface_50_modTicket_TicketEmail.class.php.

References dol_nl2br(), dol_syslog(), dol_textishtml(), and getDolGlobalString().

Referenced by runTrigger().

◆ composeAndSendCustomerMessage()

InterfaceTicketEmail::composeAndSendCustomerMessage ( $sendto,
$base_subject,
$body,
$see_ticket,
Ticket $object,
Translate $langs )
private

Composes and sends a message concerning a ticket, to be sent to customer addresses.

Parameters
string$sendtoAddresses to send the mail, format "first@address.net, second@address.net, " etc.
string$base_subjectemail subject. Non-translated string.
string$bodyemail body (first line). Non-translated string.
string$see_ticketstring indicating the ticket public address
Ticket$objectthe ticket thet the email refers to
Translate$langsthe translation object
Returns
void

Definition at line 379 of file interface_50_modTicket_TicketEmail.class.php.

References dol_buildpath(), dol_eval(), dol_nl2br(), dol_now(), dol_syslog(), dol_textishtml(), and getDolGlobalString().

Referenced by runTrigger().

◆ runTrigger()

InterfaceTicketEmail::runTrigger ( $action,
$object,
User $user,
Translate $langs,
Conf $conf )

Function called when a Dolibarrr business event is done.

All functions "runTrigger" are triggered if file is inside directory htdocs/core/triggers

Parameters
string$actionEvent action code
Ticket$objectObject
User$userObject user
Translate$langsObject langs
conf$confObject conf
Returns
int Return integer <0 if KO, 0 if no triggered ran, >0 if OK

Reimplemented from DolibarrTriggers.

Definition at line 61 of file interface_50_modTicket_TicketEmail.class.php.

References composeAndSendAdminMessage(), composeAndSendCustomerMessage(), Contact(), dol_nl2br(), dol_syslog(), dolGetFirstLastname(), getDolGlobalString(), GETPOST(), name, and setEventMessages().


The documentation for this class was generated from the following file: