private string generateEmailBody(string template, InviteFriendModel model) { try { return Razor.Parse(template, model); } catch (Exception ex) { logAccessor.CreateLog(DateTime.Now, this.GetType().ToString() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), ex.ToString()); return ex.Message; } }
public bool SendInviteFriendEmail(string userFirstName, string friendName, string friendEmail) { try { InviteFriendModel inviteFriendModel = new InviteFriendModel() { UserFirstName = userFirstName, FriendName = friendName }; String messageBody = generateEmailBody(Manager.Properties.Resources.InviteFriendTemplate.ToString(), inviteFriendModel); SendMessage("*****@*****.**", "Vestn", new String[1] { friendEmail }, null, null, userFirstName + " wants you to join Vestn", messageBody); return true; } catch (Exception e) { logAccessor.CreateLog(DateTime.Now, this.GetType().ToString() + "." + System.Reflection.MethodBase.GetCurrentMethod().Name.ToString(), e.ToString()); return false; } }