Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/RenderedEmailTemplateMail.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public static function fromRenderedContent(string $subject, string $html, string
->text($text);
}

// public function build(): self
// {
// return $this;
// }
public function build(): self
{
return $this;
}
}
37 changes: 37 additions & 0 deletions src/RenderedEmailTemplateMailTest.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

declare(strict_types=1);

namespace Craftzing\Laravel\NotificationChannels\Postmark;

use PHPUnit\Framework\TestCase;

final class RenderedEmailTemplateMailTest extends TestCase
{
/** @test */
public function itCanCreateRenderdEmailTemplate(): void
{
$subject = 'Some Content Here';
$htmlBody = 'Some HTML Content Here';
$textBody = 'Some Text Content Here';

$mail = RenderedEmailTemplateMail::fromRenderedContent($subject, $htmlBody, $textBody);

$this->assertSame($subject, $mail->subject);
$this->assertSame($textBody, $mail->textView);
}

/** @test */
public function itCanBuildRenderdEmailTemplate(): void
{
$subject = 'Some Content Here';
$htmlBody = 'Some HTML Content Here';
$textBody = 'Some Text Content Here';
$mail = RenderedEmailTemplateMail::fromRenderedContent($subject, $htmlBody, $textBody);

$build = $mail->build();

$this->assertSame($subject, $build->subject);
$this->assertSame($textBody, $build->textView);
}
}