1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* Copyright (C) 2018 |
5
|
|
|
* Nathan Boiron <[email protected]> |
6
|
|
|
* Romain Canon <[email protected]> |
7
|
|
|
* |
8
|
|
|
* This file is part of the TYPO3 NotiZ project. |
9
|
|
|
* It is free software; you can redistribute it and/or modify it |
10
|
|
|
* under the terms of the GNU General Public License, either |
11
|
|
|
* version 3 of the License, or any later version. |
12
|
|
|
* |
13
|
|
|
* For the full copyright and license information, see: |
14
|
|
|
* http://www.gnu.org/licenses/gpl-3.0.html |
15
|
|
|
*/ |
16
|
|
|
|
17
|
|
|
namespace CuyZ\Notiz\Domain\Notification\Email\Application\EntityEmail; |
18
|
|
|
|
19
|
|
|
use CuyZ\Notiz\Core\Notification\CustomSettingsNotification; |
20
|
|
|
use CuyZ\Notiz\Domain\Notification\Email\Application\EntityEmail\Processor\EntityEmailNotificationProcessor; |
21
|
|
|
use CuyZ\Notiz\Domain\Notification\Email\Application\EntityEmail\Settings\EntityEmailSettings; |
22
|
|
|
use CuyZ\Notiz\Domain\Notification\Email\EmailNotification; |
23
|
|
|
use CuyZ\Notiz\Domain\Notification\EntityNotification; |
24
|
|
|
use TYPO3\CMS\Core\Utility\GeneralUtility; |
25
|
|
|
use TYPO3\CMS\Extbase\Service\FlexFormService; |
26
|
|
|
|
27
|
|
|
class EntityEmailNotification extends EntityNotification implements EmailNotification, CustomSettingsNotification |
28
|
|
|
{ |
29
|
|
|
/** |
30
|
|
|
* @var string |
31
|
|
|
*/ |
32
|
|
|
protected $layout; |
33
|
|
|
|
34
|
|
|
/** |
35
|
|
|
* @var string |
36
|
|
|
*/ |
37
|
|
|
protected $sender; |
38
|
|
|
|
39
|
|
|
/** |
40
|
|
|
* @var bool |
41
|
|
|
*/ |
42
|
|
|
protected $senderCustom; |
43
|
|
|
|
44
|
|
|
/** |
45
|
|
|
* @var string |
46
|
|
|
*/ |
47
|
|
|
protected $sendTo; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* @var string |
51
|
|
|
*/ |
52
|
|
|
protected $sendToProvided; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* @var string |
56
|
|
|
*/ |
57
|
|
|
protected $sendCc; |
58
|
|
|
|
59
|
|
|
/** |
60
|
|
|
* @var string |
61
|
|
|
*/ |
62
|
|
|
protected $sendCcProvided; |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @var string |
66
|
|
|
*/ |
67
|
|
|
protected $sendBcc; |
68
|
|
|
|
69
|
|
|
/** |
70
|
|
|
* @var string |
71
|
|
|
*/ |
72
|
|
|
protected $sendBccProvided; |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* @var string |
76
|
|
|
*/ |
77
|
|
|
protected $subject; |
78
|
|
|
|
79
|
|
|
/** |
80
|
|
|
* @var string |
81
|
|
|
*/ |
82
|
|
|
protected $body; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @var array |
86
|
|
|
*/ |
87
|
|
|
protected $bodySlots = []; |
88
|
|
|
|
89
|
|
|
/** |
90
|
|
|
* @return string |
91
|
|
|
*/ |
92
|
|
|
public function getLayout() |
93
|
|
|
{ |
94
|
|
|
return $this->layout; |
95
|
|
|
} |
96
|
|
|
|
97
|
|
|
/** |
98
|
|
|
* @param string $layout |
99
|
|
|
*/ |
100
|
|
|
public function setLayout($layout) |
101
|
|
|
{ |
102
|
|
|
$this->layout = $layout; |
103
|
|
|
} |
104
|
|
|
|
105
|
|
|
/** |
106
|
|
|
* @return string |
107
|
|
|
*/ |
108
|
|
|
public function getSender() |
109
|
|
|
{ |
110
|
|
|
return $this->sender; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @param string $sender |
115
|
|
|
*/ |
116
|
|
|
public function setSender($sender) |
117
|
|
|
{ |
118
|
|
|
$this->sender = $sender; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* @return bool |
123
|
|
|
*/ |
124
|
|
|
public function isSenderCustom() |
125
|
|
|
{ |
126
|
|
|
return $this->senderCustom; |
127
|
|
|
} |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @param bool $senderCustom |
131
|
|
|
*/ |
132
|
|
|
public function setSenderCustom($senderCustom) |
133
|
|
|
{ |
134
|
|
|
$this->senderCustom = $senderCustom; |
135
|
|
|
} |
136
|
|
|
|
137
|
|
|
/** |
138
|
|
|
* @return string |
139
|
|
|
*/ |
140
|
|
|
public function getSendTo() |
141
|
|
|
{ |
142
|
|
|
return $this->sendTo; |
143
|
|
|
} |
144
|
|
|
|
145
|
|
|
/** |
146
|
|
|
* @param string $sendTo |
147
|
|
|
*/ |
148
|
|
|
public function setSendTo($sendTo) |
149
|
|
|
{ |
150
|
|
|
$this->sendTo = $sendTo; |
151
|
|
|
} |
152
|
|
|
|
153
|
|
|
/** |
154
|
|
|
* @return string |
155
|
|
|
*/ |
156
|
|
|
public function getSendToProvided() |
157
|
|
|
{ |
158
|
|
|
return $this->sendToProvided; |
159
|
|
|
} |
160
|
|
|
|
161
|
|
|
/** |
162
|
|
|
* @param string $sendToProvided |
163
|
|
|
*/ |
164
|
|
|
public function setSendToProvided($sendToProvided) |
165
|
|
|
{ |
166
|
|
|
$this->sendToProvided = $sendToProvided; |
167
|
|
|
} |
168
|
|
|
|
169
|
|
|
/** |
170
|
|
|
* @return string |
171
|
|
|
*/ |
172
|
|
|
public function getSendCc() |
173
|
|
|
{ |
174
|
|
|
return $this->sendCc; |
175
|
|
|
} |
176
|
|
|
|
177
|
|
|
/** |
178
|
|
|
* @param string $sendCc |
179
|
|
|
*/ |
180
|
|
|
public function setSendCc($sendCc) |
181
|
|
|
{ |
182
|
|
|
$this->sendCc = $sendCc; |
183
|
|
|
} |
184
|
|
|
|
185
|
|
|
/** |
186
|
|
|
* @return string |
187
|
|
|
*/ |
188
|
|
|
public function getSendCcProvided() |
189
|
|
|
{ |
190
|
|
|
return $this->sendCcProvided; |
191
|
|
|
} |
192
|
|
|
|
193
|
|
|
/** |
194
|
|
|
* @param string $sendCcProvided |
195
|
|
|
*/ |
196
|
|
|
public function setSendCcProvided($sendCcProvided) |
197
|
|
|
{ |
198
|
|
|
$this->sendCcProvided = $sendCcProvided; |
199
|
|
|
} |
200
|
|
|
|
201
|
|
|
/** |
202
|
|
|
* @return string |
203
|
|
|
*/ |
204
|
|
|
public function getSendBcc() |
205
|
|
|
{ |
206
|
|
|
return $this->sendBcc; |
207
|
|
|
} |
208
|
|
|
|
209
|
|
|
/** |
210
|
|
|
* @param string $sendBcc |
211
|
|
|
*/ |
212
|
|
|
public function setSendBcc($sendBcc) |
213
|
|
|
{ |
214
|
|
|
$this->sendBcc = $sendBcc; |
215
|
|
|
} |
216
|
|
|
|
217
|
|
|
/** |
218
|
|
|
* @return string |
219
|
|
|
*/ |
220
|
|
|
public function getSendBccProvided() |
221
|
|
|
{ |
222
|
|
|
return $this->sendBccProvided; |
223
|
|
|
} |
224
|
|
|
|
225
|
|
|
/** |
226
|
|
|
* @param string $sendBccProvided |
227
|
|
|
*/ |
228
|
|
|
public function setSendBccProvided($sendBccProvided) |
229
|
|
|
{ |
230
|
|
|
$this->sendBccProvided = $sendBccProvided; |
231
|
|
|
} |
232
|
|
|
|
233
|
|
|
/** |
234
|
|
|
* @return string |
235
|
|
|
*/ |
236
|
|
|
public function getSubject() |
237
|
|
|
{ |
238
|
|
|
return $this->subject; |
239
|
|
|
} |
240
|
|
|
|
241
|
|
|
/** |
242
|
|
|
* @param string $subject |
243
|
|
|
*/ |
244
|
|
|
public function setSubject($subject) |
245
|
|
|
{ |
246
|
|
|
$this->subject = $subject; |
247
|
|
|
} |
248
|
|
|
|
249
|
|
|
/** |
250
|
|
|
* @return string |
251
|
|
|
*/ |
252
|
|
|
public function getBody() |
253
|
|
|
{ |
254
|
|
|
return $this->body; |
255
|
|
|
} |
256
|
|
|
|
257
|
|
|
/** |
258
|
|
|
* @return array |
259
|
|
|
*/ |
260
|
|
|
public function getBodySlots() |
261
|
|
|
{ |
262
|
|
|
if (empty($this->bodySlots)) { |
263
|
|
|
/** @var FlexFormService $flexFormService */ |
264
|
|
|
$flexFormService = GeneralUtility::makeInstance(FlexFormService::class); |
265
|
|
|
|
266
|
|
|
$this->bodySlots = $flexFormService->convertFlexFormContentToArray($this->body); |
267
|
|
|
} |
268
|
|
|
|
269
|
|
|
return $this->bodySlots; |
270
|
|
|
} |
271
|
|
|
|
272
|
|
|
/** |
273
|
|
|
* @param string $body |
274
|
|
|
*/ |
275
|
|
|
public function setBody($body) |
276
|
|
|
{ |
277
|
|
|
$this->body = $body; |
278
|
|
|
} |
279
|
|
|
|
280
|
|
|
/** |
281
|
|
|
* @return string |
282
|
|
|
*/ |
283
|
|
|
public static function getProcessorClassName() |
284
|
|
|
{ |
285
|
|
|
return EntityEmailNotificationProcessor::class; |
286
|
|
|
} |
287
|
|
|
|
288
|
|
|
/** |
289
|
|
|
* @return string |
290
|
|
|
*/ |
291
|
|
|
public static function getDefinitionIdentifier() |
292
|
|
|
{ |
293
|
|
|
return 'entityEmail'; |
294
|
|
|
} |
295
|
|
|
|
296
|
|
|
/** |
297
|
|
|
* @return string |
298
|
|
|
*/ |
299
|
|
|
public static function getSettingsClassName() |
300
|
|
|
{ |
301
|
|
|
return EntityEmailSettings::class; |
302
|
|
|
} |
303
|
|
|
} |
304
|
|
|
|