Skip to content

Commit abcdb9c

Browse files
committed
Fix send campaign (status transition)
1 parent 0f45203 commit abcdb9c

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed

src/Messaging/Controller/CampaignController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use OpenApi\Attributes as OA;
88
use PhpList\Core\Domain\Messaging\Model\Message;
9-
use PhpList\Core\Domain\Messaging\Service\CampaignProcessor;
9+
use PhpList\Core\Domain\Messaging\Service\Processor\CampaignProcessor;
1010
use PhpList\Core\Security\Authentication;
1111
use PhpList\RestBundle\Common\Controller\BaseController;
1212
use PhpList\RestBundle\Common\Validator\RequestValidator;

tests/Integration/Messaging/Controller/CampaignControllerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ public function testSendMessageWithValidSessionReturnsOkay(): void
9898
{
9999
$this->loadFixtures([AdministratorFixture::class, MessageFixture::class]);
100100

101-
$this->authenticatedJsonRequest('POST', '/api/v2/campaigns/1/send');
101+
$this->authenticatedJsonRequest('POST', '/api/v2/campaigns/2/send');
102102
$this->assertHttpOkay();
103103

104104
$response = $this->getDecodedJsonResponseContent();
105-
self::assertSame(1, $response['id']);
105+
self::assertSame(2, $response['id']);
106106
}
107107

108108
public function testSendMessageWithInvalidIdReturnsNotFound(): void

tests/Integration/Messaging/Fixtures/Message.csv

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,23 @@ id,uuid,subject,fromfield,tofield,replyto,message,textmessage,footer,entered,mod
1919
</div>
2020

2121
",2024-11-10 16:57:46,2024-11-14 08:32:15,2024-11-14 08:32:00,0,2024-11-14 08:32:00,0,2024-11-14 08:32:00,sent,,2024-11-14 08:32:15,1,invite,0,0,0,0,0,0,0,0,0,2024-11-14 08:32:15,,1
22+
2,2df6b147-8470-45ed-8e4e-86aa01af400f,Do you want to continue receiving our messages?, My Name <[email protected]>,"","","<p>Hi [FIRST NAME%%there], remember us? You first signed up for our email newsletter on&nbsp;[ENTERED] &ndash; please click here to confirm you&#39;re happy to continue receiving our messages:</p>
23+
24+
<p><strong><a href=""[CONFIRMATIONURL]"" title=""Confirm subscription"">Continue receiving messages</a></strong>&nbsp; <u>(If you do not confirm using this link, then you won&#39;t hear from us again</u>)</p>
25+
26+
<p>While you&#39;re at it, you can also update your preferences, including your email address or other details, by clicking here:</p>
27+
28+
<p><strong><a href=""[PREFERENCESURL]"">Update preferences</a></strong></p>
29+
30+
<p>By confirming your membership and keeping your details up to date, you&#39;re helping us to manage and protect your data in accordance with best practices.</p>
31+
32+
<p>Thank you!</p>","","--
33+
34+
<div class=""footer"" style=""text-align:left; font-size: 75%;"">
35+
<p>This message was sent to [EMAIL] by [FROMEMAIL].</p>
36+
<p>To forward this message, please do not use the forward button of your email application, because this message was made specifically for you only. Instead use the <a href=""[FORWARDURL]"">forward page</a> in our newsletter system.<br/>
37+
To change your details and to choose which lists to be subscribed to, visit your personal <a href=""[PREFERENCESURL]"">preferences page</a>.<br/>
38+
Or you can <a href=""[UNSUBSCRIBEURL]"">opt-out completely</a> from all future mailings.</p>
39+
</div>
40+
41+
",2024-11-10 16:57:46,2024-11-14 08:32:15,2024-11-14 08:32:00,0,2024-11-14 08:32:00,0,2024-11-14 08:32:00,submitted,,2024-11-14 08:32:15,1,invite,0,0,0,0,0,0,0,0,0,2024-11-14 08:32:15,,1

0 commit comments

Comments
 (0)