Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EmailAlreadySent = NewError(1000, "email already sent")
)
Errors that are related to the Notification Service.
View Source
var ( // ErrorRegistry is a map of error codes to errors. // It is usually used in gopherpit.com/gopherpit/pkg/client.Client. ErrorRegistry = apiClient.NewMapErrorRegistry(nil) )
Functions ¶
This section is empty.
Types ¶
type Email ¶
type Email struct {
From string `json:"from"`
To []string `json:"to"`
CC []string `json:"cc"`
BCC []string `json:"bcc"`
ReplyTo string `json:"reply-to"`
Subject string `json:"subject"`
Body string `json:"body"`
HTML string `json:"html"`
CheckSent bool `json:"check-sent"`
}
Email represents an e-mail message.
type Error ¶
type Error struct {
// Message is a text that describes an error.
Message string `json:"message"`
// Code is a number that identifies error.
// It allows error identification when serialization is involved.
Code int `json:"code"`
}
Error is a structure that holds error message and code.
type Service ¶
type Service interface {
// SendEmail sends an e-mail message and returns it's ID.
SendEmail(email Email) (id string, err error)
// IsEmailOptedOut returns true or false if e-mail address
// is marked not to send any e-mail messages to.
IsEmailOptedOut(email string) (yes bool, err error)
// OptOutEmail marks an e-mail address not to send any e-mail messages to.
OptOutEmail(email string) (err error)
// RemoveOptedOutEmail removes an opt-out mark previosulu set by
// OptOutEmail.
RemoveOptedOutEmail(email string) (err error)
}
Service defines functions that Notification Service must implement.
Click to show internal directories.
Click to hide internal directories.