19 declare(strict_types=1);
45 $value_objects = $this->mail_json_service->convertFromJson((
string) $input[1]->
getValue());
47 foreach ($value_objects as $value_object) {
50 $mail->setSaveInSentbox($value_object->shouldSaveInSentBox());
51 $context_id = $input[2]->getValue();
53 ->withContextId((
string) $context_id)
54 ->withContextParameters((array) unserialize($input[3]->
getValue(), [
'allowed_classes' =>
false]));
56 $recipients = $value_object->getRecipients();
57 $recipients_cc = $value_object->getRecipientsCC();
58 $recipients_bcc = $value_object->getRecipientsBCC();
60 $this->dic->logger()->mail()->info(
62 'Mail delivery to recipients: "%s" CC: "%s" BCC: "%s" From sender: "%s"',
66 $value_object->getFrom()
74 $value_object->getSubject(),
75 $value_object->getBody(),
76 $value_object->getAttachments(),
77 $value_object->isUsingPlaceholders()
79 $mail->sendMail($mail_data);
readonly ILIAS DI Container $dic
run(array $input, Observer $observer)
readonly ilMailValueObjectJsonService $mail_json_service
getExpectedTimeOfTaskInSeconds()