Example #1
0
        static InterestConfirmation UpgradeLeadType_NewInterestConfirmation(Lead lead, UtcDateTime now)
        {
            var greeting = "Dear Client";

            if (lead.FirstName.IsSome)
            {
                greeting = "Hi " + lead.FirstName.Val;
            }
            else if (lead.IdNumber.IsSome)
            {
                greeting = "Dear " + (lead.IsMale ? "Sir" : "Madam");
            }

            var interestedPrompt = new YesNoPrompt("ProceedPrompt", "InterestConfirmed", greeting + ". SmartMobile would like to let you know that you can UPGRADE your contract today with this free SMS service. Reply YES to upgrade now and select your new Smartphone. T&Cs");

            var confirmation = new InterestConfirmation(lead.MobileNo, now, new List <Step> {
                new Step("AskIfInterestedStep", new List <IAction_> {
                    interestedPrompt
                })
            });

            return(confirmation);
        }
Example #2
0
        static Application UpgradeLeadType_NewApplicationWorkflow(Lead lead, UtcDateTime now)
        {
            var a1 = new LoadRecommendedProductsAction();
            var a2 = new RecommendProductAction();

            var a3 = new SendMessage("CongratsMessage"
                                     , "You have selected your upgrade product. Our friendly staff will be in contact to arrange delivery. Happy phoning."
                                     , isAccepted_: true
                                     );

            var application = new Application(lead.MobileNo, now, new List <Step> {
                new Step("LoadRecommendedProductsStep", new List <IAction_> {
                    a1
                }),
                new Step("ChooseProductStep", new List <IAction_> {
                    a2
                }),
                new Step("CongratsStep", new List <IAction_> {
                    a3
                })
            });

            return(application);
        }
Example #3
0
        public Application NewApplication(Lead lead)
        {
            var application = LeadTypeModule.NewApplication(this, lead);

            return(application);
        }
Example #4
0
        static Dictionary <string, Dictionary <string, ActionResponse> > UpgradeLeadType_NewApplicationPredefinedResponses(Lead lead)
        {
            var predefinedResponses = new Dictionary <string, Dictionary <string, ActionResponse> >();

            return(predefinedResponses);
        }
Example #5
0
        public InterestConfirmation NewInterestConfirmation(Lead lead)
        {
            var interestConfirmation = LeadTypeModule.NewInterestConfirmation(this, lead);

            return(interestConfirmation);
        }
Example #6
0
        static Application OutboundLeadType_NewApplicationWorkflow(Lead lead, UtcDateTime now)
        {
            var onOptOutMessage = new SendMessage("OnOptOutMessage"
                                                  , "Noted. We will make sure not to send you any future Smartphone deals. To get Smartphone deals again, SMS APPLY to 39360"
                                                  , isAccepted_: false
                                                  );

            var a1 = new LoadRecommendedProductsAction();
            var a2 = new RecommendProductAction();

            var a3 = new IdNoVerifyAndSurnamePrompt("IdVerifyAndSurnamePrompt", "We won't take too much of your time. Please reply with your surname and the first 6 digits of your ID number. Example: Williams 740412");


            var a4 = new BankDetailsPrompt("BankDetailsPrompt", "To apply, reply with your bank name, account no and type. Example: Capitec 100112 Savings. Your info is SECURED");

            var a5 = new VerifyBankAccountAction();
            var onRejectAccountVerification = new SendMessage("OnRejectAccountVerification"
                                                              , "Something went wrong while confirming your bank account details. Please ensure your account details are correct."
                                                              , isAccepted_: false
                                                              );

            var a6 = new FreeTextPrompt("CompanyNamePrompt", "EmployerName", "For FAST & FREE delivery to your work address reply with your Employer's Name. Example: iSmart");

            var a7 = new FreeTextPrompt("CompanyAddressPrompt", "EmployerAddress", "Almost done! Reply with your Employer's Street Address. Example: 15 Vilakazi str, Soweto, Gauteng, 1803");

            var a8 = new YesNoPrompt("AcceptT&CsPrompt", "AcceptT&Cs", $"View your T&Cs here: https://swoosh-mobile-prod.azurewebsites.net/tAndCs/{lead.Id}. Reply YES to agree and complete your application");

            var a9 = new SendMessage("CongratsMessage"
                                     , "Your brand new Smartphone is on its way. The couriers will contact you to arrange for FREE delivery to your work address. Enjoy your day"
                                     , isAccepted_: true
                                     );

            var application = new Application(lead.MobileNo, now, new List <Step> {
                new Step("LoadRecommendedProductsStep", new List <IAction_> {
                    a1
                }),
                new Step("ChooseProductStep", new List <IAction_> {
                    a2
                }),
                new Step("VerifyIdNoAndSurnameStep", new List <IAction_> {
                    a3
                }),
                new Step("AskBankDetailsStep", new List <IAction_> {
                    a4
                }),
                new Step("VerifyBankDetailsStep", new List <IAction_> {
                    a5
                }, onRejectAccountVerification, "AskBankDetailsStep", 2),
                new Step("AskCompanyNameStep", new List <IAction_> {
                    a6
                }),
                new Step("AskCompanyAddressStep", new List <IAction_> {
                    a7
                }),
                new Step("AcceptT&CsStep", new List <IAction_> {
                    a8
                }, onOptOutMessage),
                new Step("CongratsStep", new List <IAction_> {
                    a9
                })
            });

            return(application);
        }
