feat(portal): lead module, WHMCS sync report/contacts/mapping, service lifecycle email templates

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
baodev0
2026-10-21 16:55:19 +07:00
co-authored by Claude Sonnet 5.5
parent 3c7710f1de
commit a443ec3bf6
66 changed files with 2032 additions and 124 deletions
@@ -86,4 +86,22 @@ class MarketingEmailOptOutTest extends TestCase
Queue::assertNotPushed(SendMailCampaignRecipient::class);
}
public function test_campaign_with_template_uses_edited_message_when_given(): void
{
Queue::fake();
$admin = $this->admin();
$customer = Customer::factory()->create(['email_marketing' => 1]);
$this->actingAs($admin, 'admin')
->postJson('/api/v1/administrator/mail-campaigns', [
'template_id' => $this->template(null)->id,
'message' => '<p>Nội dung đã sửa</p>',
'recipient_type' => 'selected',
'uuids' => [$customer->uuid],
])
->assertOk();
$this->assertSame('<p>Nội dung đã sửa</p>', \App\Models\MailCampaign::latest('id')->first()->message);
}
}