httpNotification

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2017 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmailAlreadySent = errorRegistry.MustAddMessageError(1000, "Email Already Sent")
)

Errors that are returned from the HTTP server.

Functions

This section is empty.

Types

type Client added in v0.5.2

type Client struct {
	*apiClient.Client
}

Client implements gopherpit.com/gopherpit/services/notification.Service interface.

func NewClient added in v0.5.2

func NewClient(c *apiClient.Client) *Client

NewClient creates a new Client.

func (Client) IsEmailOptedOut added in v0.5.2

func (c Client) IsEmailOptedOut(email string) (yes bool, err error)

IsEmailOptedOut returns true or false if e-mail address is marked not to send any e-mail messages to. Expected response body is a JSON-encoded instance of IsEmailOptedOutResponse.

func (Client) OptOutEmail added in v0.5.2

func (c Client) OptOutEmail(email string) error

OptOutEmail marks an e-mail address not to send any e-mail messages to.

func (Client) RemoveOptedOutEmail added in v0.5.2

func (c Client) RemoveOptedOutEmail(email string) error

RemoveOptedOutEmail removes an opt-out mark previosulu set by OptOutEmail.

func (Client) SendEmail added in v0.5.2

func (c Client) SendEmail(email notification.Email) (id string, err error)

SendEmail sends an e-mail message and returns it's ID. Expected response body is a JSON-encoded instance of SendEmailResponse.

type IsEmailOptedOutResponse

type IsEmailOptedOutResponse struct {
	Yes bool `json:"yes"`
}

IsEmailOptedOutResponse is expected structure of JSON-encoded response body for IsEmailOptedOut HTTP request.

type SendEmailResponse

type SendEmailResponse struct {
	ID string `json:"id"`
}

SendEmailResponse is expected structure of JSON-encoded response body for SendEmail HTTP request.

Jump to

Keyboard shortcuts

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