Skip to content

Commit c01c981

Browse files
committed
[Mailer][Infobip] Add trackClicks, trackOpens and trackingUrl as supported payload properties
1 parent 897d34d commit c01c981

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.2
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

Lines changed: 36 additions & 2 deletions
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,30 @@ 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="track"
291+
292+
false
293+
--%s
294+
Content-Type: text/plain; charset=utf-8
295+
Content-Transfer-Encoding: 8bit
296+
Content-Disposition: form-data; name="trackingUrl"
297+
298+
https://bar.foo
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
305+
--%s
306+
Content-Type: text/plain; charset=utf-8
307+
Content-Transfer-Encoding: 8bit
308+
Content-Disposition: form-data; name="trackOpens"
309+
310+
true
283311
--%s--
284312
TXT,
285313
$options['body']
@@ -410,7 +438,10 @@ public function testSendEmailWithHeadersWithSuccess()
410438
->addTextHeader('X-Infobip-NotifyUrl', 'https://foo.bar')
411439
->addTextHeader('X-Infobip-NotifyContentType', 'application/json')
412440
->addTextHeader('X-Infobip-MessageId', 'RANDOM-CUSTOM-ID')
413-
->addTextHeader('X-Infobip-Track', 'false');
441+
->addTextHeader('X-Infobip-Track', 'false')
442+
->addTextHeader('X-Infobip-TrackingUrl', 'https://bar.foo')
443+
->addTextHeader('X-Infobip-TrackClicks', 'true')
444+
->addTextHeader('X-Infobip-TrackOpens', 'true');
414445

415446
$sentMessage = $this->transport->send($email);
416447

@@ -423,6 +454,9 @@ public function testSendEmailWithHeadersWithSuccess()
423454
X-Infobip-NotifyContentType: application/json
424455
X-Infobip-MessageId: RANDOM-CUSTOM-ID
425456
X-Infobip-Track: false
457+
X-Infobip-TrackingUrl: https://bar.foo
458+
X-Infobip-TrackClicks: true
459+
X-Infobip-TrackOpens: true
426460
%a
427461
TXT,
428462
$sentMessage->toString()

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

Lines changed: 3 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy