Documentation
¶
Overview ¶
Package iris sends transactional email through Iris (https://iris.orvlabs.com) and verifies its webhooks.
Index ¶
Constants ¶
View Source
const DefaultBaseURL = "https://iris.orvlabs.com"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attachment ¶
Attachment content is base64; Iris accepts 10 MB decoded at most in total.
type Client ¶
Client calls the Iris API with one key. Use it from your server only: the key must stay secret.
type Email ¶
type Email struct {
Sender Address `json:"sender"`
To []Address `json:"to,omitempty"`
Cc []Address `json:"cc,omitempty"`
Bcc []Address `json:"bcc,omitempty"`
ReplyTo *Address `json:"replyTo,omitempty"`
Subject string `json:"subject,omitempty"`
HTMLContent string `json:"htmlContent,omitempty"`
TextContent string `json:"textContent,omitempty"`
TemplateID int64 `json:"templateId,omitempty"`
Params map[string]any `json:"params,omitempty"`
Headers map[string]string `json:"headers,omitempty"`
Attachment []Attachment `json:"attachment,omitempty"`
ScheduledAt *time.Time `json:"scheduledAt,omitempty"`
BatchID string `json:"batchId,omitempty"`
Payment *Payment `json:"payment,omitempty"`
Unsubscribe bool `json:"unsubscribe,omitempty"`
}
type Error ¶
type Error struct {
Status int `json:"-"`
Code string `json:"code"`
Message string `json:"message"`
}
Error is an answer other than 2xx. Branch on Status and Code; Message is French text that may change.
type Event ¶
type Event struct {
ID string `json:"id"`
Type string `json:"type"`
CreatedAt time.Time `json:"createdAt"`
Data struct {
MessageID string `json:"messageId"`
Email string `json:"email"`
URL string `json:"url"`
} `json:"data"`
}
Event is an email event webhook. Deduplicate on ID: retries carry the same one.
type Payment ¶
type Payment struct {
AmountXOF int64 `json:"amountXof"`
Reference string `json:"reference"`
Description string `json:"description"`
ExpiresIn int `json:"expiresIn,omitempty"`
Methods []string `json:"methods,omitempty"`
}
Payment adds a 221 Pay link (Wave, Orange Money) of your linked merchant account. Amounts are whole CFA francs.
Click to show internal directories.
Click to hide internal directories.