Skip to main content

Working with Twilio

Email channel support in Twilio

As per Twilio documentation, we can bring email as a channel and leverage Task Routing capabilities easily as long as we can create a task and programmatically interact with the email service. They recommended an email service provider with REST API (like SendGrid) capabilities because of ease of use. However, we can use any Email provider for this purpose.

Gmail-based email channel support

Let's assume our support email is hosted on Gmail and we have a Flex-based contact support system in place where Agents handle chat and voice-based support. Now we want to extend our chat interface to handle email-based support conversations. 

We will build a worker service using Gmail API that will listen to new emails. Once a new email arrives, we will use Twilio SDK to create a new channel and task. Once an agent accepts the task and they can respond to the customer's queries. Agent response will be further emailed to the customer using Gmail API.


Comments

Post a Comment

Popular posts from this blog

Working with request header in Jersey (JAX-RS) guide

In the  previous post , we talked about, how to get parameters and their values from the request query string. In this guide learn how to get request header values in Jersey (JAX-RS) based application. We had tested or used the following tools and technologies in this project: Jersey (v 2.21) Gradle Build System (v 2.9) Spring Boot (v 1.3) Java (v 1.8) Eclipse IDE This is a part of  Jersey (JAX-RS) Restful Web Services Development Guides series. Please read Jersey + Spring Boot getting started guide . Gradle Build File We are using Gradle for our build and dependency management (Using Maven rather than Gradle is a very trivial task). File: build.gradle buildscript { ext { springBootVersion = '1.3.0.RELEASE' } repositories { mavenCentral() } dependencies { classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}") } } apply plugin: 'java' apply plugin: 'eclipse' a

FastAPI first shot

Setup on my Mac (Macbook Pro 15 inch Retina, Mid 2014) Prerequisite Python 3.6+ (I used 3.7.x. I recently reinstalled OS after cleaning up disk, where stock Python 2.7 was available. I installed Pyenv and then used it to install 3.7.x). I already had a git repo initialized at Github for this project. I checked that out. I use this approach to keep all the source code safe or at a specific place 😀. I set the Python version in .python-version file. I also initialize the virtual environment using pyenv in venv folder. I started the virtual environment. FastAPI specific dependencies setup Now I started with basic pip commands to install dependency for the project. I saved dependencies in requirements.txt  the file. Minimal viable code to spin an API Server FastAPI is as cool as NodeJS or Go Lang (?) to demonstrate the ability to spin an API endpoint up and running in no time. I had the same feeling for the Flask too, which was also super cool. app/main.py: from typing i

Jersey (JAX-RS) @FormParam HTML form data handling

There are multiple ways for consuming HTML form data (application/x-www-form-urlencoded) in Jersey. Using @FormParam annotation we can inject Form values in the Resource method. We can use it just like other @*Param. Jersey resource method needs to know they have to handle HTML form data, for it we explicitly specify  @Consumes("application/x-www-form-urlencoded") . There are multiple ways in which we can handle HTML form data using Jersey. Injecting Form data using @FormParam is one of them. Use @FormParam Using @FormParam we can inject specific HTML form parameters values in the Resource method. Its use is similar to other @*Param annotations. File: FormParamResource.java package in.geekmj.resource; import javax.ws.rs.Consumes; import javax.ws.rs.FormParam; import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.Produces; import javax.ws.rs.core.Context; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.MultivaluedMap; import javax.ws.rs.core.R