Documentation ¶
Index ¶
- Constants
- func Bool(v bool) *bool
- func CheckResponse(r *http.Response) error
- func Int(v int) *int
- func Int64(v int64) *int64
- func String(v string) *string
- type ActivityOptions
- type ActivityService
- type AnalyticsOptions
- type AnalyticsService
- func (s *AnalyticsService) GetActivityByDate(ctx context.Context, options *AnalyticsOptions) (*analyticsActivityRoot, *Response, error)
- func (s *AnalyticsService) GetOpensByCountry(ctx context.Context, options *AnalyticsOptions) (*opensRoot, *Response, error)
- func (s *AnalyticsService) GetOpensByReadingEnvironment(ctx context.Context, options *AnalyticsOptions) (*opensRoot, *Response, error)
- func (s *AnalyticsService) GetOpensByUserAgent(ctx context.Context, options *AnalyticsOptions) (*opensRoot, *Response, error)
- type ApiQuotaService
- type Attachment
- type AuthError
- type BulkEmailService
- type CatchFilter
- type CreateDomainOptions
- type CreateEmailVerificationOptions
- type CreateIdentityOptions
- type CreateInboundOptions
- type CreateSmsInboundOptions
- type CreateSmsWebhookOptions
- type CreateSuppressionBlockOptions
- type CreateSuppressionOptions
- type CreateTokenOptions
- type CreateWebhookOptions
- type CustomTracking
- type DeleteSuppressionOptions
- type Dkim
- type Domain
- type DomainService
- func (s *DomainService) Create(ctx context.Context, options *CreateDomainOptions) (*singleDomainRoot, *Response, error)
- func (s *DomainService) Delete(ctx context.Context, domainID string) (*Response, error)
- func (s *DomainService) Get(ctx context.Context, domainID string) (*singleDomainRoot, *Response, error)
- func (s *DomainService) GetDNS(ctx context.Context, domainID string) (*dnsRoot, *Response, error)
- func (s *DomainService) GetRecipients(ctx context.Context, options *GetRecipientsOptions) (*domainRecipientRoot, *Response, error)
- func (s *DomainService) List(ctx context.Context, options *ListDomainOptions) (*domainRoot, *Response, error)
- func (s *DomainService) Update(ctx context.Context, options *DomainSettingOptions) (*singleDomainRoot, *Response, error)
- func (s *DomainService) Verify(ctx context.Context, domainID string) (*verifyRoot, *Response, error)
- type DomainSettingOptions
- type DomainSettings
- type EmailService
- type EmailVerificationService
- func (s *EmailVerificationService) Create(ctx context.Context, options *CreateEmailVerificationOptions) (*singleEmailVerificationRoot, *Response, error)
- func (s *EmailVerificationService) Delete(ctx context.Context, domainID string) (*Response, error)
- func (s *EmailVerificationService) Get(ctx context.Context, emailVerificationId string) (*singleEmailVerificationRoot, *Response, error)
- func (s *EmailVerificationService) GetResults(ctx context.Context, options *GetEmailVerificationOptions) (*resultEmailVerificationRoot, *Response, error)
- func (s *EmailVerificationService) List(ctx context.Context, options *ListEmailVerificationOptions) (*emailVerificationRoot, *Response, error)
- func (s *EmailVerificationService) Update(ctx context.Context, options *DomainSettingOptions) (*singleEmailVerificationRoot, *Response, error)
- func (s *EmailVerificationService) Verify(ctx context.Context, emailVerificationId string) (*singleEmailVerificationRoot, *Response, error)
- func (s *EmailVerificationService) VerifySingle(ctx context.Context, options *SingleEmailVerificationOptions) (*resultSingleEmailVerification, *Response, error)
- type ErrorResponse
- type Filter
- type Forwards
- type From
- type GetEmailVerificationOptions
- type GetRecipientsOptions
- type IdentityService
- func (s *IdentityService) Create(ctx context.Context, options *CreateIdentityOptions) (*singleIdentityRoot, *Response, error)
- func (s *IdentityService) Delete(ctx context.Context, identityID string) (*Response, error)
- func (s *IdentityService) DeleteByEmail(ctx context.Context, identityEmail string) (*Response, error)
- func (s *IdentityService) Get(ctx context.Context, identityID string) (*singleIdentityRoot, *Response, error)
- func (s *IdentityService) GetByEmail(ctx context.Context, identityEmail string) (*singleIdentityRoot, *Response, error)
- func (s *IdentityService) List(ctx context.Context, options *ListIdentityOptions) (*identityRoot, *Response, error)
- func (s *IdentityService) Update(ctx context.Context, identityID string, options *UpdateIdentityOptions) (*singleIdentityRoot, *Response, error)
- func (s *IdentityService) UpdateByEmail(ctx context.Context, identityEmail string, options *UpdateIdentityOptions) (*singleIdentityRoot, *Response, error)
- type InboundRouting
- type InboundService
- func (s *InboundService) Create(ctx context.Context, options *CreateInboundOptions) (*singleInboundRoot, *Response, error)
- func (s *InboundService) Delete(ctx context.Context, inboundID string) (*Response, error)
- func (s *InboundService) Get(ctx context.Context, inboundID string) (*singleInboundRoot, *Response, error)
- func (s *InboundService) List(ctx context.Context, options *ListInboundOptions) (*inboundRoot, *Response, error)
- func (s *InboundService) Update(ctx context.Context, inboundID string, options *UpdateInboundOptions) (*singleInboundRoot, *Response, error)
- type Links
- type ListDomainOptions
- type ListEmailVerificationOptions
- type ListIdentityOptions
- type ListInboundOptions
- type ListMessageOptions
- type ListRecipientOptions
- type ListScheduleMessageOptions
- type ListSmsInboundOptions
- type ListSmsMessageOptions
- type ListSmsWebhookOptions
- type ListTemplateOptions
- type ListWebhookOptions
- type Mailersend
- func (ms *Mailersend) APIKey() string
- func (ms *Mailersend) Client() *http.Client
- func (ms *Mailersend) NewMessage() *Messagedeprecated
- func (ms *Mailersend) Send(ctx context.Context, message *Message) (*Response, error)deprecated
- func (ms *Mailersend) SetAPIKey(apikey string)
- func (ms *Mailersend) SetClient(c *http.Client)
- type MatchFilter
- type Message
- func (m *Message) AddAttachment(attachment Attachment)
- func (m *Message) SetBcc(bcc []Recipient)
- func (m *Message) SetCc(cc []Recipient)
- func (m *Message) SetFrom(from From)
- func (m *Message) SetHTML(html string)
- func (m *Message) SetInReplyTo(inReplyTo string)
- func (m *Message) SetPersonalization(personalization []Personalization)
- func (m *Message) SetRecipients(recipients []Recipient)
- func (m *Message) SetReplyTo(replyTo Recipient)
- func (m *Message) SetSendAt(sendAt int64)
- func (m *Message) SetSubject(subject string)
- func (m *Message) SetSubstitutions(variables []Variables)deprecated
- func (m *Message) SetTags(tags []string)
- func (m *Message) SetTemplateID(templateID string)
- func (m *Message) SetText(text string)
- type MessageService
- type Meta
- type Number
- type Personalization
- type Recipient
- type RecipientService
- func (s *RecipientService) Delete(ctx context.Context, recipientID string) (*Response, error)
- func (s *RecipientService) Get(ctx context.Context, recipientID string) (*singleRecipientRoot, *Response, error)
- func (s *RecipientService) List(ctx context.Context, options *ListRecipientOptions) (*recipientRoot, *Response, error)
- type ReplyTo
- type Response
- type ReturnPath
- type ScheduleDomain
- type ScheduleMessage
- type ScheduleMessageService
- func (s *ScheduleMessageService) Delete(ctx context.Context, messageID string) (*Response, error)
- func (s *ScheduleMessageService) Get(ctx context.Context, messageID string) (*scheduleMessageSingleRoot, *Response, error)
- func (s *ScheduleMessageService) List(ctx context.Context, options *ListScheduleMessageOptions) (*scheduleMessageRoot, *Response, error)
- type SingleEmailVerificationOptions
- type Sms
- type SmsActivityOptions
- type SmsActivityService
- type SmsInboundService
- func (s *SmsInboundService) Create(ctx context.Context, options *CreateSmsInboundOptions) (*singleSmsInboundRoot, *Response, error)
- func (s *SmsInboundService) Delete(ctx context.Context, smsInboundId string) (*Response, error)
- func (s *SmsInboundService) Get(ctx context.Context, smsInboundId string) (*singleSmsInboundRoot, *Response, error)
- func (s *SmsInboundService) List(ctx context.Context, options *ListSmsInboundOptions) (*smsInboundRoot, *Response, error)
- func (s *SmsInboundService) Update(ctx context.Context, options *UpdateSmsInboundOptions) (*singleSmsInboundRoot, *Response, error)
- type SmsMessage
- type SmsMessageData
- type SmsMessageRoot
- type SmsMessageService
- type SmsNumberOptions
- type SmsNumberService
- func (s *SmsNumberService) Delete(ctx context.Context, numberID string) (*Response, error)
- func (s *SmsNumberService) Get(ctx context.Context, numberID string) (*singleSmsNumberRoot, *Response, error)
- func (s *SmsNumberService) List(ctx context.Context, options *SmsNumberOptions) (*smsNumberRoot, *Response, error)
- func (s *SmsNumberService) Update(ctx context.Context, options *SmsNumberSettingOptions) (*singleSmsNumberRoot, *Response, error)
- type SmsNumberSettingOptions
- type SmsPersonalization
- type SmsRecipient
- type SmsRecipientData
- type SmsRecipientDataUpdate
- type SmsRecipientOptions
- type SmsRecipientService
- func (s *SmsRecipientService) Get(ctx context.Context, smsRecipientId string) (*singleSmsRecipientRoot, *Response, error)
- func (s *SmsRecipientService) List(ctx context.Context, options *SmsRecipientOptions) (*smsRecipientRoot, *Response, error)
- func (s *SmsRecipientService) Update(ctx context.Context, options *SmsRecipientSettingOptions) (*singleSmsRecipientUpdateRoot, *Response, error)
- type SmsRecipientSettingOptions
- type SmsService
- type SmsWebhookService
- func (s *SmsWebhookService) Create(ctx context.Context, options *CreateSmsWebhookOptions) (*singleSmsWebhookRoot, *Response, error)
- func (s *SmsWebhookService) Delete(ctx context.Context, smsWebhookId string) (*Response, error)
- func (s *SmsWebhookService) Get(ctx context.Context, smsWebhookId string) (*singleSmsWebhookRoot, *Response, error)
- func (s *SmsWebhookService) List(ctx context.Context, options *ListSmsWebhookOptions) (*smsWebhookRoot, *Response, error)
- func (s *SmsWebhookService) Update(ctx context.Context, options *UpdateSmsWebhookOptions) (*singleSmsWebhookRoot, *Response, error)
- type Spf
- type Substitutiondeprecated
- type SuppressionOptions
- type SuppressionService
- func (s *SuppressionService) CreateBlock(ctx context.Context, options *CreateSuppressionBlockOptions) (*suppressionBlockResponse, *Response, error)
- func (s *SuppressionService) CreateHardBounce(ctx context.Context, options *CreateSuppressionOptions) (*suppressionHardBouncesRoot, *Response, error)
- func (s *SuppressionService) CreateSpamComplaint(ctx context.Context, options *CreateSuppressionOptions) (*suppressionSpamComplaintsRoot, *Response, error)
- func (s *SuppressionService) CreateUnsubscribe(ctx context.Context, options *CreateSuppressionOptions) (*suppressionUnsubscribesRoot, *Response, error)
- func (s *SuppressionService) Delete(ctx context.Context, options *DeleteSuppressionOptions, suppressionType string) (*Response, error)
- func (s *SuppressionService) DeleteAll(ctx context.Context, domainID string, suppressionType string) (*Response, error)
- func (s *SuppressionService) ListBlockList(ctx context.Context, options *SuppressionOptions) (*suppressionBlockListRoot, *Response, error)
- func (s *SuppressionService) ListHardBounces(ctx context.Context, options *SuppressionOptions) (*suppressionHardBouncesRoot, *Response, error)
- func (s *SuppressionService) ListSpamComplaints(ctx context.Context, options *SuppressionOptions) (*suppressionSpamComplaintsRoot, *Response, error)
- func (s *SuppressionService) ListUnsubscribes(ctx context.Context, options *SuppressionOptions) (*suppressionUnsubscribesRoot, *Response, error)
- type TemplateService
- func (s *TemplateService) Delete(ctx context.Context, templateID string) (*Response, error)
- func (s *TemplateService) Get(ctx context.Context, templateID string) (*singleTemplateRoot, *Response, error)
- func (s *TemplateService) List(ctx context.Context, options *ListTemplateOptions) (*templateRoot, *Response, error)
- type TokenService
- func (s *TokenService) Create(ctx context.Context, options *CreateTokenOptions) (*tokenRoot, *Response, error)
- func (s *TokenService) Delete(ctx context.Context, tokenID string) (*Response, error)
- func (s *TokenService) Update(ctx context.Context, options *UpdateTokenOptions) (*tokenRoot, *Response, error)
- type UpdateIdentityOptions
- type UpdateInboundOptions
- type UpdateSmsInboundOptions
- type UpdateSmsWebhookOptions
- type UpdateTokenOptions
- type UpdateWebhookOptions
- type Variablesdeprecated
- type WebhookService
- func (s *WebhookService) Create(ctx context.Context, options *CreateWebhookOptions) (*singleWebhookRoot, *Response, error)
- func (s *WebhookService) Delete(ctx context.Context, webhookID string) (*Response, error)
- func (s *WebhookService) Get(ctx context.Context, webhookID string) (*singleWebhookRoot, *Response, error)
- func (s *WebhookService) List(ctx context.Context, options *ListWebhookOptions) (*webhookRoot, *Response, error)
- func (s *WebhookService) Update(ctx context.Context, options *UpdateWebhookOptions) (*singleWebhookRoot, *Response, error)
Constants ¶
const ( DispositionInline = "inline" DispositionAttachment = "attachment" )
const ( BlockList string = "blocklist" HardBounces string = "hard-bounces" SpamComplaints string = "spam-complaints" Unsubscribes string = "unsubscribes" )
const APIBase string = "https://api.mailersend.com/v1"
Variables ¶
This section is empty.
Functions ¶
func Bool ¶ added in v1.1.0
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func CheckResponse ¶ added in v1.1.0
CheckResponse checks the API response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range or equal to 202 Accepted.
func Int ¶ added in v1.1.0
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
Types ¶
type ActivityOptions ¶ added in v1.1.0
type ActivityOptions struct { DomainID string `url:"-"` Page int `url:"page,omitempty"` DateFrom int64 `url:"date_from,omitempty"` DateTo int64 `url:"date_to,omitempty"` Limit int `url:"limit,omitempty"` Event []string `url:"event[],omitempty"` }
ActivityOptions - modifies the behavior of ActivityService.List method
type ActivityService ¶ added in v1.1.0
type ActivityService service
func (*ActivityService) List ¶ added in v1.1.0
func (s *ActivityService) List(ctx context.Context, options *ActivityOptions) (*activityRoot, *Response, error)
type AnalyticsOptions ¶ added in v1.1.0
type AnalyticsOptions struct { DomainID string `url:"domain_id,omitempty"` RecipientID []int64 `url:"recipient_id,omitempty"` DateFrom int64 `url:"date_from"` DateTo int64 `url:"date_to"` GroupBy string `url:"group_by,omitempty"` Tags []string `url:"tags[],omitempty"` Event []string `url:"event[],omitempty"` }
AnalyticsOptions - modifies the behavior of AnalyticsService methods
type AnalyticsService ¶ added in v1.1.0
type AnalyticsService service
func (*AnalyticsService) GetActivityByDate ¶ added in v1.1.0
func (s *AnalyticsService) GetActivityByDate(ctx context.Context, options *AnalyticsOptions) (*analyticsActivityRoot, *Response, error)
func (*AnalyticsService) GetOpensByCountry ¶ added in v1.1.0
func (s *AnalyticsService) GetOpensByCountry(ctx context.Context, options *AnalyticsOptions) (*opensRoot, *Response, error)
func (*AnalyticsService) GetOpensByReadingEnvironment ¶ added in v1.1.0
func (s *AnalyticsService) GetOpensByReadingEnvironment(ctx context.Context, options *AnalyticsOptions) (*opensRoot, *Response, error)
func (*AnalyticsService) GetOpensByUserAgent ¶ added in v1.1.0
func (s *AnalyticsService) GetOpensByUserAgent(ctx context.Context, options *AnalyticsOptions) (*opensRoot, *Response, error)
type ApiQuotaService ¶ added in v1.3.3
type ApiQuotaService service
type Attachment ¶ added in v1.1.0
type Attachment struct { Content string `json:"content"` Filename string `json:"filename"` Disposition string `json:"disposition,omitempty"` ID string `json:"id,omitempty"` }
Attachment - you can set multiple Attachments
type AuthError ¶ added in v1.1.0
type AuthError ErrorResponse
AuthError occurs when using HTTP Authentication fails
type BulkEmailService ¶ added in v1.1.3
type BulkEmailService service
type CatchFilter ¶ added in v1.1.5
type CreateDomainOptions ¶ added in v1.1.2
type CreateEmailVerificationOptions ¶ added in v1.2.1
type CreateEmailVerificationOptions struct { Name string `json:"name"` Emails []string `json:"emails"` }
CreateEmailVerificationOptions - modifies the behavior of EmailVerificationService.Create Method
type CreateIdentityOptions ¶ added in v1.3.1
type CreateInboundOptions ¶ added in v1.1.5
type CreateInboundOptions struct { DomainID string `json:"domain_id"` Name string `json:"name"` DomainEnabled bool `json:"domain_enabled"` InboundDomain string `json:"inbound_domain,omitempty"` InboundAddress string `json:"inbound_address,omitempty"` InboundSubdomain string `json:"inbound_subdomain,omitempty"` InboundPriority int `json:"inbound_priority,omitempty"` MatchFilter *MatchFilter `json:"match_filter,omitempty"` CatchFilter *CatchFilter `json:"catch_filter,omitempty"` Forwards []Forwards `json:"forwards"` }
CreateInboundOptions - the Options to set when creating an inbound resource
type CreateSmsInboundOptions ¶ added in v1.1.9
type CreateSmsInboundOptions struct { SmsNumberId string `json:"sms_number_id"` Name string `json:"name"` ForwardUrl string `json:"forward_url"` Filter Filter `json:"filter"` Enabled *bool `json:"enabled"` }
CreateSmsInboundOptions - modifies the behavior of *WebhookService.Create Method
type CreateSmsWebhookOptions ¶ added in v1.1.9
type CreateSmsWebhookOptions struct { SmsNumberId string `json:"sms_number_id"` Name string `json:"name"` URL string `json:"url"` Enabled *bool `json:"enabled,omitempty"` Events []string `json:"events"` }
CreateSmsWebhookOptions - modifies the behavior of *WebhookService.Create Method
type CreateSuppressionBlockOptions ¶ added in v1.1.1
type CreateSuppressionOptions ¶ added in v1.1.1
type CreateTokenOptions ¶ added in v1.1.0
type CreateTokenOptions struct { Name string `json:"name"` DomainID string `json:"domain_id"` Scopes []string `json:"scopes"` }
CreateTokenOptions - modifies the behavior of TokenService.Create Method
type CreateWebhookOptions ¶ added in v1.1.0
type CreateWebhookOptions struct { Name string `json:"name"` DomainID string `json:"domain_id"` URL string `json:"url"` Enabled *bool `json:"enabled,omitempty"` Events []string `json:"events"` }
CreateWebhookOptions - modifies the behavior of *WebhookService.Create Method
type CustomTracking ¶ added in v1.1.2
type DeleteSuppressionOptions ¶ added in v1.1.1
type Domain ¶ added in v1.1.0
type Domain struct { ID string `json:"id"` Name string `json:"name"` Dkim bool `json:"dkim"` Spf bool `json:"spf"` Tracking bool `json:"tracking"` IsVerified bool `json:"is_verified"` IsCnameVerified bool `json:"is_cname_verified"` IsDNSActive bool `json:"is_dns_active"` IsCnameActive bool `json:"is_cname_active"` IsTrackingAllowed bool `json:"is_tracking_allowed"` HasNotQueuedMessages bool `json:"has_not_queued_messages"` NotQueuedMessagesCount int `json:"not_queued_messages_count"` DomainSettings DomainSettings `json:"domain_settings"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` }
type DomainService ¶ added in v1.1.0
type DomainService service
func (*DomainService) Create ¶ added in v1.1.2
func (s *DomainService) Create(ctx context.Context, options *CreateDomainOptions) (*singleDomainRoot, *Response, error)
func (*DomainService) GetRecipients ¶ added in v1.1.0
func (s *DomainService) GetRecipients(ctx context.Context, options *GetRecipientsOptions) (*domainRecipientRoot, *Response, error)
func (*DomainService) List ¶ added in v1.1.0
func (s *DomainService) List(ctx context.Context, options *ListDomainOptions) (*domainRoot, *Response, error)
func (*DomainService) Update ¶ added in v1.1.0
func (s *DomainService) Update(ctx context.Context, options *DomainSettingOptions) (*singleDomainRoot, *Response, error)
type DomainSettingOptions ¶ added in v1.1.0
type DomainSettingOptions struct { DomainID string `json:"-"` SendPaused *bool `json:"send_paused,omitempty"` TrackClicks *bool `json:"track_clicks,omitempty"` TrackOpens *bool `json:"track_opens,omitempty"` TrackUnsubscribe *bool `json:"track_unsubscribe,omitempty"` TrackUnsubscribeHTML string `json:"track_unsubscribe_html,omitempty"` TrackUnsubscribePlain string `json:"track_unsubscribe_plain,omitempty"` TrackContent *bool `json:"track_content,omitempty"` CustomTrackingEnabled *bool `json:"custom_tracking_enabled,omitempty"` CustomTrackingSubdomain string `json:"custom_tracking_subdomain,omitempty"` IgnoreDuplicatedRecipients *bool `json:"ignore_duplicated_recipients,omitempty"` PrecedenceBulk *bool `json:"precedence_bulk,omitempty"` }
DomainSettingOptions - modifies the behavior of DomainService.Update Method
type DomainSettings ¶ added in v1.1.0
type DomainSettings struct { SendPaused bool `json:"send_paused,omitempty"` TrackClicks bool `json:"track_clicks,omitempty"` TrackOpens bool `json:"track_opens,omitempty"` TrackUnsubscribe bool `json:"track_unsubscribe,omitempty"` TrackUnsubscribeHTML string `json:"track_unsubscribe_html,omitempty"` TrackUnsubscribePlain string `json:"track_unsubscribe_plain,omitempty"` TrackContent bool `json:"track_content,omitempty"` CustomTrackingEnabled bool `json:"custom_tracking_enabled,omitempty"` CustomTrackingSubdomain string `json:"custom_tracking_subdomain,omitempty"` IgnoreDuplicatedRecipients bool `json:"ignore_duplicated_recipients,omitempty"` PrecedenceBulk bool `json:"precedence_bulk,omitempty"` }
type EmailService ¶ added in v1.1.0
type EmailService service
func (*EmailService) NewMessage ¶ added in v1.1.0
func (s *EmailService) NewMessage() *Message
NewMessage - Setup a new email message ready to be sent.
type EmailVerificationService ¶ added in v1.2.1
type EmailVerificationService service
func (*EmailVerificationService) Create ¶ added in v1.2.1
func (s *EmailVerificationService) Create(ctx context.Context, options *CreateEmailVerificationOptions) (*singleEmailVerificationRoot, *Response, error)
func (*EmailVerificationService) GetResults ¶ added in v1.2.1
func (s *EmailVerificationService) GetResults(ctx context.Context, options *GetEmailVerificationOptions) (*resultEmailVerificationRoot, *Response, error)
func (*EmailVerificationService) List ¶ added in v1.2.1
func (s *EmailVerificationService) List(ctx context.Context, options *ListEmailVerificationOptions) (*emailVerificationRoot, *Response, error)
func (*EmailVerificationService) Update ¶ added in v1.2.1
func (s *EmailVerificationService) Update(ctx context.Context, options *DomainSettingOptions) (*singleEmailVerificationRoot, *Response, error)
func (*EmailVerificationService) VerifySingle ¶ added in v1.5.1
func (s *EmailVerificationService) VerifySingle(ctx context.Context, options *SingleEmailVerificationOptions) (*resultSingleEmailVerification, *Response, error)
type ErrorResponse ¶ added in v1.1.0
type ErrorResponse struct { Response *http.Response // HTTP response that caused this error Message string `json:"message"` // error message }
func (*ErrorResponse) Error ¶ added in v1.1.0
func (r *ErrorResponse) Error() string
type Filter ¶ added in v1.1.9
type Filter struct { Comparer string `json:"comparer"` Value string `json:"value"` Key string `json:"key,omitempty"` }
Filter - used to filter resources
type GetEmailVerificationOptions ¶ added in v1.2.1
type GetEmailVerificationOptions struct { EmailVerificationId string `url:"-"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
GetEmailVerificationOptions - modifies the behavior of EmailVerificationService.List and EmailVerificationService.GetResult Method
type GetRecipientsOptions ¶ added in v1.1.0
type GetRecipientsOptions struct { DomainID string `url:"-"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
GetRecipientsOptions - modifies the behavior of DomainService.GetRecipients Method
type IdentityService ¶ added in v1.3.1
type IdentityService service
func (*IdentityService) Create ¶ added in v1.3.1
func (s *IdentityService) Create(ctx context.Context, options *CreateIdentityOptions) (*singleIdentityRoot, *Response, error)
func (*IdentityService) DeleteByEmail ¶ added in v1.4.0
func (*IdentityService) GetByEmail ¶ added in v1.4.0
func (*IdentityService) List ¶ added in v1.3.1
func (s *IdentityService) List(ctx context.Context, options *ListIdentityOptions) (*identityRoot, *Response, error)
func (*IdentityService) Update ¶ added in v1.3.1
func (s *IdentityService) Update(ctx context.Context, identityID string, options *UpdateIdentityOptions) (*singleIdentityRoot, *Response, error)
func (*IdentityService) UpdateByEmail ¶ added in v1.4.0
func (s *IdentityService) UpdateByEmail(ctx context.Context, identityEmail string, options *UpdateIdentityOptions) (*singleIdentityRoot, *Response, error)
type InboundRouting ¶ added in v1.1.2
type InboundService ¶ added in v1.1.5
type InboundService service
func (*InboundService) Create ¶ added in v1.1.5
func (s *InboundService) Create(ctx context.Context, options *CreateInboundOptions) (*singleInboundRoot, *Response, error)
func (*InboundService) List ¶ added in v1.1.5
func (s *InboundService) List(ctx context.Context, options *ListInboundOptions) (*inboundRoot, *Response, error)
func (*InboundService) Update ¶ added in v1.1.5
func (s *InboundService) Update(ctx context.Context, inboundID string, options *UpdateInboundOptions) (*singleInboundRoot, *Response, error)
type Links ¶ added in v1.1.0
type Links struct { First string `json:"first"` Last string `json:"last"` Prev string `json:"prev"` Next string `json:"next"` }
Links - used for api responses
type ListDomainOptions ¶ added in v1.1.0
type ListDomainOptions struct { Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` Verified *bool `url:"verified,omitempty"` }
ListDomainOptions - modifies the behavior of DomainService.List Method
type ListEmailVerificationOptions ¶ added in v1.2.1
type ListEmailVerificationOptions struct { Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListEmailVerificationOptions - modifies the behavior of EmailVerificationService.List Method
type ListIdentityOptions ¶ added in v1.3.1
type ListIdentityOptions struct { DomainID string `url:"domain_id"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListIdentityOptions - modifies the behavior of *IdentityService.List Method
type ListInboundOptions ¶ added in v1.1.5
type ListInboundOptions struct { DomainID string `url:"domain_id"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListInboundOptions - modifies the behavior of *InboundService.List Method
type ListMessageOptions ¶ added in v1.1.0
type ListMessageOptions struct { Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListMessageOptions - modifies the behavior of MessageService.List Method
type ListRecipientOptions ¶ added in v1.1.0
type ListRecipientOptions struct { DomainID string `url:"domain_id,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListRecipientOptions - modifies the behavior of RecipientService.List method
type ListScheduleMessageOptions ¶ added in v1.1.7
type ListScheduleMessageOptions struct { DomainID string `url:"domain_id,omitempty"` Status string `url:"status,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListScheduleMessageOptions - modifies the behavior of MessageService.List Method
type ListSmsInboundOptions ¶ added in v1.1.9
type ListSmsInboundOptions struct { SmsNumberId string `url:"sms_number_id,omitempty"` Enabled *bool `url:"enabled,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListSmsInboundOptions - modifies the behavior of SmsNumbersService.List method
type ListSmsMessageOptions ¶ added in v1.1.9
type ListSmsMessageOptions struct { Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListSmsMessageOptions - modifies the behavior of SmsMessagesService.List method
type ListSmsWebhookOptions ¶ added in v1.1.9
type ListSmsWebhookOptions struct { SmsNumberId string `url:"sms_number_id,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListSmsWebhookOptions - modifies the behavior of SmsNumbersService.List method
type ListTemplateOptions ¶ added in v1.1.0
type ListTemplateOptions struct { DomainID string `url:"domain_id,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
ListTemplateOptions - modifies the behavior of TemplateService.List Method
type ListWebhookOptions ¶ added in v1.1.0
type ListWebhookOptions struct { DomainID string `url:"domain_id"` Limit int `url:"limit,omitempty"` }
ListWebhookOptions - modifies the behavior of *WebhookService.List Method
type Mailersend ¶
type Mailersend struct { // Services Activity *ActivityService Analytics *AnalyticsService Domain *DomainService Email *EmailService BulkEmail *BulkEmailService Message *MessageService ScheduleMessage *ScheduleMessageService Recipient *RecipientService Template *TemplateService Token *TokenService Webhook *WebhookService Suppression *SuppressionService Inbound *InboundService Sms *SmsService SmsActivity *SmsActivityService SmsNumber *SmsNumberService SmsRecipient *SmsRecipientService SmsWebhook *SmsWebhookService SmsMessage *SmsMessageService SmsInbound *SmsInboundService EmailVerification *EmailVerificationService Identity *IdentityService ApiQuota *ApiQuotaService // contains filtered or unexported fields }
Mailersend - base mailersend api client
func NewMailersend ¶
func NewMailersend(apiKey string) *Mailersend
NewMailersend - creates a new client instance.
func (*Mailersend) APIKey ¶
func (ms *Mailersend) APIKey() string
APIKey - Get api key after it has been created
func (*Mailersend) Client ¶
func (ms *Mailersend) Client() *http.Client
Client - Get the current client
func (*Mailersend) NewMessage
deprecated
func (ms *Mailersend) NewMessage() *Message
Deprecated: NewMessage - Setup a new message ready to be sent
func (*Mailersend) SetAPIKey ¶ added in v1.1.2
func (ms *Mailersend) SetAPIKey(apikey string)
SetAPIKey - Set the client api key
func (*Mailersend) SetClient ¶
func (ms *Mailersend) SetClient(c *http.Client)
SetClient - Set the client if you want more control over the client implementation
type MatchFilter ¶ added in v1.1.5
type MatchFilter struct {
Type string `json:"type,omitempty"`
}
type Message ¶
type Message struct { Recipients []Recipient `json:"to"` From From `json:"from"` CC []Recipient `json:"cc,omitempty"` Bcc []Recipient `json:"bcc,omitempty"` ReplyTo ReplyTo `json:"reply_to,omitempty"` InReplyTo string `json:"in_reply_to,omitempty"` Subject string `json:"subject,omitempty"` Text string `json:"text,omitempty"` HTML string `json:"html,omitempty"` TemplateID string `json:"template_id,omitempty"` SendAt int64 `json:"send_at,omitempty"` Tags []string `json:"tags,omitempty"` Attachments []Attachment `json:"attachments,omitempty"` TemplateVariables []Variables `json:"variables"` Personalization []Personalization `json:"personalization"` }
Message structures contain both the message text and the envelop for an e-mail message.
func (*Message) AddAttachment ¶ added in v1.1.0
func (m *Message) AddAttachment(attachment Attachment)
AddAttachment - Add an attachment base64 encoded content.
func (*Message) SetHTML ¶
SetHTML - Set the html content of the email, required if not using a template.
func (*Message) SetInReplyTo ¶ added in v1.3.0
SetInReplyTo - Set InReplyTo.
func (*Message) SetPersonalization ¶ added in v1.0.4
func (m *Message) SetPersonalization(personalization []Personalization)
SetPersonalization - Set the template personalization.
func (*Message) SetRecipients ¶
SetRecipients - Set all the recipients.
func (*Message) SetReplyTo ¶ added in v1.1.4
SetReplyTo - Set ReplyTo.
func (*Message) SetSubject ¶
SetSubject - Set the subject of the email, required if not using a template.
func (*Message) SetSubstitutions
deprecated
func (*Message) SetTemplateID ¶
SetTemplateID - Set the template ID.
type MessageService ¶ added in v1.1.0
type MessageService service
func (*MessageService) List ¶ added in v1.1.0
func (s *MessageService) List(ctx context.Context, options *ListMessageOptions) (*messageRoot, *Response, error)
type Meta ¶ added in v1.1.0
type Meta struct { CurrentPage json.Number `json:"current_page"` From json.Number `json:"from"` Path string `json:"path"` PerPage json.Number `json:"per_page"` To json.Number `json:"to"` }
Meta - used for api responses
type Personalization ¶ added in v1.0.4
type Personalization struct { Email string `json:"email"` Data map[string]interface{} `json:"data"` }
Personalization - you can set multiple Personalization for each Recipient
type RecipientService ¶ added in v1.1.0
type RecipientService service
func (*RecipientService) List ¶ added in v1.1.0
func (s *RecipientService) List(ctx context.Context, options *ListRecipientOptions) (*recipientRoot, *Response, error)
type ReplyTo ¶ added in v1.1.4
type ReplyTo = Recipient
ReplyTo - simple struct to declare from name/ email
type Response ¶ added in v1.1.0
Response is a Mailersend API response. This wraps the standard http.Response returned from Mailersend and provides convenient access to things like pagination links.
type ReturnPath ¶ added in v1.1.2
type ScheduleDomain ¶ added in v1.1.7
type ScheduleMessage ¶ added in v1.1.7
type ScheduleMessageService ¶ added in v1.1.7
type ScheduleMessageService service
func (*ScheduleMessageService) List ¶ added in v1.1.7
func (s *ScheduleMessageService) List(ctx context.Context, options *ListScheduleMessageOptions) (*scheduleMessageRoot, *Response, error)
type SingleEmailVerificationOptions ¶ added in v1.5.1
type SingleEmailVerificationOptions struct {
Email string `json:"email"`
}
type Sms ¶ added in v1.1.8
type Sms struct { From string `json:"from"` To []string `json:"to"` Text string `json:"text"` Personalization []SmsPersonalization `json:"personalization,omitempty"` }
func (*Sms) SetPersonalization ¶ added in v1.2.0
func (m *Sms) SetPersonalization(personalization []SmsPersonalization)
SetPersonalization - Set the template personalization.
type SmsActivityOptions ¶ added in v1.1.8
type SmsActivityOptions struct { SmsNumberId string `url:"sms_number_id,omitempty"` Status []string `url:"status[],omitempty"` Page int `url:"page,omitempty"` DateFrom int64 `url:"date_from,omitempty"` DateTo int64 `url:"date_to,omitempty"` Limit int `url:"limit,omitempty"` }
SmsActivityOptions - modifies the behavior of SmsService.Activity method
type SmsActivityService ¶ added in v1.1.8
type SmsActivityService service
func (*SmsActivityService) Get ¶ added in v1.1.8
func (s *SmsActivityService) Get(ctx context.Context, smsMessageID string) (*SmsMessageRoot, *Response, error)
func (*SmsActivityService) List ¶ added in v1.1.8
func (s *SmsActivityService) List(ctx context.Context, options *SmsActivityOptions) (*smsListActivityRoot, *Response, error)
type SmsInboundService ¶ added in v1.1.9
type SmsInboundService service
func (*SmsInboundService) Create ¶ added in v1.1.9
func (s *SmsInboundService) Create(ctx context.Context, options *CreateSmsInboundOptions) (*singleSmsInboundRoot, *Response, error)
func (*SmsInboundService) List ¶ added in v1.1.9
func (s *SmsInboundService) List(ctx context.Context, options *ListSmsInboundOptions) (*smsInboundRoot, *Response, error)
func (*SmsInboundService) Update ¶ added in v1.1.9
func (s *SmsInboundService) Update(ctx context.Context, options *UpdateSmsInboundOptions) (*singleSmsInboundRoot, *Response, error)
type SmsMessage ¶ added in v1.1.8
type SmsMessageData ¶ added in v1.1.8
type SmsMessageRoot ¶ added in v1.1.8
type SmsMessageRoot struct {
Data SmsMessageData `json:"data"`
}
type SmsMessageService ¶ added in v1.1.9
type SmsMessageService service
func (*SmsMessageService) List ¶ added in v1.1.9
func (s *SmsMessageService) List(ctx context.Context, options *ListSmsMessageOptions) (*smsListMessagesRoot, *Response, error)
type SmsNumberOptions ¶ added in v1.1.8
type SmsNumberOptions struct { Paused bool `url:"paused,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
SmsNumberOptions - modifies the behavior of SmsNumbersService.List method
type SmsNumberService ¶ added in v1.1.8
type SmsNumberService service
func (*SmsNumberService) List ¶ added in v1.1.8
func (s *SmsNumberService) List(ctx context.Context, options *SmsNumberOptions) (*smsNumberRoot, *Response, error)
func (*SmsNumberService) Update ¶ added in v1.1.8
func (s *SmsNumberService) Update(ctx context.Context, options *SmsNumberSettingOptions) (*singleSmsNumberRoot, *Response, error)
type SmsNumberSettingOptions ¶ added in v1.1.8
SmsNumberSettingOptions - modifies the behavior of SmsNumbersService.Update method
type SmsPersonalization ¶ added in v1.2.0
type SmsPersonalization struct { PhoneNumber string `json:"phone_number"` Data map[string]interface{} `json:"data"` }
SmsPersonalization - you can set multiple SmsPersonalization for each Recipient
type SmsRecipient ¶ added in v1.1.8
type SmsRecipientData ¶ added in v1.1.8
type SmsRecipientDataUpdate ¶ added in v1.1.8
type SmsRecipientOptions ¶ added in v1.1.8
type SmsRecipientOptions struct { Status bool `url:"status,omitempty"` SmsNumberId string `url:"sms_number_id,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
SmsRecipientOptions - modifies the behavior of SmsNumbersService.List method
type SmsRecipientService ¶ added in v1.1.8
type SmsRecipientService service
func (*SmsRecipientService) List ¶ added in v1.1.8
func (s *SmsRecipientService) List(ctx context.Context, options *SmsRecipientOptions) (*smsRecipientRoot, *Response, error)
func (*SmsRecipientService) Update ¶ added in v1.1.8
func (s *SmsRecipientService) Update(ctx context.Context, options *SmsRecipientSettingOptions) (*singleSmsRecipientUpdateRoot, *Response, error)
type SmsRecipientSettingOptions ¶ added in v1.1.8
type SmsRecipientSettingOptions struct { Id string `json:"-"` Status string `json:"status,omitempty"` }
SmsRecipientSettingOptions - modifies the behavior of SmsNumbersService.Update method
type SmsService ¶ added in v1.1.8
type SmsService service
func (*SmsService) NewMessage ¶ added in v1.1.8
func (s *SmsService) NewMessage() *Sms
NewMessage - Setup a new Sms message ready to be sent.
type SmsWebhookService ¶ added in v1.1.9
type SmsWebhookService service
func (*SmsWebhookService) Create ¶ added in v1.1.9
func (s *SmsWebhookService) Create(ctx context.Context, options *CreateSmsWebhookOptions) (*singleSmsWebhookRoot, *Response, error)
func (*SmsWebhookService) List ¶ added in v1.1.9
func (s *SmsWebhookService) List(ctx context.Context, options *ListSmsWebhookOptions) (*smsWebhookRoot, *Response, error)
func (*SmsWebhookService) Update ¶ added in v1.1.9
func (s *SmsWebhookService) Update(ctx context.Context, options *UpdateSmsWebhookOptions) (*singleSmsWebhookRoot, *Response, error)
type Substitution
deprecated
type SuppressionOptions ¶ added in v1.1.1
type SuppressionOptions struct { DomainID string `url:"domain_id,omitempty"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` }
SuppressionOptions - modifies the behavior of SuppressionService.List methods
type SuppressionService ¶ added in v1.1.1
type SuppressionService service
func (*SuppressionService) CreateBlock ¶ added in v1.1.1
func (s *SuppressionService) CreateBlock(ctx context.Context, options *CreateSuppressionBlockOptions) (*suppressionBlockResponse, *Response, error)
func (*SuppressionService) CreateHardBounce ¶ added in v1.1.1
func (s *SuppressionService) CreateHardBounce(ctx context.Context, options *CreateSuppressionOptions) (*suppressionHardBouncesRoot, *Response, error)
func (*SuppressionService) CreateSpamComplaint ¶ added in v1.1.1
func (s *SuppressionService) CreateSpamComplaint(ctx context.Context, options *CreateSuppressionOptions) (*suppressionSpamComplaintsRoot, *Response, error)
func (*SuppressionService) CreateUnsubscribe ¶ added in v1.1.1
func (s *SuppressionService) CreateUnsubscribe(ctx context.Context, options *CreateSuppressionOptions) (*suppressionUnsubscribesRoot, *Response, error)
func (*SuppressionService) Delete ¶ added in v1.1.1
func (s *SuppressionService) Delete(ctx context.Context, options *DeleteSuppressionOptions, suppressionType string) (*Response, error)
func (*SuppressionService) ListBlockList ¶ added in v1.1.1
func (s *SuppressionService) ListBlockList(ctx context.Context, options *SuppressionOptions) (*suppressionBlockListRoot, *Response, error)
func (*SuppressionService) ListHardBounces ¶ added in v1.1.1
func (s *SuppressionService) ListHardBounces(ctx context.Context, options *SuppressionOptions) (*suppressionHardBouncesRoot, *Response, error)
func (*SuppressionService) ListSpamComplaints ¶ added in v1.1.1
func (s *SuppressionService) ListSpamComplaints(ctx context.Context, options *SuppressionOptions) (*suppressionSpamComplaintsRoot, *Response, error)
func (*SuppressionService) ListUnsubscribes ¶ added in v1.1.1
func (s *SuppressionService) ListUnsubscribes(ctx context.Context, options *SuppressionOptions) (*suppressionUnsubscribesRoot, *Response, error)
type TemplateService ¶ added in v1.1.0
type TemplateService service
func (*TemplateService) List ¶ added in v1.1.0
func (s *TemplateService) List(ctx context.Context, options *ListTemplateOptions) (*templateRoot, *Response, error)
type TokenService ¶ added in v1.1.0
type TokenService service
func (*TokenService) Create ¶ added in v1.1.0
func (s *TokenService) Create(ctx context.Context, options *CreateTokenOptions) (*tokenRoot, *Response, error)
func (*TokenService) Update ¶ added in v1.1.0
func (s *TokenService) Update(ctx context.Context, options *UpdateTokenOptions) (*tokenRoot, *Response, error)
type UpdateIdentityOptions ¶ added in v1.3.1
type UpdateIdentityOptions CreateIdentityOptions
UpdateIdentityOptions - the Options to set when creating an Identity resource
type UpdateInboundOptions ¶ added in v1.1.5
type UpdateInboundOptions CreateInboundOptions
UpdateInboundOptions - the Options to set when creating an inbound resource
type UpdateSmsInboundOptions ¶ added in v1.1.9
type UpdateSmsInboundOptions struct { Id string `json:"-"` SmsNumberId string `json:"sms_number_id,omitempty"` Name string `json:"name,omitempty"` ForwardUrl string `json:"forward_url,omitempty"` Filter Filter `json:"filter,omitempty"` Enabled *bool `json:"enabled,omitempty"` }
UpdateSmsInboundOptions - modifies the behavior of SmsNumbersService.Update method
type UpdateSmsWebhookOptions ¶ added in v1.1.9
type UpdateSmsWebhookOptions struct { Id string `json:"-"` URL string `json:"url,omitempty"` Name string `json:"name,omitempty"` Events []string `json:"events,omitempty"` Status string `json:"status,omitempty"` Enabled *bool `json:"enabled,omitempty"` }
UpdateSmsWebhookOptions - modifies the behavior of SmsNumbersService.Update method
type UpdateTokenOptions ¶ added in v1.1.0
UpdateTokenOptions - modifies the behavior of TokenService.Update Method
type UpdateWebhookOptions ¶ added in v1.1.0
type UpdateWebhookOptions struct { WebhookID string `json:"-"` Name string `json:"name,omitempty"` URL string `json:"url,omitempty"` Enabled *bool `json:"enabled,omitempty"` Events []string `json:"events,omitempty"` }
UpdateWebhookOptions - modifies the behavior of *WebhookService.Update Method
type Variables
deprecated
type Variables struct { Email string `json:"email"` Substitutions []Substitution `json:"substitutions"` }
Deprecated: Variables - you can set multiple Substitutions for each Recipient
type WebhookService ¶ added in v1.1.0
type WebhookService service
func (*WebhookService) Create ¶ added in v1.1.0
func (s *WebhookService) Create(ctx context.Context, options *CreateWebhookOptions) (*singleWebhookRoot, *Response, error)
func (*WebhookService) List ¶ added in v1.1.0
func (s *WebhookService) List(ctx context.Context, options *ListWebhookOptions) (*webhookRoot, *Response, error)
func (*WebhookService) Update ¶ added in v1.1.0
func (s *WebhookService) Update(ctx context.Context, options *UpdateWebhookOptions) (*singleWebhookRoot, *Response, error)
Source Files ¶
- activity.go
- analytics.go
- api_quota.go
- bulk_email.go
- domains.go
- email.go
- email_verification.go
- inbound.go
- mailersend.go
- messages.go
- recipients.go
- schedule_message.go
- sender_identities.go
- sms.go
- sms_activity.go
- sms_inbound.go
- sms_messages.go
- sms_numbers.go
- sms_recipients.go
- sms_webhooks.go
- suppressions.go
- templates.go
- tokens.go
- webhooks.go