Exemple #1
0
 ///<summary>
 /// Method Name     : SendEmail
 /// Author          : Pratik Soni
 /// Creation Date   : 12 Jan 2018
 /// Purpose         : To send email
 /// <param name="emailId"/>
 /// <returns>Customers Verification Data in the form of JObject.</returns>
 /// </summary>
 private bool SendEmail(string emailId, string moveNumber, List <string> updatedFields)
 {
     emailHandler.Add <EstimateDetailsUpdatedEmailModel>(emailId,
                                                         "0002",
                                                         new EstimateDetailsUpdatedEmailModel
     {
         MoveCoOrdinatorEmailId = emailId,
         MoveNumber             = moveNumber,
         FieldList = updatedFields
     });
     emailHandler.Send();
     return(true);
 }
Exemple #2
0
        ///<summary>
        /// Method Name     : SendEmail
        /// Author          : Ranjana Singh
        /// Creation Date   : 21 Dec 2017
        /// Purpose         : To send email
        /// <param name="customerEmailId"/>
        /// <returns>Customers Verification Data in the form of JObject.</returns>
        /// </summary>
        private bool SendEmail(string moveNumber, string requestData)
        {
            ServiceResponse <Move> coordinatorForMove;
            ServiceResponse <Move> customerResponse;
            JObject jObject;
            string  templateID;
            MoveStatusChangedEmailModel emailModel;

            //get the contact of move co-ordinator for current move.
            coordinatorForMove = crmMoveDetails.GetContactForMove(moveNumber);

            if ((coordinatorForMove.Data == null))
            {
                logger.Info(resourceManager.GetString("msgInvalidMove"));
                return(false);
            }
            try
            {
                jObject    = JObject.Parse(requestData);
                emailModel = new MoveStatusChangedEmailModel
                {
                    MoveCoOrdinatorEmailId = coordinatorForMove.Data.MoveCoordinator_EmailAddress,
                    MoveNumber             = moveNumber
                };

                if (jObject["StatusReason"].ToString() == resourceManager.GetString("StatusCodeNeedsOverride"))//Checked status code for "Need Override"
                {
                    customerResponse = GetContactDetailsForMove(moveNumber);
                    emailModel.CustomerEmailAddress  = customerResponse.Data.CustomerEmailAddress;
                    emailModel.CustomerContactNumber = customerResponse.Data.CustomerContactNumber;
                    templateID = "0004";
                }
                else
                {
                    templateID = "0003";
                }
                emailHandler.Add(coordinatorForMove.Data.MoveCoordinator_EmailAddress, templateID, emailModel);
                emailHandler.Send();
                return(true);
            }
            catch
            {
                logger.Error(resourceManager.GetString("msgUnableToSendEmailToMoveCoordinator"));
                return(false);
            }
        }
Exemple #3
0
 ///<summary>
 /// Method Name     : SendEmail
 /// Author          : Pratik Soni
 /// Creation Date   : 21 Dec 2017
 /// Purpose         : To send email
 /// <param name="emailId"/>
 /// <param name="verificationCode"/>
 /// <returns>Service response with customer DTO having latest verification code if mail successfully sent.</returns>
 /// </summary>
 private bool SendEmail(string emailId, int verificationCode)
 {
     try
     {
         emailHandler.Add <VerificationEmailModel>(emailId, "0001", new VerificationEmailModel {
             verificationCode = verificationCode
         });
         emailHandler.Send();
         logger.Info("Email sent succesfully");
         return(true);
     }
     catch (Exception ex)
     {
         logger.Info(resourceManager.GetString("msgUnableToSendEmail") + ": " + ex.ToString());
         return(false);
     }
 }