コード例 #1
0
        public void BuildAskMeEmail(AskMeRequestModel requestModel, string emailRecipient)
        {
            String logMethodName = ".BuildAskMeEmail(AskMeRequestModel requestModel) - ";

            _log.Debug(logMethodName + "Begin Method");

            String body = String.Format("First Name: {0}<br>Last Name: {1}<br>Email: {2}<br>Membership Id: {3}<br><br>Question: {4}", requestModel.FirstName, requestModel.LastName, requestModel.FromEmailAddress, requestModel.MembershipId, requestModel.YourQuestion);

            ComposeAndSendEmail(requestModel.FromEmailAddress, emailRecipient, body, requestModel.Subject, requestModel);

            _log.Debug(logMethodName + "End Method");
        }
コード例 #2
0
        public AskMeRequestModel SaltLiveEmailUs(AskMeRequestModel requestModel)
        {
            if (requestModel.IsValid())
            {
                //Create AskMe object
                IAskMe askMeAdapter = new AskMe();
                //Pass request model to email builder function. Email will be sent from within
                askMeAdapter.BuildAskMeEmail(requestModel, Config.SaltLiveEmailRecipient);

                return(requestModel);
            }

            //request model invalid, handle gracefully
            return(requestModel ?? (requestModel = new AskMeRequestModel()));
        }