Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

smartnotify2

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smartnotify2

  • 0.4.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

SmartNotify

Ruby Gem designed for sending various types of notifications via a common configurable interface.

Overview

The gem makes use of two components, modules, and templates.

Modules are defined within this gem, and provide various forms of generic notification functionality. The modules are created to be reusable. A module could be responsible for sending emails, posting Slack notifications, making a REST call to an external API, whatever.

Templates on the other hand, consume a specific module, in conjunction with template specific configuration, creating very specific use cases. These use cases could be team specific, allowing different consumers to tweak who, and how notifications are distributed.

Why

There was a need to easily send SLA incident emails to the correct person on support, as well as to a MS Teams channel. A module was created rotation_emailer which could send emails, based on a given email template, and support rotation csv file. With that in place, a template was created incident_start_email which defines where the specific email template, and support rotation csv file is located for this particular instance. This is awesome, because a new team or solution could create a template, changing only the support rotation csv location, and get the same functionality for next to no setup cost.

Usage

Add smartnotify to your Gemfile, pointing at GitHub.

gem 'smartnotify', git: 'https://github.cerner.com/PHPerfImp/smartnotify.git', branch: 'master'

Within your code add:

 require 'smartnotify'
 # ... your logic ...
 smartnotify = SmartNotify.new
 smartnotify.run(template, json, [debug], [dryrun])

*Note: when updates are made to the gem in github, bundle update & bundle install must be run to pull in the changes.

ParamTypeRequirementDefaultDescription
templateStringRequiredThe id of the template to use. The templates are configured externally in PHPerfImp/smartnotify-config
jsonStringRequiredThe JSON key/value pairs to be used as input to the selected template. Each template defines what keys must be provided.
environmentStringOptionalproductionThe id of the environment configuration to use. Choices are local, development, staging, and production.
debugBooleanOptionalfalseEnables debug logging within SmartNotify.
dryrunBooleanOptionalfalseEnables debug logging within SmartNotify, and disables sending any notifications for testing purposes.

Example

smartnotify = SmartNotify.new
smartnotify.run('incident_start_email', "{\"mnemonic\": \"sbmcin\", \"cerner_mnemonic\": \"UNVR_NY\", \"link\": \"https://jira2.cerner.com/browse/PERFIMPDEV-1349\", \"title\": \"Readmission SLA Exceeded\", \"message\": \"Readmission SLA exceeded, please check the JIRA for more information.\"}", 'production')

Modules

The following are the currently available modules that can be consumed. Follow the link to get more information on intended usage, and configuration.

Releasing New Version

*N/A - As long as we are using our internal GitHub for storage of the gem, there is no need to 'release' a new version. Using a different version of the branch can be achieved by pointing the Gemfile reference at a different ref. See http://bundler.io/v1.12/git.html for more information.

FAQs

Package last updated on 23 Jun 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc