Skip to content

Can't access to html body of the email #58

@clemcoder

Description

@clemcoder

Hello,

I try to test the html content of an email (I want to check a particular link inside).
Here is the code :

        $asyncMessengerTransport = $this->messenger('async');
        $asyncMessengerQueue = $asyncMessengerTransport->queue();
        
        $asyncMessengerQueue->assertCount(1);

        $firstMessage = $asyncMessengerQueue->first()->getMessage();
        $email = $firstMessage->getMessage();
        $htmlBody = $email->getHtmlBody();

Unfortunately getHtmlBody always returns null.
Is there a probleme in this code ?
Is it possible to test the content of the email ?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions