- Showcase Application: Provides a demonstration of the capabilities of a common service. In this case MSSC demonstrates how an application can have messaging functionality by calling an API.
- Self-Service Documentation: Provide access to documentation that enables a software developer or end user to determine it is fit for their needs, have a step by step set of instructions for implementing it, and be able to complete the implementation without direct interaction with the team that built the service the API.
- Example Code: Quite often will be told to go check out the code repository of another team who may be doing something similar. Digging through someone else's code looking for the parts that are applicable to the feature that you want to implement is a challenge to say the least. In the same way even though we may have built a showcase application, telling a development team to look at the code of the showcase application would leave them wading through a lot of unecessary code. So example code is the slimmed down bare minimum required to implement a feature, and if done right the code examples will be written in a few different language that team may likely use for that type of feature.
Showcase applications are intended to be very simple in how they are designed. The aim is to build valuable features into API endpoints called on by the showcase application.
- Check Status of the API health api endpoint
- Email Sending api end point
- Template mail merge and email sending api end point
- Template mail merge validation & preview api endpoint
- Converts xlsx or csv into a valid JSON format for CHES template endpoints
- Converts email attachments to base64 encoded
- Email form with field validation (for CHES and CMSG)
- Mail merge form with field validation
- HTML editor
- Attachment Dropzone
- Mail merge preview
- Template creation assistance with a list variables
- Keycloak login and roles
- bcgov / common-hosted-email-service
- bcgov / nr-messaging-service-showcase
- bcgov / nr-email-microservice
- Common Hosted Email Service (CHES)
**Previous implementation using WSO2, WebADE, and CMSG-Messaging-API **
- Common Hosted Email Service (CHES) Email Merge
A software development team can request access to use an application called GETOK (see Readme) to create and update the required Keycloak Client for the Common Hosted Hosted Email Service by emailing to NR.CommonServiceShowcase@gov.bc.ca.
- CHES API v1.0.0
- nr-email-microservice API Spec: This API is a wrapper over Common Messaging Services API (CMSG) v1 published at https://apistore.nrs.gov.bc.ca/store/apis/info?name=cmsg-messaging-api&version=v1
For an opinionated implementation calling a hosted api using NodeJS, Axios, Async & Await
MSSC CHES-Backend: CHES (Common Hosted Email Service) Backend is a simple node.js wrapper around the Common Hosted Email Service. The wrapper is a simple pass through to the service, its main purpose is to hide the service client credentials from the frontend.
For a microservice example
Any application can use CMSG by installing and running an instance of the nr-email-microservice which calls the API for Common Messaging Service's (CMSG). The nr-email-microservice illustrates how to call the CMSG API, and shows how a team can easily stand up their own CMSG service in OpenShift.
Your instance of nr-email-microservice will require a WebADE Service Client with appropriate CMSG scopes
A software development team can request access to use an application called GETOK (see Readme) to create and update the required WebADE Service Client for CMSG by emailing NR.CommonServiceShowcase@gov.bc.ca.
One way of using the messaging service is to run an instance of it in your own project. This documentation describes how to set it up and run it: https://bcgov.github.io/common-hosted-email-service/app/