public void PreviewMessage(dtoManagerTemplateMail template, String fakeName, String fakeSurname, String fakeTaxCode, String fakeMail, lm.Comol.Core.MailCommons.Domain.Configurations.SmtpServiceConfig smtpConfig, String websiteUrl, Dictionary <SubmissionTranslations, string> translations) { if (UserContext.isAnonymous) { View.DisplaySessionTimeout(); } else { Language dLanguage = CurrentManager.GetDefaultLanguage(); litePerson currentUser = CurrentManager.GetLitePerson(UserContext.CurrentUserID); litePerson fakeUser = new litePerson(); fakeUser.TypeID = (int)UserTypeStandard.Student; fakeUser.Name = fakeName; fakeUser.Surname = fakeSurname; fakeUser.Mail = fakeMail; fakeUser.TaxCode = fakeTaxCode; fakeUser.LanguageID = currentUser.LanguageID; lm.Comol.Core.Mail.dtoMailMessage message = CallService.GetMailPreview(View.IdCall, template, currentUser, smtpConfig, websiteUrl, translations); String recipients = template.NotifyTo; if (String.IsNullOrEmpty(recipients)) { recipients = currentUser.Mail; } else if (recipients.Contains(",")) { recipients = recipients.Replace(",", ";"); } View.DisplayMessagePreview(new lm.Comol.Core.Mail.dtoMailMessagePreview(currentUser.LanguageID, dLanguage, message, template.MailSettings, smtpConfig), recipients); } }
private void LoadTemplate(long idCall) { BaseForPaper call = CallService.GetCall(idCall); if (call == null) { View.LoadUnknowCall(View.IdCommunity, View.IdCallModule, idCall, View.CallType); } else { dtoManagerTemplateMail template = CallService.GetManagerTemplateMail(idCall); if (template == null) { View.DisplayNoTemplate(); template = View.GetDefaultTemplate; litePerson person = CurrentManager.GetLitePerson(UserContext.CurrentUserID); template.NotifyTo = (call.CreatedBy != null) ? call.CreatedBy.Mail : ""; if (person != null && call.CreatedBy != null && person.Id != call.CreatedBy.Id) { template.NotifyTo = (string.IsNullOrEmpty(template.NotifyTo)) ? "" : ";" + person.Mail; } } View.LoadTemplate(template); } }
public void SaveSettings(dtoManagerTemplateMail template) { ManagerTemplateMail sTemplate = CallService.SaveManagerTemplate(View.IdCall, template); if (sTemplate == null) { View.DisplayErrorSaving(); } else { View.IdTemplate = sTemplate.Id; View.DisplaySettingsSaved(); if (View.CallType == CallForPaperType.CallForBids) { View.SendUserAction(View.IdCommunity, View.IdCallModule, View.IdCall, ModuleCallForPaper.ActionType.SaveManagerTemplate); } else { View.SendUserAction(View.IdCommunity, View.IdCallModule, View.IdCall, ModuleRequestForMembership.ActionType.SaveManagerTemplate); } View.LoadWizardSteps(View.IdCall, View.CallType, View.IdCommunity, CallService.GetAvailableSteps(View.IdCall, WizardCallStep.NotificationTemplateMail, View.CallType)); } }