lukencode / FluentEmail

All in one email sender for .NET. Supports popular senders (SendGrid, MailGun, etc) and Razor templates.

Home Page:https://lukelowrey.com/dotnet-email-guide-2021/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to create email from template

OwenPattison opened this issue · comments

Hello, I've been using the v3.0.0 of FluentEmail.Core along with FluentEmail.Liquid with no problems for the past year or so, however, I have upgraded NSwag to the latest version and now we are unable to create emails due to the following error being thrown:

Error. System.TypeLoadException: Could not load type 'Fluid.BaseFluidTemplate`1' from assembly 'Fluid, Version=0.0.0.0, Culture=neutral, PublicKeyToken=omit'. at FluentEmail.Liquid.LiquidRenderer.ParseAsync[T](String template, T model, Boolean isHtml) at System.Runtime.CompilerServices.AsyncMethodBuilderCore.Start[TStateMachine](TStateMachine& stateMachine) at FluentEmail.Liquid.LiquidRenderer.ParseAsync[T](String template, T model, Boolean isHtml) at FluentEmail.Liquid.LiquidRenderer.Parse[T](String template, T model, Boolean isHtml) at FluentEmail.Core.Email.UsingTemplateFromFile[T](String filename, T model, Boolean isHtml)

Looking through release notes for NSwag 13.15.0 it seems they have migrated to use Fluid, I suspect there could be a mismatch of dependencies now between libs. I've been unable to diagnose the issue any further thus far but any help would be appreciated.

Bumped into same problem. In my case I was using Fluid.Core 2.9 package in another part of my application. This caused issues with Liquid Renderer. I assume that there was a breaking change in Fluid.Core and their recent versions are not compatible with the one used by FluentEmail.