Documentation ¶
Index ¶
- type Client
- func (c Client) GenerateTemplatePreview(id string, personalisation ...PersonalisationOption) (TemplatePreview, error)
- func (c Client) GetAllTemplates(typ string) (Templates, error)
- func (c Client) GetNotificationById(id string) (Notification, error)
- func (c Client) GetTemplateByID(id string) (Template, error)
- func (c Client) GetTemplateByIDAndVersion(id string, version int) (Template, error)
- func (c Client) SendEmail(id string, emailAddress string, options ...SendEmailOption) (SentEmail, error)
- func (c Client) SendSMS(id string, phoneNumber string, options ...SendSMSOption) (SentSMS, error)
- type ClientOption
- type CommonOption
- type Notification
- type Personalisation
- type PersonalisationOption
- type SendEmailOption
- type SendSMSOption
- type SentEmail
- type SentSMS
- type Template
- type TemplatePreview
- type Templates
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (Client) GenerateTemplatePreview ¶
func (c Client) GenerateTemplatePreview(id string, personalisation ...PersonalisationOption) (TemplatePreview, error)
func (Client) GetNotificationById ¶
func (c Client) GetNotificationById(id string) (Notification, error)
func (Client) GetTemplateByIDAndVersion ¶
type ClientOption ¶
func WithBaseURL ¶
func WithBaseURL(target string) ClientOption
type CommonOption ¶
type CommonOption interface { SendSMSOption SendEmailOption }
func Reference ¶
func Reference(referenceID string) CommonOption
Reference is a unique identifier you create. It identifies a single unique notification or a batch of notifications.
type Notification ¶
type Notification struct { ID string `json:"id,omitempty"` Subject string `json:"subject"` Body string `json:"body"` Reference string `json:"reference"` EmailAddress string `json:"email_address"` PhoneNumber string `json:"phone_number"` Type string `json:"type"` Status string `json:"status"` CreatedBy string `json:"created_by_name"` CreatedAt string `json:"created_at"` SentAt string `json:"sent_at"` Template struct { ID string `json:"id"` URI string `json:"uri"` Version int `json:"version"` } `json:"template"` }
type Personalisation ¶
type Personalisation []struct { Key string Value interface{} }
Personalisation is a slice of structs used to define placeholder values in a template, such as name or reference number. The struct should be structured such that they key is the name of the value in your template, and the value is what you expect to be substituted in the message.
type PersonalisationOption ¶
type PersonalisationOption interface {
// contains filtered or unexported methods
}
type SendEmailOption ¶
type SendEmailOption interface {
// contains filtered or unexported methods
}
func EmailReplyToID ¶
func EmailReplyToID(address string) SendEmailOption
EmailReplyToID is the ID of the reply-to address to receive replies from users.
type SendSMSOption ¶
type SendSMSOption interface {
// contains filtered or unexported methods
}
func SMSSenderID ¶
func SMSSenderID(senderID string) SendSMSOption
SMSSenderID is a unique identifier for the sender of a text message.
type SentEmail ¶
type SentEmail struct { ID string `json:"id"` URI string `json:"uri"` Reference *string `json:"reference"` ScheduledFor *string `json:"scheduled_for"` Content struct { Subject string `json:"subject"` Body string `json:"body"` FromEmail string `json:"from_email"` } `json:"content"` Template struct { ID string `json:"id"` URI string `json:"uri"` Version int `json:"version"` } `json:"template"` }
type SentSMS ¶
type SentSMS struct { ID string `json:"id"` URI string `json:"uri"` Reference *string `json:"reference"` ScheduledFor *string `json:"scheduled_for"` Content struct { Body string `json:"body"` FromNumber string `json:"from_number"` } `json:"content"` Template struct { ID string `json:"id"` URI string `json:"uri"` Version int `json:"version"` } `json:"template"` }
type Template ¶
type Template struct { ID string `json:"id,omitempty"` Name string `json:"name"` Type string `json:"type"` CreatedAt string `json:"created_at"` UpdatedAt string `json:"updated_at"` CreatedBy string `json:"created_by"` Version int `json:"version"` Subject string `json:"subject"` Body string `json:"body"` }
type TemplatePreview ¶
Click to show internal directories.
Click to hide internal directories.