-
Notifications
You must be signed in to change notification settings - Fork 24
Body Not Accessible #27
Copy link
Copy link
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels