Socket
Book a DemoInstallSign in
Socket

email_center_api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

email_center_api

0.0.2
bundlerRubygems
Version published
Maintainers
1
Created
Source

EmailCenterApi

A RubyGem That wraps EmailCenter's maxemail JSON Api

see http://maxemail.emailcenteruk.com/manual/doku.php?id=maxemail:v6:webservices

Installation

Add this line to your application's Gemfile:

gem 'email_center_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install email_center_api

Usage

General configuration

require 'email_center_api'

This will load a configuration yaml file from:

'config/email_center_api.yml'

You can set a custom configuration file with:

EmailCenterApi.config_path = 'path/to/config'

The config file should contain the keys:

base_uri
username
password

Email Node Class

The 'email' tree can be queried in the following ways:

# All children elements of a node:
EmailCenterApi::Nodes::EmailNode.all(selector)

# Folders from a node:
EmailCenterApi::Nodes::EmailNode.folders(selector)

# Emails from a node:
EmailCenterApi::Nodes::EmailNode.emails(selector)

where the selector contains an optional parameter to select the parent folder in the form:

{  folder: <folder node id> }

This will return and array of EmailCenterApi::Nodes::EmailNode object.

Email Node Instance

Each email node is a folder it can be queried in the following ways:

node = EmailCenterApi::Nodes::EmailNode.all(selector).first

# All children elements of a node:
node.all

# Folders from a node:
node.folders

# Emails from a node:
node.emails

Alternatively an email node can be triggered to send an email:

node = EmailCenterApi::Nodes::EmailNode.all(selector).first

# All children elements of a node:
node.trigger(<email_address>, <options>)

Where options is a hash containing the relevant profile data for the email. See Maxemail Documentation for more details.

Email Template Node Instance

Can be used to query all templates within the tree:

EmailCenterApi::Nodes::TemplateNode.all

This returns a array of template instances which exposes name and nodeId attributes.

Contributing

  • Fork it
  • Create your feature branch (git checkout -b my-new-feature)
  • Write Some Tests
  • Write Some Code
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

FAQs

Package last updated on 08 Nov 2013

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

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.