Documentation ¶
Index ¶
- Constants
- type CalendarMail
- type CommonMail
- type ErrorResponse
- type Filter
- type FilterSettings
- type MailBody
- func (e *MailBody) AddAttachment(attachment *os.File)
- func (e *MailBody) AddHeaders(headers map[string]string)
- func (e *MailBody) PrepareMailBodyParams(params *url.Values)
- func (e *MailBody) SetContentSummary(contentSummary string)
- func (e *MailBody) SetFrom(from string)
- func (e *MailBody) SetFromName(fromName string)
- func (e *MailBody) SetLabelName(labelName string)
- func (e *MailBody) SetReplyTo(replyTo string)
- func (e *MailBody) SetXsmtpapi(xsmtpapi XSMTPAPI)
- type MailCalendar
- func (e *MailCalendar) PrepareMailCalendarParams(params *url.Values)
- func (e *MailCalendar) SetDescription(description string)
- func (e *MailCalendar) SetEndTime(endTime time.Time)
- func (e *MailCalendar) SetIsCancel(isCancel bool)
- func (e *MailCalendar) SetIsUpdate(isUpdate bool)
- func (e *MailCalendar) SetLocation(location string)
- func (e *MailCalendar) SetOrganizerEmail(organizerEmail string)
- func (e *MailCalendar) SetOrganizerName(organizerName string)
- func (e *MailCalendar) SetParticipatorEmails(participatorEmails string)
- func (e *MailCalendar) SetParticipatorNames(participatorNames string)
- func (e *MailCalendar) SetStartTime(startTime time.Time)
- func (e *MailCalendar) SetTitle(title string)
- func (e *MailCalendar) SetUID(uid string)
- func (e *MailCalendar) SetValarmTime(valarmTime int)
- type MailReceiver
- type Response
- type SendCloud
- func (client *SendCloud) MultipartSendCalendarMail(e *CalendarMail) (*multipart.Writer, *bytes.Buffer, error)
- func (client *SendCloud) MultipartSendCommonMail(e *CommonMail) (*multipart.Writer, *bytes.Buffer, error)
- func (client *SendCloud) MultipartSendTemplateEmail(e *TemplateMail) (*multipart.Writer, *bytes.Buffer, error)
- func (client *SendCloud) PrepareReceiverParams(e *MailReceiver) url.Values
- func (client *SendCloud) PrepareSendCalendarMailParams(e *CalendarMail) url.Values
- func (client *SendCloud) PrepareSendCommonEmailParams(e *CommonMail) url.Values
- func (client *SendCloud) PrepareSendTemplateEmailParams(e *TemplateMail) url.Values
- func (client *SendCloud) SendCalendarMail(ctx context.Context, args *CalendarMail) (*SendEmailResult, error)
- func (client *SendCloud) SendCommonEmail(ctx context.Context, args *CommonMail) (*SendEmailResult, error)
- func (client *SendCloud) SendTemplateEmail(ctx context.Context, args *TemplateMail) (*SendEmailResult, error)
- type SendEmailResult
- type Settings
- type TemplateContent
- type TemplateMail
- type TextContent
- type TrackingFilter
- type UnsubscribeSettings
- type XSMTPAPI
Constants ¶
const (
APIBase = "https://api.sendcloud.net/apiv2/mail"
)
const MAX_MAILLIST = 5
const MAX_RECEIVERS = 100
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CalendarMail ¶
type CalendarMail struct { Receiver MailReceiver Body MailBody Content TextContent Calendar MailCalendar }
type CommonMail ¶
type CommonMail struct { Receiver MailReceiver Body MailBody Content TextContent }
type ErrorResponse ¶
type ErrorResponse struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type Filter ¶
type Filter struct { SubscriptionTracking TrackingFilter `json:"subscription_tracking"` OpenTracking TrackingFilter `json:"open_tracking"` ClickTracking TrackingFilter `json:"click_tracking"` }
func (Filter) ValidateFilter ¶
type FilterSettings ¶
type FilterSettings struct {
Enable string `json:"enable"`
}
type MailBody ¶
type MailBody struct { From string Subject string ContentSummary string FromName string ReplyTo string LabelName string Headers map[string]string Attachments []*os.File Xsmtpapi XSMTPAPI SendRequestID string RespEmailID bool UseNotification bool }
func (*MailBody) AddAttachment ¶
AddAttachment - Add an attachment content.
func (*MailBody) AddHeaders ¶
AddHeaders - Add the headers of the email.
func (*MailBody) PrepareMailBodyParams ¶
func (*MailBody) SetContentSummary ¶
SetContentSummary - Set the content summary of the email.
func (*MailBody) SetFromName ¶
SetFromName - Set the from name of the email.
func (*MailBody) SetLabelName ¶
SetLabelName - Set the label name of the email.
func (*MailBody) SetReplyTo ¶
SetReplyTo - Set the reply to address.
func (*MailBody) SetXsmtpapi ¶
SetXsmtpapi - Set the xsmtpapi of the email.
type MailCalendar ¶
type MailCalendar struct { StartTime time.Time EndTime time.Time Title string OrganizerName string OrganizerEmail string Location string Description string ParticipatorNames string ParticipatorEmails string UID string IsCancel bool IsUpdate bool ValarmTime int }
func (*MailCalendar) PrepareMailCalendarParams ¶
func (e *MailCalendar) PrepareMailCalendarParams(params *url.Values)
func (*MailCalendar) SetDescription ¶
func (e *MailCalendar) SetDescription(description string)
SetDescription - Set the description of the calendar.
func (*MailCalendar) SetEndTime ¶
func (e *MailCalendar) SetEndTime(endTime time.Time)
SetEndTime - Set the end time of the calendar.
func (*MailCalendar) SetIsCancel ¶
func (e *MailCalendar) SetIsCancel(isCancel bool)
SetIsCancel - Set the isCancel of the calendar.
func (*MailCalendar) SetIsUpdate ¶
func (e *MailCalendar) SetIsUpdate(isUpdate bool)
SetIsUpdate - Set the isUpdate of the calendar.
func (*MailCalendar) SetLocation ¶
func (e *MailCalendar) SetLocation(location string)
SetLocation - Set the location of the calendar.
func (*MailCalendar) SetOrganizerEmail ¶
func (e *MailCalendar) SetOrganizerEmail(organizerEmail string)
SetOrganizerEmail - Set the organizer email of the calendar.
func (*MailCalendar) SetOrganizerName ¶
func (e *MailCalendar) SetOrganizerName(organizerName string)
SetOrganizerName - Set the organizer name of the calendar.
func (*MailCalendar) SetParticipatorEmails ¶
func (e *MailCalendar) SetParticipatorEmails(participatorEmails string)
SetParticipatorEmails - Set the participator emails of the calendar.
func (*MailCalendar) SetParticipatorNames ¶
func (e *MailCalendar) SetParticipatorNames(participatorNames string)
SetParticipatorNames - Set the participator names of the calendar.
func (*MailCalendar) SetStartTime ¶
func (e *MailCalendar) SetStartTime(startTime time.Time)
SetStartTime - Set the start time of the calendar.
func (*MailCalendar) SetTitle ¶
func (e *MailCalendar) SetTitle(title string)
SetTitle - Set the title of the calendar.
func (*MailCalendar) SetUID ¶
func (e *MailCalendar) SetUID(uid string)
SetUID - Set the UID of the calendar.
func (*MailCalendar) SetValarmTime ¶
func (e *MailCalendar) SetValarmTime(valarmTime int)
SetValarmTime - Set the valarmTime of the calendar.
type SendCloud ¶
type SendCloud struct {
// contains filtered or unexported fields
}
func (*SendCloud) MultipartSendCalendarMail ¶
func (*SendCloud) MultipartSendCommonMail ¶
func (*SendCloud) MultipartSendTemplateEmail ¶
func (*SendCloud) PrepareReceiverParams ¶
func (client *SendCloud) PrepareReceiverParams(e *MailReceiver) url.Values
func (*SendCloud) PrepareSendCalendarMailParams ¶
func (client *SendCloud) PrepareSendCalendarMailParams(e *CalendarMail) url.Values
func (*SendCloud) PrepareSendCommonEmailParams ¶
func (client *SendCloud) PrepareSendCommonEmailParams(e *CommonMail) url.Values
func (*SendCloud) PrepareSendTemplateEmailParams ¶
func (client *SendCloud) PrepareSendTemplateEmailParams(e *TemplateMail) url.Values
func (*SendCloud) SendCalendarMail ¶
func (client *SendCloud) SendCalendarMail(ctx context.Context, args *CalendarMail) (*SendEmailResult, error)
func (*SendCloud) SendCommonEmail ¶
func (client *SendCloud) SendCommonEmail(ctx context.Context, args *CommonMail) (*SendEmailResult, error)
func (*SendCloud) SendTemplateEmail ¶
func (client *SendCloud) SendTemplateEmail(ctx context.Context, args *TemplateMail) (*SendEmailResult, error)
type SendEmailResult ¶
type Settings ¶
type Settings struct {
Unsubscribe UnsubscribeSettings `json:"unsubscribe"`
}
Settings 表示设置的结构体
type TemplateContent ¶
type TemplateContent struct {
TemplateInvokeName string
}
func (*TemplateContent) SetTemplateInvokeName ¶
func (e *TemplateContent) SetTemplateInvokeName(name string)
SetTemplateInvokeName - Set the template invoke name.
type TemplateMail ¶
type TemplateMail struct { Receiver MailReceiver Body MailBody Content TemplateContent }
type TextContent ¶
func (*TextContent) SetHTML ¶
func (e *TextContent) SetHTML(html string)
SetHTML - Set the html content of the email, required if not using a template.
func (*TextContent) SetPlain ¶
func (e *TextContent) SetPlain(plain string)
SetPlain - Set the plain content of the email, required if not using a template.
type TrackingFilter ¶
type TrackingFilter struct {
Settings FilterSettings `json:"settings"`
}
type UnsubscribeSettings ¶
type UnsubscribeSettings struct {
PageID []int `json:"page_id"`
}
UnsubscribeSettings 表示退订设置的结构体