Notification System API | Gmail and Twilio Implementation Template

(0 reviews)

home

Underlying all IT architectures are core systems of records that are often not readily available due to its complexity and connectivity concerns. System APIs provide a means of hiding that complexity from the user while exposing data and providing downstream insulation from any interface changes or rationalization of those systems. This API provides an implementation best practice for a notification service that integrates with multiple systems like Gmail and Twilio and exposes a RESTful interface that triggers a notification.

Accelerator for Banking and Retail

This API is one of many components included in Accelerator for Banking and Accelerator for Retail. It provides organizations with connectivity assets that accelerate project delivery, including pre-built API designs and implementations that support core business processes.

The implementation.xml view in Studio for this API:

534f3649-c2b8-407d-8208-eb91a19efe75-image.png

License Agreement

This template is subject to the conditions of the MuleSoft License Agreement. Review the terms of the license before downloading and using this template. You can use this template for free with the Mule Enterprise Edition, CloudHub, or as a trial in Anypoint Studio.

Use Case

This API allows you to send notifications via email as well as text messages via Twilio based on the input JSON message.

Considerations

To get this template to run, there are preconditions to consider. Failing to do so can lead to unexpected behavior of the template.

  • APIs security considerations - Deploy this API on CloudHub and manage using Runtime Manager.

Run Stand Alone

In this section we detail the way you should run your template on your computer.

Where to Download Anypoint Studio and the Mule Runtime

If you are new to Mule, download this software:

Import Template in Studio

In Studio, click the Exchange X icon in the upper left of the taskbar, log in with your
Anypoint Platform credentials, search for the template, and click Open.

Run in Studio

After opening your template in Anypoint Studio, follow these steps to run it:

  1. Locate the properties file mule.dev.properties, in src/main/resources.
  2. Complete all the properties in the "Properties to Configure" section.
  3. Right click the template project folder.
  4. Hover your mouse over Run as.
  5. Click Mule Application (configure).
  6. Inside the dialog, select Environment and set the variable mule.env to the value dev.
  7. Click Run.

Run Stand Alone

Complete all properties in one of the property files, for example in mule.prod.properties and run your app with the corresponding environment variable to use it. To follow the example, use mule.env=prod.

Run in CloudHub

After adding your application to Runtime Manager, go to Manage Application > Properties to set the environment variables listed in the "Properties to Configure" section.

Deploy in CloudHub

In Studio, right click your project name in Package Explorer and select Anypoint Platform > Deploy on CloudHub.

Properties to Configure

To use this template you need to configure properties (credentials, configurations, etc.) either in a properties file or in Runtime Manager as Environment Variables.

Application Properties

  • http.port 8081

SMTP Services Configuration

  • smtp.host smtp.gmail.com
  • smtp.port 465
  • smtp.user your_username
  • smtp.password your_password

Twilio Services Configuration

  • twilio.phone.number +10000000000
  • twilio.account.sid dnZAVKAsDDOVMK7pHxO7
  • twilio.account.auth.token bJ5P1ELET7ibq2TAHTgB

Reviews

TypeTemplate
OrganizationMulesoft
Published by
MuleSoft Organization
Published onJun 15, 2019
Asset overview

Asset versions for 2.1.x

Asset versions
VersionActions
2.1.0

Tags