1 | <?php |
||
18 | class EmailLog extends AbstractModel |
||
|
|||
19 | { |
||
20 | use EmailAwareTrait; |
||
21 | |||
22 | /** |
||
23 | * The Queue ID |
||
24 | * |
||
25 | * @var string $queueId |
||
26 | */ |
||
27 | private $queueId; |
||
28 | |||
29 | /** |
||
30 | * The error code |
||
31 | * |
||
32 | * @var string $errorCode |
||
33 | */ |
||
34 | private $errorCode; |
||
35 | |||
36 | /** |
||
37 | * The Message-ID (Unique message identifier) |
||
38 | * |
||
39 | * @var string $messageId |
||
40 | */ |
||
41 | private $messageId; |
||
42 | |||
43 | /** |
||
44 | * The campaign ID. |
||
45 | * |
||
46 | * @var string $campaign |
||
47 | */ |
||
48 | private $campaign; |
||
49 | |||
50 | /** |
||
51 | * The sender's email address. |
||
52 | * |
||
53 | * @var string $from |
||
54 | */ |
||
55 | private $from; |
||
56 | |||
57 | /** |
||
58 | * The recipient's email address. |
||
59 | * |
||
60 | * @var string $to |
||
61 | */ |
||
62 | private $to; |
||
63 | |||
64 | /** |
||
65 | * The email subject. |
||
66 | * |
||
67 | * @var string $subject |
||
68 | */ |
||
69 | private $subject; |
||
70 | |||
71 | /** |
||
72 | * When the email should be sent. |
||
73 | * |
||
74 | * @var DateTimeInterface|null $sendTs |
||
75 | */ |
||
76 | private $sendTs; |
||
77 | |||
78 | /** |
||
79 | * Get the primary key that uniquely identifies each queue item. |
||
80 | * |
||
81 | * @return string |
||
82 | */ |
||
83 | public function key() |
||
87 | |||
88 | /** |
||
89 | * Set the queue ID. |
||
90 | * |
||
91 | * @param string $queueId The queue ID. |
||
92 | * @return self |
||
93 | */ |
||
94 | public function setQueueId($queueId) |
||
100 | |||
101 | /** |
||
102 | * Get the queue ID. |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function queueId() |
||
110 | |||
111 | /** |
||
112 | * Set the error code. |
||
113 | * |
||
114 | * @param string $errorCode The error code. |
||
115 | * @return self |
||
116 | */ |
||
117 | public function setErrorCode($errorCode) |
||
123 | |||
124 | /** |
||
125 | * Get the error code. |
||
126 | * |
||
127 | * @return string |
||
128 | */ |
||
129 | public function errorCode() |
||
133 | |||
134 | /** |
||
135 | * Set the Message-ID. |
||
136 | * |
||
137 | * @param string $messageId The Message-ID. |
||
138 | * @throws InvalidArgumentException If the Message-ID is not a string. |
||
139 | * @return self |
||
140 | */ |
||
141 | public function setMessageId($messageId) |
||
153 | |||
154 | /** |
||
155 | * Get the Message-ID. |
||
156 | * |
||
157 | * @return string |
||
158 | */ |
||
159 | public function messageId() |
||
163 | |||
164 | /** |
||
165 | * Set the campaign ID. |
||
166 | * |
||
167 | * @param string $campaign The campaign identifier. |
||
168 | * @throws InvalidArgumentException If the campaign is invalid. |
||
169 | * @return self |
||
170 | */ |
||
171 | public function setCampaign($campaign) |
||
183 | |||
184 | /** |
||
185 | * Get the campaign identifier. |
||
186 | * |
||
187 | * @return string |
||
188 | */ |
||
189 | public function campaign() |
||
193 | |||
194 | /** |
||
195 | * Set the sender's email address. |
||
196 | * |
||
197 | * @param string|array $email An email address. |
||
198 | * @throws InvalidArgumentException If the email address is invalid. |
||
199 | * @return self |
||
200 | */ |
||
201 | public function setFrom($email) |
||
206 | |||
207 | /** |
||
208 | * Get the sender's email address. |
||
209 | * |
||
210 | * @return string |
||
211 | */ |
||
212 | public function from() |
||
216 | |||
217 | /** |
||
218 | * Set the recipient's email address. |
||
219 | * |
||
220 | * @param string|array $email An email address. |
||
221 | * @return self |
||
222 | */ |
||
223 | public function setTo($email) |
||
228 | |||
229 | /** |
||
230 | * Get the recipient's email address. |
||
231 | * |
||
232 | * @return string |
||
233 | */ |
||
234 | public function to() |
||
238 | |||
239 | /** |
||
240 | * Set the email subject. |
||
241 | * |
||
242 | * @param string $subject The email subject. |
||
243 | * @throws InvalidArgumentException If the subject is not a string. |
||
244 | * @return self |
||
245 | */ |
||
246 | public function setSubject($subject) |
||
258 | |||
259 | /** |
||
260 | * Get the email subject. |
||
261 | * |
||
262 | * @return string |
||
263 | */ |
||
264 | public function subject() |
||
268 | |||
269 | /** |
||
270 | * @param null|string|DateTime $ts The "send date" datetime value. |
||
271 | * @throws InvalidArgumentException If the ts is not a valid datetime value. |
||
272 | * @return self |
||
273 | */ |
||
274 | public function setSendTs($ts) |
||
298 | |||
299 | /** |
||
300 | * @return null|DateTimeInterface |
||
301 | */ |
||
302 | public function sendTs() |
||
306 | |||
307 | /** |
||
308 | * @see StorableTrait::preSave() |
||
309 | * @return boolean |
||
310 | */ |
||
311 | protected function preSave() : bool |
||
321 | } |
||
322 |