Skip to content

Commit bf5e3ef

Browse files
committed
[Mailer][Infobip] Add trackClicks, trackOpens and trackingUrl as supported payload properties
1 parent 7abc106 commit bf5e3ef

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

src/Symfony/Component/Mailer/Bridge/Infobip/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.1
5+
---
6+
7+
* Add support of trackClicks, trackOpens and trackingUrl payload properties
8+
49
6.3
510
---
611

src/Symfony/Component/Mailer/Bridge/Infobip/Tests/Transport/InfobipApiTransportTest.php

+30-2
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,11 @@ public function testSendEmailWithHeadersShouldCalledInfobipWithTheRightParameter
248248
->addTextHeader('X-Infobip-IntermediateReport', 'true')
249249
->addTextHeader('X-Infobip-NotifyUrl', 'https://foo.bar')
250250
->addTextHeader('X-Infobip-NotifyContentType', 'application/json')
251-
->addTextHeader('X-Infobip-MessageId', 'RANDOM-CUSTOM-ID');
251+
->addTextHeader('X-Infobip-MessageId', 'RANDOM-CUSTOM-ID')
252+
->addTextHeader('X-Infobip-Track', 'false')
253+
->addTextHeader('X-Infobip-TrackingUrl', 'https://bar.foo')
254+
->addTextHeader('X-Infobip-TrackClicks', 'true')
255+
->addTextHeader('X-Infobip-TrackOpens', 'true');
252256

253257
$this->transport->send($email);
254258

@@ -280,6 +284,24 @@ public function testSendEmailWithHeadersShouldCalledInfobipWithTheRightParameter
280284
Content-Disposition: form-data; name="messageId"
281285
282286
RANDOM-CUSTOM-ID
287+
--%s
288+
Content-Type: text/plain; charset=utf-8
289+
Content-Transfer-Encoding: 8bit
290+
Content-Disposition: form-data; name="trackingUrl"
291+
292+
https://bar.foo
293+
--%s
294+
Content-Type: text/plain; charset=utf-8
295+
Content-Transfer-Encoding: 8bit
296+
Content-Disposition: form-data; name="trackClicks"
297+
298+
true
299+
--%s
300+
Content-Type: text/plain; charset=utf-8
301+
Content-Transfer-Encoding: 8bit
302+
Content-Disposition: form-data; name="trackClicks"
303+
304+
true
283305
--%s--
284306
TXT,
285307
$options['body']
@@ -410,7 +432,10 @@ public function testSendEmailWithHeadersWithSuccess()
410432
->addTextHeader('X-Infobip-NotifyUrl', 'https://foo.bar')
411433
->addTextHeader('X-Infobip-NotifyContentType', 'application/json')
412434
->addTextHeader('X-Infobip-MessageId', 'RANDOM-CUSTOM-ID')
413-
->addTextHeader('X-Infobip-Track', 'false');
435+
->addTextHeader('X-Infobip-Track', 'false')
436+
->addTextHeader('X-Infobip-TrackingUrl', 'https://bar.foo')
437+
->addTextHeader('X-Infobip-TrackClicks', 'true')
438+
->addTextHeader('X-Infobip-TrackOpens', 'true');
414439

415440
$sentMessage = $this->transport->send($email);
416441

@@ -423,6 +448,9 @@ public function testSendEmailWithHeadersWithSuccess()
423448
X-Infobip-NotifyContentType: application/json
424449
X-Infobip-MessageId: RANDOM-CUSTOM-ID
425450
X-Infobip-Track: false
451+
X-Infobip-TrackingUrl: https://bar.foo
452+
X-Infobip-TrackClicks: true
453+
X-Infobip-TrackOpens: true
426454
%a
427455
TXT,
428456
$sentMessage->toString()

src/Symfony/Component/Mailer/Bridge/Infobip/Transport/InfobipApiTransport.php

+3
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ final class InfobipApiTransport extends AbstractApiTransport
3939
'X-Infobip-NotifyContentType' => 'notifyContentType',
4040
'X-Infobip-MessageId' => 'messageId',
4141
'X-Infobip-Track' => 'track',
42+
'X-Infobip-TrackingUrl' => 'trackingUrl',
43+
'X-Infobip-TrackClicks' => 'trackClicks',
44+
'X-Infobip-TrackOpens' => 'trackOpens',
4245
];
4346

4447
public function __construct(

0 commit comments

Comments
 (0)