Skip to content

Body Not Accessible #27

@Gabby-Paolucci

Description

@Gabby-Paolucci

The body of the email is always null, as accessible by MailAttributes.TextBody, MailAttributes.HtmlBody, and MailAttributes.Body. The only way I'm able to access the body is by using a method I found in \src\ActionMailerNext.Tests\Standalone\RazorMailerBaseTests.cs:

var body = new StreamReader(email.MailAttributes.AlternateViews[0].ContentStream).ReadToEnd().Trim();

This method only works before delivering the email; if it's used after delivering the email, it returns an empty string. Also, using this method before delivering the email clears out the contents of the email. Thus, I'm forced to generate the email twice, once to send, and second time to get the body.

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