public SaveResult SendTestEmail(UserIdRequest request) { try { string link = "http://adventureworksmvc.synergos.hr/"; string message = "Hello,<br/><br/>\n" + $"This is test email sent from application {AppSettings.AppName} ({link}).<br/><br/>\n" + "Best regards<br/>"; UserViewModel user = UserProfileHelper.GetUser(request.Id); if (string.IsNullOrEmpty(user.Email)) { return new SaveResult { Status = "error", Message = "User doesn't have email address." } } ; EmailHelper.SendMail(AppSettings.AppName, user.Email, string.IsNullOrEmpty(user.FullName) ? user.Email : user.FullName, message); return(new SaveResult { Status = "success" }); } catch (Exception ex) { return(new SaveResult { Status = "error", Message = ex.Message }); } }