sevenbee

package module
v0.0.0-...-929eeab Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2023 License: MIT Imports: 2 Imported by: 0

README

seven for Beehive

Send SMS message(s) to phone number(s).

Installation

  1. Fetch the package by running go get github.com/seven-io/beehive
  2. Add "github.com/seven-io/beehive" to import in hives.go
  3. Download module dependencies by running go mod download
  4. Recompile the binary by running make
Configuration
{
  "Bees": [
    {
      "Name": "seven SMS Example Bee",
      "Class": "sevenbee",
      "Description": "A bee to demonstrate seven with Beehive",
      "Options": [
        {
          "Name": "api_key",
          "Value": "YOUR_SEVEN_API_KEY"
        },
        {
          "Name": "from",
          "Value": "+490123456789"
        },
        {
          "Name": "to",
          "Value": "+490123456789,+456789012345"
        }
      ]
    }
  ]
}

api_key: seven API key. Sign up and get one for free from seven.

from: Sender number. It may contain a maximum of 11 alphanumeric or 16 numeric characters.

to_number: Recipient number – possible are numbers and address book entries (groups and contacts). Multiple recipients can be specified separated by commas.

Actions

sms: Send SMS message(s). Needs the text of the message to send. You can use interpolation to send somthing from the event received:

{
  "Actions": [
    {
      "Bee": "seven SMS Example Bee",
      "Name": "sms",
      "Options": [
        {
          "Name": "text",
          "Type": "string",
          "Value": "The current time is {{.timestamp}}"
        }
      ]
    }
  ]
}
Support

Need help? Feel free to contact us.

MIT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SevenBee

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

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

func (*SevenBee) Action

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

Action triggers the action passed to it.

func (*SevenBee) ReloadOptions

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

ReloadOptions parses the config options and initializes the Bee.

func (*SevenBee) Run

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

Run executes the Bee's event loop.

type SevenBeeFactory

type SevenBeeFactory struct {
	bees.BeeFactory
}

func (*SevenBeeFactory) Actions

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

Actions describes the available actions provided by this Bee.

func (*SevenBeeFactory) Description

func (factory *SevenBeeFactory) Description() string

Description returns the description of this Bee.

func (*SevenBeeFactory) ID

func (factory *SevenBeeFactory) ID() string

ID returns the ID of this Bee.

func (*SevenBeeFactory) Image

func (factory *SevenBeeFactory) Image() string

Image returns the filename of an image for this Bee.

func (*SevenBeeFactory) LogoColor

func (factory *SevenBeeFactory) LogoColor() string

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

func (*SevenBeeFactory) Name

func (factory *SevenBeeFactory) Name() string

Name returns the name of this Bee.

func (*SevenBeeFactory) New

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

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

func (*SevenBeeFactory) Options

func (factory *SevenBeeFactory) 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