httpNotification

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2017 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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.

type Service

type Service struct {
	// Client provides HTTP request making functionality.
	Client *apiClient.Client
}

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

func NewService added in v0.3.1

func NewService(c *apiClient.Client) *Service

NewService creates a new Service and injects notification.ErrorRegistry in the API Client.

func (Service) IsEmailOptedOut

func (s Service) 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 (Service) OptOutEmail

func (s Service) OptOutEmail(email string) error

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

func (Service) RemoveOptedOutEmail

func (s Service) RemoveOptedOutEmail(email string) error

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

func (Service) SendEmail

func (s Service) 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.

Jump to

Keyboard shortcuts

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