mailgun

package module
v0.0.0-...-8c17a97 Latest Latest
Warning

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

Go to latest
Published: May 28, 2018 License: MIT Imports: 4 Imported by: 0

README

A Go interface to the mailgun API.

This package contains a client for the mailgun REST API, all endpoints categories are implemented (including webhooks) and most operations and parameters have corresponding types, functions and methods.

Prerequisite

Some knowledge of the mailgun API is helpful. Some of the package design and expression of endpoints is easier to understand with reference to the API.

Install

go get github.com/j7b/mailgun

Usage

See godoc. Most user code probably only needs the client Send method, that sends a simple HTML email. More sophisticated mailing, with attachments, custom headers, and variables is possible with the message package.

A http.Handler that dispatches webhooks and lower-level facilities are in the corresponding package.

Versioning

Commits to master are releases. Compatability with previous releases will be in the spirit of the Go 1 compatability document.

Contributing

Bug reports are welcome. Feature requests are likely to conflict with design decisions and other considerations or be out of the scope of an API client. Accepted PR's must follow the conventions of existing packages, must not patch generated code, any corresponding mailgun API facilities must be published in the API documentation and not noted as deprecated or obsolete, and the PR author must open an issue first.

License

MIT

Documentation

Overview

Package mailgun consumes the mailgun API.

The client has simple methods for common operations. More sophisticated operations and types allowing fine-grained control are found in subdirectories of this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	client.Caller
}

Client is a mailgun client.

func New

func New(apikey, domain string) (*Client, error)

New returns a Client for apikey and domain. If apikey is zero-length, attempts to use environment variable MAILGUN_KEY, failing that returns error. If domain is zero-length, attempts to use environment variable MAILGUN_DOMAIN, failing that returns error.

func (*Client) Send

func (c *Client) Send(from, subject, html string, to ...string) (id string, err error)

Send sends an HTML email, returning id.

Directories

Path Synopsis
Package client is a low-level implementation of a mailgun REST client.
Package client is a low-level implementation of a mailgun REST client.
mock
Package mock implements a mock client for testing.
Package mock implements a mock client for testing.
pager
Package pager implements the mailgun paging convention.
Package pager implements the mailgun paging convention.
Package domain implements domain-related types and methods.
Package domain implements domain-related types and methods.
connection
Package connection implements domain connection parameters.
Package connection implements domain connection parameters.
credentials
Package credentials implements domain credentials.
Package credentials implements domain credentials.
tracking
Package tracking implements domain tracking settings.
Package tracking implements domain tracking settings.
Package event implements event querying.
Package event implements event querying.
types
Package types contains event types.
Package types contains event types.
Package ips implements IP management.
Package ips implements IP management.
Package list implements the mailing list endpoint.
Package list implements the mailing list endpoint.
member
Package member implements membership of mailing lists.
Package member implements membership of mailing lists.
Package message implements the mailgun message convention.
Package message implements the mailgun message convention.
batch
Package batch implements the batch mailing convention.
Package batch implements the batch mailing convention.
Package stats implements the stats/total endpoint.
Package stats implements the stats/total endpoint.
types
Package types contains stats types.
Package types contains stats types.
Package suppression contains interfaces to suppression lists.
Package suppression contains interfaces to suppression lists.
bounce
Package bounce implements bounce endpoints.
Package bounce implements bounce endpoints.
complaint
Package complaint implements complaint endpoints.
Package complaint implements complaint endpoints.
unsubscribe
Package unsubscribe implements unsubscribe endpoints.
Package unsubscribe implements unsubscribe endpoints.
Package tags contains types and implementations related to message tags.
Package tags contains types and implementations related to message tags.
Package webhook implements webhook API endpoints.
Package webhook implements webhook API endpoints.
handler
Package handler implements types for webhook consumption.
Package handler implements types for webhook consumption.
types
Package types defines webhook types.
Package types defines webhook types.

Jump to

Keyboard shortcuts

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