Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Capturing the rendered email body #340

Open
jovball opened this issue Aug 30, 2022 · 1 comment
Open

Capturing the rendered email body #340

jovball opened this issue Aug 30, 2022 · 1 comment

Comments

@jovball
Copy link

jovball commented Aug 30, 2022

I have a business case for capturing the rendered email body. Is that possible with FluentEmail? I am using Razor templates if that makes any difference.

@DavidDeSloovere
Copy link

You can create a decorator for the mail sender and check the content there.

/// <summary>
/// Decorator for <c>FluentEmail.Core.Interfaces.ISender</c>.
/// </summary>
public class CustomMailSender : ISender
{
    ...
}

I use Autofac to register the decorator.
builder.RegisterDecorator<CustomMailSender, ISender>();

This is independent of the type of mail sender you are actually using (smtp, sendgrid...).

For more info, I would suggest stackoverflow or discussions here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants