mail riepilogativa
This commit is contained in:
parent
ebb115c588
commit
d83fa33205
@ -150,7 +150,9 @@ namespace VirtualTask.Controllers
|
|||||||
if (response.IsSuccessStatusCode)
|
if (response.IsSuccessStatusCode)
|
||||||
{
|
{
|
||||||
//mando mail avvenuta richiesta
|
//mando mail avvenuta richiesta
|
||||||
bool esito = MailSent(model.email,model.cognome,model.token);
|
string message = getMailText(model.cognome, tokenMail, model.email);
|
||||||
|
string subject = _configuration["ApplicationInsights:subjectMail"];
|
||||||
|
bool esito = MailSent(model.email, subject, message);
|
||||||
return RedirectToAction("RegistrazioneOk");
|
return RedirectToAction("RegistrazioneOk");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -190,6 +192,7 @@ namespace VirtualTask.Controllers
|
|||||||
admin = helper.GetStringValue("admin");
|
admin = helper.GetStringValue("admin");
|
||||||
ViewBag.Admin = admin;
|
ViewBag.Admin = admin;
|
||||||
|
|
||||||
|
|
||||||
Uri baseAddress = new Uri(urlBase);
|
Uri baseAddress = new Uri(urlBase);
|
||||||
client = new HttpClient();
|
client = new HttpClient();
|
||||||
client.BaseAddress = baseAddress;
|
client.BaseAddress = baseAddress;
|
||||||
@ -206,6 +209,10 @@ namespace VirtualTask.Controllers
|
|||||||
var trovato = reg.First();
|
var trovato = reg.First();
|
||||||
|
|
||||||
UpdRegistrazione(trovato);
|
UpdRegistrazione(trovato);
|
||||||
|
//mando mail riepilogo dati registrazione
|
||||||
|
string message = getMailTextRiepilogo(trovato);
|
||||||
|
string subject= _configuration["ApplicationInsights:subjectMailRiepilogo"];
|
||||||
|
bool esito = MailSent(trovato.email, subject, message);
|
||||||
return RedirectToAction("RegistrazioneFinished");
|
return RedirectToAction("RegistrazioneFinished");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -444,7 +451,7 @@ namespace VirtualTask.Controllers
|
|||||||
}
|
}
|
||||||
return bAziPres;
|
return bAziPres;
|
||||||
}
|
}
|
||||||
private bool MailSent(string receiver, string nome, string tokenMail)
|
private bool MailSent(string receiver, string subject, string message)
|
||||||
{
|
{
|
||||||
//REMEMBER per una mail gmail bisogna andare nelle impostazioni
|
//REMEMBER per una mail gmail bisogna andare nelle impostazioni
|
||||||
//e impostare "Accesso app meno sicure" a ON
|
//e impostare "Accesso app meno sicure" a ON
|
||||||
@ -456,8 +463,8 @@ namespace VirtualTask.Controllers
|
|||||||
string pwdMail = _configuration["ApplicationInsights:pwdMail"];
|
string pwdMail = _configuration["ApplicationInsights:pwdMail"];
|
||||||
|
|
||||||
|
|
||||||
string subject = _configuration["ApplicationInsights:subjectMail"];
|
|
||||||
string message = getMailText(nome, tokenMail, receiver);
|
//string message = getMailText(nome, tokenMail, receiver);
|
||||||
|
|
||||||
var senderEmail = new MailAddress(senderMail, senderName);
|
var senderEmail = new MailAddress(senderMail, senderName);
|
||||||
var receiverEmail = new MailAddress(receiver, "Receiver");
|
var receiverEmail = new MailAddress(receiver, "Receiver");
|
||||||
|
|||||||
@ -20,7 +20,9 @@
|
|||||||
"nomeMail": "Supporto Virtual Task",
|
"nomeMail": "Supporto Virtual Task",
|
||||||
"pwdMail": "Polo2023!",
|
"pwdMail": "Polo2023!",
|
||||||
"subjectMail": "Richiesta App di test",
|
"subjectMail": "Richiesta App di test",
|
||||||
|
"subjectMailRiepilogo": "Registrazione completata",
|
||||||
"rootUrl": "https://virtualtask.it/"
|
"rootUrl": "https://virtualtask.it/"
|
||||||
|
//"rootUrl": "https://localhost:7140/"
|
||||||
},
|
},
|
||||||
"AllowedHosts": "*"
|
"AllowedHosts": "*"
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user