public async Task ContactUrgent(IDialogContext context, LuisResult result)
        {
            var entities = new List <EntityRecommendation>(result.Entities);

            _fone   = entities.FirstOrDefault(c => c.Type == "Contact.Fone")?.Entity;
            _agent  = entities.FirstOrDefault(c => c.Type == "Contact.Agent")?.Entity;
            _person = entities.FirstOrDefault(c => c.Type == "Contact.Person")?.Entity;


            if (string.IsNullOrEmpty(_fone))
            {
                await context.PostAsync("Qual seu fone ?");

                context.Wait(GetFone);
            }
            else
            {
                await _sendMsg.SendEmailAsync(nameCustomer : _person,
                                              subject : "Favor entrar em contato",
                                              body : $"Olá { _agent }, Pode por favor entrar em contato com { _person } no Fone { _fone } ",
                                              to : BestDestination.GetBestEmailTo(_agent));

                await context.PostAsync($"Ok, já pedi para { _agent } entrarem em contato no fone { _fone }, obrigado ");
            }
        }
Exemple #2
0
        private async Task FormCompleteCallback(IDialogContext context, IAwaitable <CaptureLead> result)
        {
            var activity = (context.Activity as Activity);

            CaptureLead order = null;

            try
            {
                order = await result;
            }
            catch (OperationCanceledException)
            {
                await context.PostAsync(KeyPassAndPhrase._OkImSorryButIamHere);

                context.Done <IMessageActivity>(null);
                return;
            }

            if (order != null)
            {
                (context.ConversationData).SetValue("User.Setting.Name", order.Name);
                (context.ConversationData).SetValue("User.Setting.Email", order.Email);



                await _email.SendEmailAsync(nameCustomer : order.Name,
                                            subject : "Oi, sou eu a ***Ian*** da Isco. Segue as informações sobre o sistema que você me solicitou",
                                            to : order.Email,
                                            replayto : KeyPassAndPhrase._emailVendas,
                                            cc : new string[] { KeyPassAndPhrase._emailVendas },
                                            bcc : new string[] { KeyPassAndPhrase._emailCopiaVendas },
                                            templateId : this.templateEmailid);

                await context.PostAsync("Ok, já enviei no seu email, se precisar pode **me perguntar também**...");

                await context.PostAsync("Ah, tentei lhe enviar um CUPOM de desconto lá, se você fechar comigo...");
            }
            else
            {
                await context.PostAsync(KeyPassAndPhrase._SometinhgWrong);
            }



            context.Done <string>(null);
        }
Exemple #3
0
        private async Task FormCompleteCallback(IDialogContext context, IAwaitable <RegisterBuy> result)
        {
            var activity = (context.Activity as Activity);

            RegisterBuy order = null;

            try
            {
                order = await result;
            }
            catch (OperationCanceledException)
            {
                await context.PostAsync("Puxa vida, que pena, se precisar estou por aqui... ;) ");

                return;
            }

            if (order != null)
            {
                (context.ConversationData).SetValue("User.Setting.Name", order.Nome);
                (context.ConversationData).SetValue("User.Setting.Email", order.Email);

                await _email.SendEmailAsync(nameCustomer : order.Nome,
                                            subject : "Nova Venda CREATELEAD",
                                            body : order.ToString(),
                                            to : KeyPassAndPhrase._emailVendas,
                                            replayto : order.Email,
                                            cc : new string[] { KeyPassAndPhrase._emailSuporte });

                await context.PostAsync("Ok, já estou criando sua base, como leva um tempinho, já aviso no seu **email** ou **telefone**, ta bom ?...");

                await context.PostAsync($"Obrigado pela confiança...{ order.Nome }");

                await context.PostAsync($" Love to help! 😍😍 ");
            }
            else
            {
                await context.PostAsync("Hum.. algo deu errado, por favor tente **novamente**");
            }

            context.Done <string>(null);
        }
Exemple #4
0
        private async Task FormCompleteCallback(IDialogContext context, IAwaitable <RegisterSuport> result)
        {
            var activity = (context.Activity as Activity);

            RegisterSuport order = null;

            try
            {
                order = await result;
            }
            catch (OperationCanceledException)
            {
                await context.PostAsync("Você cancelou, espero que conseguiu ajuda, mas se **precisar estou aqui** 😍 ");

                context.Done <string>(null);
                return;
            }

            if (order != null)
            {
                await _email.SendEmailAsync(nameCustomer : order.Name,
                                            subject : "Suporte Ténico",
                                            body : order.ToString(),
                                            to : KeyPassAndPhrase._emailSuporte,
                                            replayto : order.Email,
                                            cc : new string[] { KeyPassAndPhrase._emailSuportTicket });

                await context.PostAsync("Hum, não consegui identificar o problema, me da alguns **minutos** já resolvo para você e lhe respondo no **e-mail**, ta bom ?...");
            }
            else
            {
                await context.PostAsync("Hum.. algo deu errado, por favor tente **novamente**");
            }

            context.Done <string>(null);
        }