ILIAS  release_8 Revision v8.24
class.ilMailValueObject.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
25{
26 private string $recipients;
27 private string $recipientsCC;
28 private string $recipientsBCC;
29 private string $subject;
30 private string $body;
32 private array $attachments;
33 private bool $usePlaceholders;
34 private bool $saveInSentBox;
35 private string $from;
36
41 public function __construct(
42 string $from,
43 string $recipients,
44 string $recipientsCC,
45 string $recipientsBCC,
46 string $subject,
47 string $body,
48 array $attachments,
49 bool $usePlaceholders = false,
50 bool $saveInSentBox = false
51 ) {
52 if (ilStr::strLen($subject) > 255) {
53 throw new InvalidArgumentException('Subject must not be longer than 255 characters');
54 }
55
56 $this->from = $from;
57 $this->recipients = $recipients;
58 $this->recipientsCC = $recipientsCC;
59 $this->recipientsBCC = $recipientsBCC;
60 $this->subject = $subject;
61 $this->body = $body;
62 $this->attachments = array_filter(array_map('trim', $attachments));
63 $this->usePlaceholders = $usePlaceholders;
64 $this->saveInSentBox = $saveInSentBox;
65 }
66
67 public function getRecipients(): string
68 {
69 return $this->recipients;
70 }
71
72 public function getRecipientsCC(): string
73 {
75 }
76
77 public function getRecipientsBCC(): string
78 {
80 }
81
82 public function getSubject(): string
83 {
84 return $this->subject;
85 }
86
87 public function getBody(): string
88 {
89 return $this->body;
90 }
91
95 public function getAttachments(): array
96 {
97 return $this->attachments;
98 }
99
100 public function isUsingPlaceholders(): bool
101 {
103 }
104
105 public function shouldSaveInSentBox(): bool
106 {
108 }
109
110 public function getFrom(): string
111 {
112 return $this->from;
113 }
114}
__construct(string $from, string $recipients, string $recipientsCC, string $recipientsBCC, string $subject, string $body, array $attachments, bool $usePlaceholders=false, bool $saveInSentBox=false)
static strLen(string $a_string)
Definition: class.ilStr.php:63