Completato insert email preliminare
This commit is contained in:
@@ -209,7 +209,7 @@
|
||||
Classe astrazione accesso dati
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:LiMan.APi.Data.ApiDataService.#ctor(Microsoft.Extensions.Configuration.IConfiguration,Microsoft.Extensions.Logging.ILogger{LiMan.APi.Data.ApiDataService})">
|
||||
<member name="M:LiMan.APi.Data.ApiDataService.#ctor(Microsoft.Extensions.Configuration.IConfiguration,Microsoft.Extensions.Logging.ILogger{LiMan.APi.Data.ApiDataService},Microsoft.AspNetCore.Identity.UI.Services.IEmailSender)">
|
||||
<summary>
|
||||
Init classe
|
||||
</summary>
|
||||
|
||||
@@ -11,6 +11,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using static LiMan.DB.Enum;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
|
||||
namespace LiMan.UI.Data
|
||||
{
|
||||
@@ -20,8 +21,8 @@ namespace LiMan.UI.Data
|
||||
|
||||
private static IConfiguration _configuration;
|
||||
private static ILogger<LiManDataService> _logger;
|
||||
|
||||
private static NLog.Logger Log = LogManager.GetCurrentClassLogger();
|
||||
private readonly IEmailSender _emailSender;
|
||||
private readonly IDistributedCache distributedCache;
|
||||
private readonly IMemoryCache memoryCache;
|
||||
|
||||
@@ -54,10 +55,11 @@ namespace LiMan.UI.Data
|
||||
|
||||
#region Public Constructors
|
||||
|
||||
public LiManDataService(IConfiguration configuration, ILogger<LiManDataService> logger, IMemoryCache memoryCache, IDistributedCache distributedCache)
|
||||
public LiManDataService(IConfiguration configuration, ILogger<LiManDataService> logger, IMemoryCache memoryCache, IDistributedCache distributedCache, IEmailSender emailSender)
|
||||
{
|
||||
_logger = logger;
|
||||
_configuration = configuration;
|
||||
_emailSender = emailSender;
|
||||
// conf cache
|
||||
this.memoryCache = memoryCache;
|
||||
this.distributedCache = distributedCache;
|
||||
@@ -547,6 +549,20 @@ namespace LiMan.UI.Data
|
||||
dbControllerGLS.rollBackEntity(item);
|
||||
}
|
||||
|
||||
public async Task<bool> SendEmail(string destEmail, string oggetto, string corpo)
|
||||
{
|
||||
bool answ = false;
|
||||
try
|
||||
{
|
||||
await _emailSender.SendEmailAsync(destEmail, oggetto, corpo);
|
||||
answ = true;
|
||||
}
|
||||
catch
|
||||
{ }
|
||||
|
||||
return answ;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Aggiornamentos tato ticket
|
||||
/// </summary>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<Version>1.1.2111.1619</Version>
|
||||
<Version>1.1.2111.1711</Version>
|
||||
<RootNamespace>LiMan.UI</RootNamespace>
|
||||
<AssemblyName>LiMan.UI</AssemblyName>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<body>
|
||||
<i>License Manager</i>
|
||||
<h4>Versione: 1.1.2111.1619</h4>
|
||||
<h4>Versione: 1.1.2111.1711</h4>
|
||||
<br />
|
||||
Note di rilascio:
|
||||
<ul>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.1.2111.1619
|
||||
1.1.2111.1711
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<item>
|
||||
<version>1.1.2111.1619</version>
|
||||
<version>1.1.2111.1711</version>
|
||||
<url>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/LiMan.UI.zip</url>
|
||||
<changelog>https://nexus.steamware.net/repository/SWS/LiMan/stable/LAST/ChangeLog.html</changelog>
|
||||
<mandatory>false</mandatory>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
using LiMan.DB;
|
||||
using LiMan.UI.Data;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Components;
|
||||
@@ -13,6 +14,7 @@ using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Identity.UI.Services;
|
||||
|
||||
namespace LiMan.UI
|
||||
{
|
||||
@@ -97,6 +99,18 @@ namespace LiMan.UI
|
||||
options.InstanceName = "LiMan";
|
||||
});
|
||||
|
||||
// abilitazione x email management con MailKit
|
||||
services.AddTransient<IEmailSender, MailKitEmailSender>();
|
||||
services.Configure<MailKitEmailSenderOptions>(options =>
|
||||
{
|
||||
options.Host_Address = Configuration["ExternalProviders:MailKit:SMTP:Address"];
|
||||
options.Host_Port = Convert.ToInt32(Configuration["ExternalProviders:MailKit:SMTP:Port"]);
|
||||
options.Host_Username = Configuration["ExternalProviders:MailKit:SMTP:Account"];
|
||||
options.Host_Password = Configuration["ExternalProviders:MailKit:SMTP:Password"];
|
||||
options.Sender_EMail = Configuration["ExternalProviders:MailKit:SMTP:SenderEmail"];
|
||||
options.Sender_Name = Configuration["ExternalProviders:MailKit:SMTP:SenderName"];
|
||||
});
|
||||
|
||||
services.AddLocalization();
|
||||
|
||||
services.AddRazorPages();
|
||||
|
||||
Reference in New Issue
Block a user