Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
185 changes: 185 additions & 0 deletions independent-publisher-connectors/Enveloop/apiDefinition.swagger.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,185 @@
{
"swagger": "2.0",
"info": {
"title": "Enveloop",
"description": "Enveloop is a high-visibility content management UI & editor for all your email and text messaging. Not only can you create and manage all your email message designs in Enveloop, you can do the same for all your SMS / MMS messages and send those from Enveloop as well. Enveloop includes useful templates to get started fast. Plus, with one-click test messaging, a powerful sandbox environment, and all types of code snippets included, sending your messages is practically effortless!",
"version": "1.0",
"contact": {
"name": "Troy Taylor",
"url": "https://www.hitachisolutions.com",
"email": "ttaylor@hitachisolutions.com"
}
},
"host": "api.enveloop.com",
"basePath": "/",
"schemes": [
"https"
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/messages": {
"post": {
"responses": {
"201": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"messageId": {
"type": "string",
"description": "The message identifier.",
"title": "Message ID"
},
"from": {
"type": "string",
"description": "The From address.",
"title": "From"
},
"to": {
"type": "string",
"description": "The To address.",
"title": "To"
},
"body": {
"type": "string",
"description": "The message body.",
"title": "Body"
}
}
}
}
},
"summary": "Send message",
"description": "Send messages to recipients.",
"operationId": "MessagePost",
"parameters": [
{
"name": "body",
"in": "body",
"required": false,
"schema": {
"type": "object",
"properties": {
"template": {
"type": "string",
"description": "The template name.",
"title": "Template Name"
},
"to": {
"type": "string",
"description": "The To address.",
"title": "To"
},
"from": {
"type": "string",
"description": "The From address.",
"title": "From"
},
"subject": {
"type": "string",
"description": "The message subject.",
"title": "Subject"
},
"templateVariables": {
"type": "array",
"items": {
"type": "object",
"properties": {
"variableName": {
"type": "string",
"description": "The variable name.",
"title": "Name"
},
"variableValue": {
"type": "string",
"description": "The variable value.",
"title": "Value"
}
}
},
"title": "Template Variables"
}
}
}
}
]
}
},
"/templates/{templateName}": {
"get": {
"responses": {
"200": {
"description": "default",
"schema": {
"type": "object",
"properties": {
"templateVariables": {
"type": "array",
"items": {
"type": "string"
},
"description": "The template variables.",
"title": "Template Variables"
},
"body": {
"type": "string",
"description": "The message body.",
"title": "Body"
}
}
}
}
},
"summary": "Get template",
"description": "Retrieve the information about a template including the body of the template and any user defined variables that the template expects.",
"operationId": "TemplateGet",
"parameters": [
{
"name": "templateName",
"in": "path",
"x-ms-summary": "Template Name",
"x-ms-url-encoding": "single",
"description": "The template name.",
"required": true,
"type": "string"
}
]
}
}
},
"definitions": {},
"parameters": {},
"responses": {},
"securityDefinitions": {
"Token (in the form 'token YOUR_TOKEN')": {
"type": "apiKey",
"in": "header",
"name": "Authorization"
}
},
"security": [
{
"Token (in the form 'token YOUR_TOKEN')": []
}
],
"tags": [],
"x-ms-connector-metadata": [
{
"propertyName": "Website",
"propertyValue": "https://www.enveloop.com/"
},
{
"propertyName": "Privacy policy",
"propertyValue": "https://docs.enveloop.com/company/privacy-policy"
},
{
"propertyName": "Categories",
"propertyValue": "Communication;Marketing"
}
]
}
27 changes: 27 additions & 0 deletions independent-publisher-connectors/Enveloop/apiProperties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"properties": {
"connectionParameters": {
"api_key": {
"type": "securestring",
"uiDefinition": {
"displayName": "Token (in the form 'token YOUR_TOKEN')",
"description": "The Token (in the form 'token YOUR_TOKEN') for this api",
"tooltip": "Provide your Token (in the form 'token YOUR_TOKEN')",
"constraints": {
"tabIndex": 2,
"clearText": false,
"required": "true"
}
}
}
},
"iconBrandColor": "#da3b01",
"scriptOperations": [
"MessagePost"
],
"capabilities": [],
"policyTemplateInstances": [],
"publisher": "Troy Taylor",
"stackOwner": "Enveloop"
}
}
19 changes: 19 additions & 0 deletions independent-publisher-connectors/Enveloop/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Enveloop
Enveloop is a high-visibility content management UI & editor for all your email and text messaging. Not only can you create and manage all your email message designs in Enveloop, you can do the same for all your SMS / MMS messages and send those from Enveloop as well. Enveloop includes useful templates to get started fast. Plus, with one-click test messaging, a powerful sandbox environment, and all types of code snippets included, sending your messages is practically effortless!

## Publisher: Troy Taylor, Hitachi Solutions

## Prerequisites
You will need to sign up for an account with [Enveloop](https://app.enveloop.com/).

## Obtaining Credentials
Once logged in to your account, find the Settings page for your project to receive your Production and Test tokens.

## Supported Operations
### Send message
Send messages to recipients.
### Get template
Retrieve the information about a template including the body of the template and any user defined variables that the template expects.

## Known Issues and Limitations
There are no known issues at this time.
35 changes: 35 additions & 0 deletions independent-publisher-connectors/Enveloop/script.csx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
public class Script : ScriptBase
{
public override async Task<HttpResponseMessage> ExecuteAsync()
{
var requestContentAsString = await this.Context.Request.Content.ReadAsStringAsync().ConfigureAwait(false);
var requestContentAsObject = JObject.Parse(requestContentAsString);

var templateVariables = (JArray)requestContentAsObject["templateVariables"];

var data = new JArray();

foreach (var item in templateVariables)
{
var name = (string)item["variableName"];
var value = (string)item["variableValue"];

var obj = new JObject();
obj[name] = value;

data.Add(obj);
}

requestContentAsObject["templateVariables"] = data;

using (var stringWriter = new StringWriter())
{
JsonSerializer.CreateDefault().Serialize(stringWriter, requestContentAsObject);
var json = stringWriter.ToString();
this.Context.Request.Content = new StringContent(json, Encoding.UTF8, "application/json");
}

var response = await this.Context.SendAsync(this.Context.Request, this.CancellationToken).ConfigureAwait(false);
return response;
}
}