///<summary>Returns an email message for the patient based on the statement passed in.</summary> public static EmailMessage GetEmailMessageForStatement(Statement stmt, Patient pat) { //No need to check RemotingRole; no call to db. EmailMessage message = new EmailMessage(); message.PatNum = pat.PatNum; message.ToAddress = pat.Email; message.FromAddress = EmailAddresses.GetByClinic(pat.ClinicNum).SenderAddress; string str; if (stmt.EmailSubject != null && stmt.EmailSubject != "") { str = stmt.EmailSubject; //Set str to the email subject if one was already set. } else //Subject was not set. Set str to the default billing email subject. { str = PrefC.GetString(PrefName.BillingEmailSubject); } message.Subject = Statements.ReplaceVarsForEmail(str, pat); if (stmt.EmailBody != null && stmt.EmailBody != "") { str = stmt.EmailBody; //Set str to the email body if one was already set. } else //Body was not set. Set str to the default billing email body text. { str = PrefC.GetString(PrefName.BillingEmailBodyText); } message.BodyText = Statements.ReplaceVarsForEmail(str, pat); return(message); }
public static EmailMessage GetEmailMessageForPortalStatement(Statement stmt, Patient pat) { //No need to check RemotingRole; no call to db. if (stmt.PatNum != pat.PatNum) { string logMsg = Lans.g("Statements", "Mismatched PatNums detected between current patient and current statement:") + "\r\n" + Lans.g("Statements", "Statement PatNum:") + " " + stmt.PatNum + " " + Lans.g("Statements", "(assumed correct)") + "\r\n" + Lans.g("Statements", "Patient PatNum:") + " " + pat.PatNum + " " + Lans.g("Statements", "(possibly incorrect)"); SecurityLogs.MakeLogEntry(Permissions.StatementPatNumMismatch, stmt.PatNum, logMsg, LogSources.Diagnostic); } EmailMessage message = new EmailMessage(); message.PatNum = pat.PatNum; message.ToAddress = pat.Email; message.FromAddress = EmailAddresses.GetByClinic(pat.ClinicNum).GetFrom(); string emailBody; if (stmt.EmailSubject != null && stmt.EmailSubject != "") { message.Subject = stmt.EmailSubject; } else //Subject was not preset, set a default subject. { message.Subject = Lans.g("Statements", "New Statement Available"); } if (stmt.EmailBody != null && stmt.EmailBody != "") { emailBody = stmt.EmailBody; } else //Body was not preset, set a body text. { emailBody = Lans.g("Statements", "Dear") + " [nameFLnoPref],\r\n\r\n" + Lans.g("Statements", "A new account statement is available.") + "\r\n\r\n" + Lans.g("Statements", "To view your account statement, log on to our portal by following these steps:") + "\r\n\r\n" + Lans.g("Statements", "1. Visit the following URL in a web browser:") + " " + PrefC.GetString(PrefName.PatientPortalURL) + ".\r\n" + Lans.g("Statements", "2. Enter your credentials to gain access to your account.") + "\r\n" + Lans.g("Statements", "3. Click the Account icon on the left and select the Statements tab."); } message.BodyText = Statements.ReplaceVarsForEmail(emailBody, pat, stmt); return(message); }
///<summary>Returns an email message for the patient based on the statement passed in.</summary> public static EmailMessage GetEmailMessageForStatement(Statement stmt, Patient pat) { if (stmt.PatNum != pat.PatNum) { string logMsg = Lans.g("Statements", "Mismatched PatNums detected between current patient and current statement:") + "\r\n" + Lans.g("Statements", "Statement PatNum:") + " " + stmt.PatNum + " " + Lans.g("Statements", "(assumed correct)") + "\r\n" + Lans.g("Statements", "Patient PatNum:") + " " + pat.PatNum + " " + Lans.g("Statements", "(possibly incorrect)"); SecurityLogs.MakeLogEntry(Permissions.StatementPatNumMismatch, stmt.PatNum, logMsg, LogSources.Diagnostic); } //No need to check RemotingRole; no call to db. EmailMessage message = new EmailMessage(); message.PatNum = pat.PatNum; message.ToAddress = pat.Email; message.FromAddress = EmailAddresses.GetByClinic(pat.ClinicNum).GetFrom(); string str; if (stmt.EmailSubject != null && stmt.EmailSubject != "") { str = stmt.EmailSubject; //Set str to the email subject if one was already set. } else //Subject was not set. Set str to the default billing email subject. { str = PrefC.GetString(PrefName.BillingEmailSubject); } message.Subject = Statements.ReplaceVarsForEmail(str, pat, stmt); if (stmt.EmailBody != null && stmt.EmailBody != "") { str = stmt.EmailBody; //Set str to the email body if one was already set. } else //Body was not set. Set str to the default billing email body text. { str = PrefC.GetString(PrefName.BillingEmailBodyText); } message.BodyText = Statements.ReplaceVarsForEmail(str, pat, stmt); return(message); }