/// <summary> /// Method to send email to the list of users /// </summary> /// <param name="TribuetId">Tribute ID to get the list of admin</param> /// <param name="strSubject">Subject of the mail</param> public void SendEmail(int TribuetId, string strSubject, string EmailBody) { StoryResource objStoryRes = new StoryResource(); UserInfo objUser = objStoryRes.GetTributeAdministrators(TribuetId, "Gift"); //Function to send the mail to the list of users who have added the Tribute in their list of favourites UserInfo objUserFav = objStoryRes.GetFavouriteTributeUsers(TribuetId, "Gift"); EmailMessages objEmail = EmailMessages.Instance; if (objUser.UserEmail != "") { bool val = objEmail.SendMessages("Your " + WebConfig.ApplicationWord + "<" + WebConfig.NoreplyEmail + ">", objUser.UserEmail, strSubject, CreateBody(EmailBody), EmailMessages.TextFormat.Html.ToString()); } //favourite mail //As per discussion with Rupendra: will send the mail in "To" field. //ie a comma separated list of users in the "to" field if (objUserFav.UserEmail != "") { bool val = objEmail.SendMessages("Your " + WebConfig.ApplicationWord + "<" + WebConfig.NoreplyEmail + ">", objUserFav.UserEmail, strSubject, CreateBody(EmailBody), EmailMessages.TextFormat.Html.ToString()); } }
//New Methods added for Sponsor email functionality. public void SendSponsorMails(String Sponsor, string FromUserEmail, int TributeId, string TributeType, string TributeName, string TributeUrl, string Expiry, int PackageId) { string _EmailBody = string.Empty; EmailMessages objEmail = EmailMessages.Instance; MailBodies objMail = new MailBodies(); StoryResource objStoryRes = new StoryResource(); UserInfo objUser = new UserInfo(); objUser = objStoryRes.GetTributeAdministrators(TributeId, ""); if (PackageId == 2 || PackageId == 5 || PackageId == 7) { _EmailBody = objMail.TributeSponsor1Year(Sponsor, TributeId, TributeType, TributeName, TributeUrl, Expiry); } if (PackageId == 1 || PackageId == 4 || PackageId == 6) _EmailBody = objMail.TributeSponsorLife(Sponsor, TributeId, TributeType, TributeName, TributeUrl, Expiry); if (Sponsor != null && Sponsor != String.Empty) { // For the anonymous email when the sponsor does not want to show who he is to the tribute owner if (Sponsor.Contains("An anonymous person")) { bool val = objEmail.SendMessages(FromUserEmail, objUser.UserEmail, "Someone has sponsored the " + TributeName + " " + TributeType + " " + WebConfig.ApplicationWordForInternalUse + "...", _EmailBody, EmailMessages.TextFormat.Html.ToString()); } else { bool val = objEmail.SendMessages(FromUserEmail, objUser.UserEmail, Sponsor + " sponsored the " + TributeName + " " + TributeType + " " + WebConfig.ApplicationWordForInternalUse + "...", _EmailBody, EmailMessages.TextFormat.Html.ToString()); } } }
public void SendSponsorMailsWithMessage(String Sponsor, String Message, int TributeId, string TributeType, string TributeName, string TributeUrl, string Expiry, int PackageId) { string _EmailBody = string.Empty; EmailMessages objEmail = EmailMessages.Instance; MailBodies objMail = new MailBodies(); StoryResource objStoryRes = new StoryResource(); UserInfo objUser = new UserInfo(); objUser = objStoryRes.GetTributeAdministrators(TributeId, ""); if (PackageId == 2 || PackageId == 5 || PackageId == 7) { _EmailBody = objMail.TributeSponsor1YearWithMessage(Sponsor, Message, TributeType, TributeName, TributeUrl, Expiry); } if (PackageId == 1 || PackageId == 4 || PackageId == 6) _EmailBody = objMail.TributeSponsorLifeWithMessage(Sponsor, Message, TributeType, TributeName, TributeUrl, Expiry); bool val = objEmail.SendMessages("Your " + WebConfig.ApplicationWord + "<" + WebConfig.NoreplyEmail + ">", objUser.UserEmail, Sponsor + " has sponsored the " + TributeName + " " + TributeType + " " + WebConfig.ApplicationWordForInternalUse + "...", _EmailBody, EmailMessages.TextFormat.Html.ToString()); }
/// <summary> /// Method to send email to the list of users /// </summary> /// <param name="TribuetId">Tribute ID to get the list of admin</param> /// <param name="strSubject">Subject of the mail</param> public void SendEmail(int TribuetId, string strSubject, string strBody, string FromUserEmail) { StoryResource objStoryRes = new StoryResource(); UserInfo objUser = new UserInfo(); objUser = objStoryRes.GetTributeAdministrators(TribuetId, ""); EmailMessages objEmail = EmailMessages.Instance; bool val = objEmail.SendMessages(FromUserEmail, objUser.UserEmail, strSubject, strBody, EmailMessages.TextFormat.Html.ToString()); }