dolibarr 25.0.0-alpha
InterfaceTicketEmail Class Reference

Class of triggers for ticket module. More...

Inheritance diagram for InterfaceTicketEmail:
Collaboration diagram for InterfaceTicketEmail:

Public Member Functions

 __construct ($db)
 Constructor.
 
- 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
 
 runTrigger ($action, $object, User $user, Translate $langs, Conf $conf)
 Function called when a Dolibarr business event is done.
 

Private Member Functions

 getTicketNotificationTemplate (Ticket $object, Translate $langs)
 Get the subject and body of the email template set up with TICKET_NOTIFICATION_EMAIL_TEMPLATE.
 
 composeAndSendAdminMessage ($sendto, $base_subject, $body, Ticket $object, Translate $langs, $filepaths=array(), $mimetypes=array(), $filenames=array())
 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, $filepaths=array(), $mimetypes=array(), $filenames=array())
 Composes and sends a message concerning a ticket, to be sent to customer addresses.
 
 composeAndSendAssigneeMessage ($sendto, $base_subject, $body, $see_ticket, Ticket $object, Translate $langs, $filepaths=array(), $mimetypes=array(), $filenames=array())
 Composes and sends a message concerning a ticket, to be sent to user assigned to the ticket.
 

Detailed Description

Class of triggers for ticket module.

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

Constructor & Destructor Documentation

◆ __construct()

InterfaceTicketEmail::__construct ( $db)

Constructor.

Parameters
DoliDB$dbDatabase handler

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

References description, name, and version.

Member Function Documentation

◆ composeAndSendAdminMessage()

InterfaceTicketEmail::composeAndSendAdminMessage ( $sendto,
$base_subject,
$body,
Ticket $object,
Translate $langs,
$filepaths = array(),
$mimetypes = array(),
$filenames = array() )
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 that the email refers to
Translate$langsthe translation object
array<string>$filepaths File paths
array<string>$mimetypes Mime types
array<string>$filenames File names
Returns
void

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

References $conf, $mysoc, $object, dol_nl2br(), dol_syslog(), dol_textishtml(), getDolGlobalString(), and getTicketNotificationTemplate().

◆ composeAndSendAssigneeMessage()

InterfaceTicketEmail::composeAndSendAssigneeMessage ( $sendto,
$base_subject,
$body,
$see_ticket,
Ticket $object,
Translate $langs,
$filepaths = array(),
$mimetypes = array(),
$filenames = array() )
private

Composes and sends a message concerning a ticket, to be sent to user assigned to the ticket.

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 that the email refers to
Translate$langsthe translation object
array<string>$filepaths File paths
array<string>$mimetypes Mime types
array<string>$filenames File names
Returns
void

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

References $conf, $mysoc, $object, dol_nl2br(), dol_now(), dolGetFirstLastname(), getDolGlobalString(), and getDolUserString().

◆ composeAndSendCustomerMessage()

InterfaceTicketEmail::composeAndSendCustomerMessage ( $sendto,
$base_subject,
$body,
$see_ticket,
Ticket $object,
Translate $langs,
$filepaths = array(),
$mimetypes = array(),
$filenames = array() )
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 that the email refers to
Translate$langsthe translation object
array<string>$filepaths File paths
array<string>$mimetypes Mime types
array<string>$filenames File names
Returns
void

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

References $conf, $mysoc, $object, dol_buildpath(), dol_eval(), dol_nl2br(), dol_now(), dol_syslog(), dol_textishtml(), getDolGlobalInt(), and getDolGlobalString().

◆ getTicketNotificationTemplate()

InterfaceTicketEmail::getTicketNotificationTemplate ( Ticket $object,
Translate $langs )
private

Get the subject and body of the email template set up with TICKET_NOTIFICATION_EMAIL_TEMPLATE.

Returning null means "no template set up, or none usable": the caller then builds the message the way it always did.

Parameters
Ticket$objectThe ticket the email refers to
Translate$langsThe translation object
Returns
?array{subject:string,body:string} Substituted subject and body, or null

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

References $object, complete_substitutions_array(), getDolGlobalString(), and make_substitutions().

Referenced by composeAndSendAdminMessage().


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