twiliobee

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 12, 2020 License: AGPL-3.0 Imports: 2 Imported by: 4

README

Twilio bee

The Twilio bee can send SMS messages to a phone.

Configuration

Options
"Bees": [
  {
    "Name":"Twilio Example Bee",
    "Class":"twiliobee",
    "Description":"A bee to demonstrate Twilio with Beehive",
    "Options":[
      {
        "Name": "account_sid",
        "Value": "YOUR_TWILIO_ACCOUNT_SID"
      },
      {
        "Name": "auth_token",
        "Value": "YOUR_TWILIO_AUTH_TOKEN"
      },
      {
        "Name": "from_number",
        "Value": "+15551234567"
      },
      {
        "Name": "to_number",
        "Value": "+15559876543"
      }
    ]
  }
]

account_sid and auth_token: Twilio Account SID and Authentication Token. You can sign up and get them from https://www.twilio.com/try-twilio.

These can be added to the recipe/config as-is (XXXXXXXX), via environment variable (env://MY_ACCOUNT_SID) or read from a file (file:///home/james//.twilio_config).

from_number: Your Twilio phone number. Must be in the format +15558675309.

to_number: The phone number to send an SMS message to.

Actions

send: send an SMS message. Needs the body of the message to send. You can use interpolation to send somthing from the event received:

"Actions": [
  {
    "Bee":"Twilio Example Bee",
    "Name":"send",
    "Options":[
      {
        "Name":"body",
        "Value":"Example body with interpolation: {{.something_from_event}}"
      }
    ]
  }
]

Credits

Twilio logo: https://www.twilio.com/press

Documentation

Overview

Package twiliobee is a Bee that is able to send SMS messages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TwilioBee

type TwilioBee struct {
	bees.Bee
	// contains filtered or unexported fields
}

TwilioBee is a Bee that is able to send SMS messages.

func (*TwilioBee) Action

func (mod *TwilioBee) Action(action bees.Action) []bees.Placeholder

Action triggers the action passed to it.

func (*TwilioBee) ReloadOptions

func (mod *TwilioBee) ReloadOptions(options bees.BeeOptions)

ReloadOptions parses the config options and initializes the Bee.

func (*TwilioBee) Run

func (mod *TwilioBee) Run(eventChan chan bees.Event)

Run executes the Bee's event loop.

type TwilioBeeFactory

type TwilioBeeFactory struct {
	bees.BeeFactory
}

TwilioBeeFactory is a factory for TwilioBees.

func (*TwilioBeeFactory) Actions

func (factory *TwilioBeeFactory) Actions() []bees.ActionDescriptor

Actions describes the available actions provided by this Bee.

func (*TwilioBeeFactory) Description

func (factory *TwilioBeeFactory) Description() string

Description returns the description of this Bee.

func (*TwilioBeeFactory) ID

func (factory *TwilioBeeFactory) ID() string

ID returns the ID of this Bee.

func (*TwilioBeeFactory) Image

func (factory *TwilioBeeFactory) Image() string

Image returns the filename of an image for this Bee.

func (*TwilioBeeFactory) LogoColor

func (factory *TwilioBeeFactory) LogoColor() string

LogoColor returns the preferred logo background color (used by the admin interface).

func (*TwilioBeeFactory) Name

func (factory *TwilioBeeFactory) Name() string

Name returns the name of this Bee.

func (*TwilioBeeFactory) New

func (factory *TwilioBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface

New returns a new Bee instance configured with the supplied options.

func (*TwilioBeeFactory) Options

func (factory *TwilioBeeFactory) Options() []bees.BeeOptionDescriptor

Options returns the options available to configure this Bee.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL