Merge branch 'release/EmailTest_01'

This commit is contained in:
Samuele Locatelli
2025-01-16 12:32:49 +01:00
12 changed files with 73 additions and 37 deletions
+41 -12
View File
@@ -41,11 +41,11 @@ namespace LiMan.APi.Controllers
/// <summary>
/// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma + licenza ATTUALE
///
///
/// GET api/licenza/id?CodApp=xxx&Chiave=yyyy
/// </summary>
/// <param name="id">Codice cliente/Installazione</param>
/// <param name="CodApp">Codice Applicazione</param>
/// <param name="CodApp">Codice Applicazione</param>
/// <param name="Chiave">Chiave licenza da validare</param>
/// <returns></returns>
[HttpGet("{id}")]
@@ -99,13 +99,36 @@ namespace LiMan.APi.Controllers
string msgTopic = "LiMan: verifica Licenze in scadenza";
// invio email
await sendEmail(msgTopic, msgBody.Replace($"{Environment.NewLine}", "<br/>"));
string destList = _configuration["MailDest:ExpiryNotify"];
await sendEmailExpiry(destList, msgTopic, msgBody.Replace($"{Environment.NewLine}", "<br/>"));
// ritorno solo LOG azioni
answ = $"Scadute {numScadute} | Settimana: {numWeek} | Mese: {numMonth} | Trimestre: {numTrim}";
return answ;
}
/// <summary>
/// Effettua test invio email
/// </summary>
/// <returns></returns>
[HttpGet("test-email")]
public async Task<string> TestEmail()
{
// oggetti base
string answ = "ND";
string msgBody = "Prova invio email a destinatari <b>MailDest:ExpiryNotify</b>";
// predispongo email
string msgTopic = "LiMan: Test invio email!";
// invio email
string destList = _configuration["MailDest:ExpiryNotify"];
await sendEmailExpiry(destList, msgTopic, msgBody.Replace($"{Environment.NewLine}", "<br/>"));
// ritorno solo LOG azioni
answ = $"Test effettuato!";
return answ;
}
/// POST api/licenza
/// <summary>
/// Recupera dati Licenza Applicativa (id licenza + num utenze) dati cliente + programma +
@@ -211,30 +234,36 @@ namespace LiMan.APi.Controllers
if (elencoLicenze.Count == 0)
{
doLog($"&nbsp;- nessuna", logType.info, ref sbMain);
}
else {
foreach (var item in elencoLicenze)
else
{
doLog($"&nbsp;- {item.Scadenza:yyyy.MM.dd} | <b>{item.CodInst}</b> | {item.Descrizione}", logType.info, ref sbMain);
}
foreach (var item in elencoLicenze)
{
doLog($"&nbsp;- {item.Scadenza:yyyy.MM.dd} | <b>{item.CodInst}</b> | {item.Descrizione}", logType.info, ref sbMain);
}
}
doLog("</div>", logType.none, ref sbMain);
doLog("</div>", logType.none, ref sbMain);
return sbMain.ToString();
}
protected async Task sendEmail(string subject, string message)
/// <summary>
/// Invio email a lista ExpiryNotify
/// </summary>
/// <param name="destList">Elenco destinatari comma separated</param>
/// <param name="subject">Oggetto Email</param>
/// <param name="message">MEssaggio</param>
/// <returns></returns>
protected async Task sendEmailExpiry(string destList, string subject, string message)
{
string emailRaw = _configuration["MailDest:ExpiryNotify"];
List<string> emailDestList = emailRaw.Split(",").ToList();
List<string> emailDestList = destList.Split(",").ToList();
foreach (var dest in emailDestList)
{
try
{
await _emailSender.SendEmailAsync(dest, subject, message);
}
catch(Exception exc)
catch (Exception exc)
{
Log.Error($"Eccezione durante invio email:{Environment.NewLine}dest: {dest} | subject {subject}{Environment.NewLine}{exc}");
}
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>License Manager</i>
<h4>Versione: 2.1.2501.1611</h4>
<h4>Versione: 2.1.2501.1612</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
2.1.2501.1611
2.1.2501.1612
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>2.1.2501.1611</version>
<version>2.1.2501.1612</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>
+2 -2
View File
@@ -18,8 +18,8 @@
"Address": "smtp.gmail.com",
"Port": "587",
"Account": "services@steamware.net",
"Password": "vpsad24068!",
"SenderEmail": "sservices@steamware.net",
"Password": "vpsad24068",
"SenderEmail": "services@steamware.net",
"SenderName": "Steamware Email BOT"
}
}
+3 -3
View File
@@ -1447,7 +1447,7 @@ namespace LiMan.DB.Controllers
}
catch (Exception ex)
{
Log.Error($"Eccezoine in InstallRelClean{Environment.NewLine}{ex}");
Log.Error($"Eccezione in InstallRelClean | CodImp: {CodImp} | AppKey: {AppKey} | ListCodApp #: {ListCodApp.Count}{Environment.NewLine}{ex}");
}
}
}
@@ -1520,7 +1520,7 @@ namespace LiMan.DB.Controllers
}
catch (Exception ex)
{
Log.Error($"Eccezoine in InstallRelHistSnapshot{Environment.NewLine}{ex}");
Log.Error($"Eccezione in InstallRelHistSnapshot{Environment.NewLine}{ex}");
}
}
return fatto;
@@ -1587,7 +1587,7 @@ namespace LiMan.DB.Controllers
}
catch (Exception ex)
{
Log.Error($"Eccezoine in InstallRelUpsert{Environment.NewLine}{ex}");
Log.Error($"Eccezione in InstallRelUpsert | IdxLic: {upRec.IdxLic} | CodApp: {upRec.CodApp} | VersNum: {upRec.VersNum} {Environment.NewLine}{ex}");
}
}
return fatto;
+18 -11
View File
@@ -102,17 +102,24 @@
<h3>User Administration</h3>
</div>
<div class="px-1">
<div class="input-group">
<span class="input-group-text"><i class="fas fa-user-tag"></i></span>
<select class="form-select" @bind="@FiltUserRole">
<option value="0">--- Tutti ---</option>
@foreach (var item in RolesList)
{
<option value="@item.RoleID">
@item.Ruolo
</option>
}
</select>
<div class="row">
<div class="col">
<div class="input-group">
<span class="input-group-text"><i class="fas fa-user-tag"></i></span>
<select class="form-select" @bind="@FiltUserRole">
<option value="0">--- Tutti ---</option>
@foreach (var item in RolesList)
{
<option value="@item.RoleID">
@item.Ruolo
</option>
}
</select>
</div>
</div>
@* <div class="col">
<button class="btn btn-info disabled"><i class="fa-regular fa-envelope"></i> Test Email Send</button>
</div> *@
</div>
</div>
</div>
+1 -1
View File
@@ -2,7 +2,7 @@
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<Version>2.1.2501.1611</Version>
<Version>2.1.2501.1612</Version>
<RootNamespace>LiMan.UI</RootNamespace>
<AssemblyName>LiMan.UI</AssemblyName>
</PropertyGroup>
+1 -1
View File
@@ -1,6 +1,6 @@
<body>
<i>License Manager</i>
<h4>Versione: 2.1.2501.1611</h4>
<h4>Versione: 2.1.2501.1612</h4>
<br /> Note di rilascio:
<ul>
<li>
+1 -1
View File
@@ -1 +1 @@
2.1.2501.1611
2.1.2501.1612
+1 -1
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<item>
<version>2.1.2501.1611</version>
<version>2.1.2501.1612</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>
+2 -2
View File
@@ -25,8 +25,8 @@
"Address": "smtp.gmail.com",
"Port": "587",
"Account": "services@steamware.net",
"Password": "vpsad24068!",
"SenderEmail": "sservices@steamware.net",
"Password": "vpsad24068",
"SenderEmail": "services@steamware.net",
"SenderName": "Steamware Email BOT"
}
}