CLOSE|Close #29274 Add possibility to have different mail for autocopy for holiday (#29275)

* Add handdling of multiple autocopy mail to in CMailFile class __construct function

* Change mail to autocopy to for leaves

* Remove new param and set $sendtobcc to MAIN_MAIL_AUTOCOPY_HOLIDAY_TO
This commit is contained in:
Lucas Noirie 2024-04-08 23:13:04 +02:00 committed by GitHub
parent e23ccabf36
commit 4aca06174c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 5 deletions

View File

@ -554,7 +554,9 @@ if (empty($reshook)) {
$trackid = 'leav'.$object->id;
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
$sendtobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_HOLIDAY_TO');
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', $sendtobcc, 0, 1, '', '', $trackid);
// Sending the email
$result = $mail->sendfile();
@ -677,7 +679,9 @@ if (empty($reshook)) {
$trackid = 'leav'.$object->id;
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
$sendtobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_HOLIDAY_TO');
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', $sendtobcc, 0, 1, '', '', $trackid);
// Sending email
$result = $mail->sendfile();
@ -760,7 +764,9 @@ if (empty($reshook)) {
$trackid = 'leav'.$object->id;
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
$sendtobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_HOLIDAY_TO');
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', $sendtobcc, 0, 1, '', '', $trackid);
// sending email
$result = $mail->sendfile();
@ -907,7 +913,9 @@ if (empty($reshook)) {
$trackid = 'leav'.$object->id;
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
$sendtobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_HOLIDAY_TO');
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', $sendtobcc, 0, 1, '', '', $trackid);
// sending email
$result = $mail->sendfile();

View File

@ -778,7 +778,9 @@ function sendMail($id, $cancreate, $now, $autoValidation)
$trackid = 'leav'.$object->id;
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', '', 0, 1, '', '', $trackid);
$sendtobcc = getDolGlobalString('MAIN_MAIL_AUTOCOPY_HOLIDAY_TO');
$mail = new CMailFile($subject, $emailTo, $emailFrom, $message, array(), array(), array(), '', $sendtobcc, 0, 1, '', '', $trackid);
// Sending the email
$result = $mail->sendfile();