forked from mautic/mautic
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request mautic#12495 from shinde-rahul/import-custom-email…
…-template Fixing Import custom email template functionality
- Loading branch information
Showing
2 changed files
with
33 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,4 +224,35 @@ public function testEmailDetailsPageShouldNotHavePendingCount(): void | |
|
||
$this->assertCount(0, $pendingCountQuery); | ||
} | ||
|
||
public function testSendEmailForImportCustomEmailTemplate(): void | ||
{ | ||
$email = new Email(); | ||
$email->setName('Test Email C'); | ||
$email->setSubject('Test Email C Subject'); | ||
$email->setTemplate('blank'); | ||
$email->setEmailType('template'); | ||
|
||
$contact = new Lead(); | ||
$contact->setEmail('[email protected]'); | ||
|
||
$this->em->persist($email); | ||
$this->em->persist($contact); | ||
$this->em->flush(); | ||
|
||
// Create the member now. | ||
$payload = [ | ||
'action' => 'lead:getEmailTemplate', | ||
'template' => $email->getId(), | ||
]; | ||
|
||
$this->client->request('GET', '/s/ajax', $payload, [], $this->createAjaxHeaders()); | ||
$clientResponse = $this->client->getResponse(); | ||
$response = json_decode($clientResponse->getContent(), true); | ||
|
||
$this->assertSame(1, $response['success']); | ||
$this->assertNotEmpty($response['subject']); | ||
$this->assertEquals($email->getSubject(), $response['subject']); | ||
$this->assertNotEmpty($response['body']); | ||
} | ||
} |