Documentation
¶
Index ¶
- func SendAsync(e *Email) chan *SendAsyncResult
- type Attachment
- type Email
- type EndpointError
- type IncorrectAPIKeyFormatError
- type InvalidJSONError
- type MissingAPIKeyError
- type MissingRequiredFieldError
- type RequestError
- type SendAsyncResult
- type Smtp2goApiResult
- type Smtp2goApiResult_Data
- type Smtp2goApiResult_FieldFailure
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SendAsync ¶
func SendAsync(e *Email) chan *SendAsyncResult
SendAsync asynchronous send function
Types ¶
type Attachment ¶
type Attachment struct {
Filename string `json:"filename"`
Fileblob string `json:"fileblob"`
Mimetype string `json:"mimetype"`
}
Attachment struct to hold information about an attachment
type Email ¶
type Email struct {
From string `json:"sender"`
To []string `json:"to"`
Subject string `json:"subject"`
TextBody string `json:"text_body"`
HtmlBody string `json:"html_body"`
TemplateID string `json:"template_id"`
TemplateData interface{} `json:"template_data"`
Attachments []Attachment `json:"attachments"`
}
Email holds the data used to send the email
type EndpointError ¶
type EndpointError struct {
// contains filtered or unexported fields
}
EndpointError error during endpoint call
func (EndpointError) Error ¶
func (f EndpointError) Error() string
Error implementation of Error on EndpointError
type IncorrectAPIKeyFormatError ¶
type IncorrectAPIKeyFormatError struct {
// contains filtered or unexported fields
}
IncorrectAPIKeyFormatError error for bad api key
func (IncorrectAPIKeyFormatError) Error ¶
func (f IncorrectAPIKeyFormatError) Error() string
Error implementation of Error on IncorrectAPIKeyFormatError
type InvalidJSONError ¶
type InvalidJSONError struct {
// contains filtered or unexported fields
}
InvalidJSONError error due to bad json
func (InvalidJSONError) Error ¶
func (f InvalidJSONError) Error() string
Error implementation of Error on InvalidJSONError
type MissingAPIKeyError ¶
type MissingAPIKeyError string
MissingAPIKeyError error for missing api key
func (MissingAPIKeyError) Error ¶
func (f MissingAPIKeyError) Error() string
Error implementation of Error on MissingAPIKeyError
type MissingRequiredFieldError ¶
type MissingRequiredFieldError struct {
// contains filtered or unexported fields
}
MissingRequiredFieldError error fro missing field
func (MissingRequiredFieldError) Error ¶
func (f MissingRequiredFieldError) Error() string
Error implementation of Error on MissingRequiredFieldError
type RequestError ¶
type RequestError struct {
// contains filtered or unexported fields
}
RequestError error during request
func (RequestError) Error ¶
func (f RequestError) Error() string
Error implementation of Error on RequestError
type SendAsyncResult ¶
type SendAsyncResult struct {
Error error
Result *Smtp2goApiResult
}
SendAsyncResult result struct from async send call
type Smtp2goApiResult ¶
type Smtp2goApiResult struct {
RequestId string `json:"request_id"`
Data Smtp2goApiResult_Data `json:"data"`
}
Smtp2goApiResult response payload from the API
type Smtp2goApiResult_Data ¶
type Smtp2goApiResult_Data struct {
Error string `json:"error"`
ErrorCode string `json:"error_code"`
FieldValidationErrors Smtp2goApiResult_FieldFailure `json:"field_validation_errors"`
}
Smtp2goApiResult_Data struct that holds the response data from the API
type Smtp2goApiResult_FieldFailure ¶
type Smtp2goApiResult_FieldFailure struct {
FieldName string `json:"fieldname"`
Message string `json:"message"`
}
Smtp2goApiResult_FieldFailure if fields failed on the api side this will hold the information