Skip to content

Capturing the rendered email body #340

Open

Description

@jovball

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.

Activity

  1. DavidDeSloovere commented on Sep 9, 2022

    @DavidDeSloovere

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions