public async Task SendFeedsAsync(string email, IEnumerable <RssFeedEmailModel> feeds) { // var configuration = var file = @$ "{Directory.GetCurrentDirectory()}\EmailTemplates\Index.cshtml"; fluentEmail.Subject("Zestaw newsów"); fluentEmail.To(email); fluentEmail.UsingTemplateFromFile(file, feeds, true); await fluentEmail.SendAsync(); //.From("*****@*****.**") //.To(email) //.Subject("Zestaw newsów"); //.UsingTemplateFromFile($"{Directory.GetCurrentDirectory()}/EmailTemplates/Index.cshtml", feeds, true); // await configuration.SendAsync(); }
public static IFluentEmail UsingTemplateFile <T>(this IFluentEmail email, string filename, T model, bool isHtml = true) { return(email.UsingTemplateFromFile($"{Environment.CurrentDirectory}/Views/{filename}", model, isHtml)); }