ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
class.ilMailValueObject.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24{
25 private readonly MailAttachments $attachments;
26
30 public function __construct(
31 private readonly string $from,
32 private readonly string $recipients,
33 private readonly string $recipients_cc,
34 private readonly string $recipients_bcc,
35 private readonly string $subject,
36 private readonly string $body,
38 private readonly bool $use_placeholders = false,
39 private readonly bool $save_in_sent_box = false
40 ) {
41 if (ilStr::strLen($this->subject) > 255) {
42 throw new InvalidArgumentException('Subject must not be longer than 255 characters');
43 }
44 $this->attachments = $attachments ?? MailAttachments::empty();
45 }
46
47 public function getRecipients(): string
48 {
49 return $this->recipients;
50 }
51
52 public function getRecipientsCC(): string
53 {
54 return $this->recipients_cc;
55 }
56
57 public function getRecipientsBCC(): string
58 {
59 return $this->recipients_bcc;
60 }
61
62 public function getSubject(): string
63 {
64 return $this->subject;
65 }
66
67 public function getBody(): string
68 {
69 return $this->body;
70 }
71
73 {
74 return $this->attachments;
75 }
76
77 public function isUsingPlaceholders(): bool
78 {
79 return $this->use_placeholders;
80 }
81
82 public function shouldSaveInSentBox(): bool
83 {
84 return $this->save_in_sent_box;
85 }
86
87 public function getFrom(): string
88 {
89 return $this->from;
90 }
91}
readonly MailAttachments $attachments
__construct(private readonly string $from, private readonly string $recipients, private readonly string $recipients_cc, private readonly string $recipients_bcc, private readonly string $subject, private readonly string $body, ?MailAttachments $attachments=null, private readonly bool $use_placeholders=false, private readonly bool $save_in_sent_box=false)
static strLen(string $a_string)
Definition: class.ilStr.php:60
$body
Definition: ltiauth.php:41