yavsc/cli/Services/EMailer.cs

35 lines
1 KiB
C#
Raw Normal View History

2018-04-16 17:53:41 +02:00
using System;
using Microsoft.AspNet.Razor;
using Microsoft.Extensions.Localization;
using Microsoft.Extensions.Logging;
2018-04-21 19:30:04 +02:00
using Yavsc.Models;
2018-04-16 17:53:41 +02:00
namespace cli.Services
{
public class EMailer
{
RazorTemplateEngine razorEngine;
IStringLocalizer<EMailer> stringLocalizer;
ILogger logger;
2018-04-21 19:30:04 +02:00
ApplicationDbContext dbContext;
public EMailer(ApplicationDbContext context, RazorTemplateEngine razorTemplateEngine, IStringLocalizer<EMailer> localizer, ILoggerFactory loggerFactory)
2018-04-16 17:53:41 +02:00
{
logger = loggerFactory.CreateLogger<EMailer>();
razorEngine = razorTemplateEngine;
stringLocalizer = localizer;
2018-04-21 19:30:04 +02:00
dbContext = context;
2018-04-16 17:53:41 +02:00
}
public string Gen(long templateCode)
{
string subtemp = stringLocalizer["MonthlySubjectTemplate"].Value;
logger.LogInformation ( $"Using code: {templateCode} and subject: {subtemp} " );
throw new NotImplementedException("razorEngine.GenerateCode");
}
}
}