forked from ddrilling/AsbCloudServer
33 lines
1.0 KiB
C#
33 lines
1.0 KiB
C#
|
using AsbCloudApp.Data;
|
|||
|
using AsbCloudInfrastructure.Services.Email;
|
|||
|
using Microsoft.Extensions.Configuration;
|
|||
|
using System;
|
|||
|
using System.IO;
|
|||
|
|
|||
|
namespace AsbCloudInfrastructure
|
|||
|
{
|
|||
|
class WellFinalDocumentMailBodyFactory : BaseFactory
|
|||
|
{
|
|||
|
private readonly string platformName;
|
|||
|
|
|||
|
public WellFinalDocumentMailBodyFactory(IConfiguration configuration)
|
|||
|
: base(configuration)
|
|||
|
{
|
|||
|
platformName = configuration.GetValue("email:platformName", "Цифровое бурение");
|
|||
|
}
|
|||
|
|
|||
|
public override string MakeSubject(WellDto well, string action)
|
|||
|
=> $"{well.Deposit}, {well.Cluster}, {well.Caption}. Дело скважины. {action}";
|
|||
|
|
|||
|
public string MakeMailBodyForWellFinalDocument(WellDto well, string publisherName, string message)
|
|||
|
{
|
|||
|
var body = $"<html><body><h2>Здравствуйте, {publisherName}.</h2>" +
|
|||
|
$"На портале {platformName} {message}," +
|
|||
|
$" куст {well.Cluster}, месторождение {well.Deposit}." +
|
|||
|
MakeSignatue() +
|
|||
|
$"</body></html>";
|
|||
|
return body;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|