Example #7
0
        static Dictionary <string, Dictionary <string, ActionResponse> > InboundLeadType_NewApplicationPredefinedResponses(Lead lead)
        {
            var predefinedResponses = new Dictionary <string, Dictionary <string, ActionResponse> >();

            if (lead.IdNumber.IsSome && lead.Surname.IsSome)
            {
                var text = lead.IdNumber.Val + " " + lead.Surname.Val;
                var resp = (ActionResponse) new ReceiveMessageResponseActionResponse(new ReceiveMessageResponse(lead.MobileNo, "<PredefinedResponse>", text));
                predefinedResponses.Add("AskIdNoAndSurnameStep", ("IdSurnamePrompt", resp).ToDictionary());
            }

            if (lead.ScoreValue.IsSome || lead.ProductBracket.IsSome)
            {
                var resp = (ActionResponse) new ScoreCustomerResponseActionResponse(new ScoreCustomerResponse("<PredefinedResponse>", lead.ScoreValue, lead.ProductBracket));
                predefinedResponses.Add("ScoreCustomerStep", ("ScoringAction", resp).ToDictionary());
            }

            return(predefinedResponses);
        }
Example #8
0
        static Application InboundLeadType_NewApplicationWorkflow(Lead lead, UtcDateTime now)
        {
            var onOptOutMessage = new SendMessage("OnOptOutMessage"
                                                  , "Noted. We will make sure not to send you any future Smartphone deals. To get Smartphone deals again, SMS APPLY to 39360"
                                                  , isAccepted_: false
                                                  );

            var a2 = new IdNoSurnamePrompt("IdSurnamePrompt", "We want to give you the best deal. We need to see which deals you qualify for. Reply with your Surname and ID number. All info is SECURED. Example: Williams 7404125001087");

            var a3 = new ScoringAction(minAcceptableScore: 0);

            var onRejectScore = new SendMessage("OnRejectScoreMessage"
                                                , "Unfortunately, you have not qualified for a Smartphone. If your circumstances change, please reply with APPLY to 39360"
                                                , isAccepted_: false
                                                );

            var a4 = new LoadRecommendedProductsAction();
            var a5 = new RecommendProductAction();

            var a6 = new BankDetailsPrompt("BankDetailsPrompt", "To apply, reply with your bank name, account no and type. Example: Capitec 100112 Savings. Your info is SECURED");

            var a7 = new VerifyBankAccountAction();
            var onRejectAccountVerification = new SendMessage("OnRejectAccountVerification"
                                                              , "Something went wrong while confirming your bank account details. Please ensure your account details are correct."
                                                              , isAccepted_: false
                                                              );

            var a8 = new FreeTextPrompt("CompanyNamePrompt", "EmployerName", "Thanks. Your banking details are verified, and application approved. For FREE delivery to your work address reply with your Employer's Name. Example: iSmart");

            var a9 = new FreeTextPrompt("CompanyAddressPrompt", "EmployerAddress", "Almost done! Reply with your Employer's Street Address. Example: 15 Vilakazi str, Soweto, Gauteng, 1803");

            var a10 = new YesNoPrompt("AcceptT&CsPrompt", "AcceptT&Cs", $"View your T&Cs here: https://swoosh-mobile-prod.azurewebsites.net/tAndCs/{lead.Id}. Reply YES to agree and complete your application");

            var a11 = new SendMessage("CongratsMessage"
                                      , "Your brand new Smartphone is on its way. The couriers will contact you to arrange for FREE delivery to your work address. Enjoy your day"
                                      , isAccepted_: true
                                      );

            var application = new Application(lead.MobileNo, now, new List <Step> {
                new Step("AskIdNoAndSurnameStep", new List <IAction_> {
                    a2
                }),
                new Step("ScoreCustomerStep", new List <IAction_> {
                    a3
                }, onRejectScore),
                new Step("LoadRecommendedProductsStep", new List <IAction_> {
                    a4
                }, onRejectScore),
                new Step("ChooseProductStep", new List <IAction_> {
                    a5
                }),
                new Step("AskBankDetailsStep", new List <IAction_> {
                    a6
                }),
                new Step("VerifyBankDetailsStep", new List <IAction_> {
                    a7
                }, onRejectAccountVerification, "AskBankDetailsStep", 2),
                new Step("AskCompanyNameStep", new List <IAction_> {
                    a8
                }),
                new Step("AskCompanyAddressStep", new List <IAction_> {
                    a9
                }),
                new Step("AcceptT&CsStep", new List <IAction_> {
                    a10
                }, onOptOutMessage),
                new Step("CongratsStep", new List <IAction_> {
                    a11
                })
            });

            return(application);
        }