Personal I need a help, in my system I have two Environments, being one of production and another of homologation. So being on my system, I have a part that sends email, to the user. Could someone help me in order to send the email, the system to identify the environment and signal with the name [APPROVAL] - [PRODUCTION] I'll post my controller below.
public void EnviaAlertaBaixoEstoque(Centro hospital, int tipo)
{
var fluidos = new List<string> { "", "A", "B", "C", "D", "E", "F" };
var objEmail = FactoryMailMessage(MailPriority.High);
objEmail.To.Add("Leonardo Macedo <[email protected]>");
objEmail.Subject = $"Controle de Fluídos BaSICS - Aviso de estoque mínimo de fluídos {fluidos[tipo]} no {hospital.CentroId} - {hospital.Nome}";
var fluido = hospital.EstoqueA;
switch (tipo)
{
case 2:
fluido = hospital.EstoqueB;
break;
case 3:
fluido = hospital.EstoqueC;
break;
case 4:
fluido = hospital.EstoqueD;
break;
case 5:
fluido = hospital.EstoqueE;
break;
case 6:
fluido = hospital.EstoqueF;
break;
}
objEmail.Body = $"O {hospital.CentroId} - {hospital.Nome} está com estoque de fluídos {fluidos[tipo]} em {fluido} litro(s).";
EnviarEmail(objEmail);
}
Summarizing the BaSICS Fluid Control message before Control appears [APPROVAL] BaSICS Fluid Control or [PRODUCTION] > Fluid Control BaSICS
I found an example on the internet only that I could not implement on my system.
var titulo = "zzzz";
if (Request.Url.Scheme.Contains("homolog"))
{
titulo = "[HOMOLOGAÇÃO] " + titulo;
}