Ejemplo n.º 1
0
        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 ");
            }
        }
Ejemplo n.º 2
0
        private async Task GetFone(IDialogContext context, IAwaitable <IMessageActivity> value)
        {
            var fone = await value;
            await _sendMsg.SendEmailAsync(nameCustomer : _person,
                                          subject : "Favor entrar em contato",
                                          body : $"Olá { _agent }, Pode por favor entrar em contato com { _person } no Fone { fone.Text } ",
                                          to : BestDestination.GetBestEmailTo(_agent));

            await context.PostAsync($"Ok, já pedi para { _agent } entrarem em contato no fone { fone.Text }, obrigado ");

            context.Wait(MessageReceived);
        }