Documentation
¶
Index ¶
- Variables
- func RenderHTML(opts RenderOpts) (string, error)
- func RenderText(opts RenderOpts) (string, error)
- type AddMessageOpts
- type Channel
- type ClientOpts
- type ComposeMailOpts
- type ComposePushOpts
- type ComposeSMSOpts
- type MailChannelOpts
- type MailContents
- type Message
- type MessageData
- type Messenger
- func (msgr *Messenger) AddMessage(opts AddMessageOpts) error
- func (msgr *Messenger) ComposeMail(opts ComposeMailOpts) (*MailContents, error)
- func (msgr *Messenger) ComposePush(opts ComposePushOpts) (*PushContents, error)
- func (msgr *Messenger) ComposeSMS(opts ComposeSMSOpts) (*SMSContents, error)
- func (msgr *Messenger) GetMessage(name string) (*Message, error)
- func (msgr *Messenger) LayoutFile(channel Channel, format RenderFormat) string
- func (msgr *Messenger) Send(opts SendOpts) error
- type NewMessageOpts
- type PushContents
- type RenderFormat
- type RenderOpts
- type SMSContents
- type SendOpts
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func RenderHTML ¶
func RenderHTML(opts RenderOpts) (string, error)
func RenderText ¶
func RenderText(opts RenderOpts) (string, error)
Types ¶
type AddMessageOpts ¶
type AddMessageOpts struct {
Name string // Must be unique
MailChannelOpts MailChannelOpts // Email channel options
}
type ClientOpts ¶
type ClientOpts struct {
// Path to email layout, locales, and templates
TemplatesRoot string
// Set the mail provider and default opts
MailProvider provider.MailProvider
MailOpts *MailChannelOpts
// SMS options
SMSProvider provider.SMSProvider
// Push options
PushProviders *provider.PushProviders
DefaultLocale string
// Fixed data to be used in the layout
LayoutData MessageData
}
type ComposeMailOpts ¶ added in v0.0.5
type ComposeMailOpts struct {
Message Message
Locale string
Data MessageData
}
type ComposePushOpts ¶ added in v0.0.5
type ComposePushOpts struct {
Message Message
Locale string
Data MessageData
}
type ComposeSMSOpts ¶ added in v0.0.5
type ComposeSMSOpts struct {
Message Message
Locale string
Data MessageData
}
type MailChannelOpts ¶
type MailContents ¶ added in v0.0.5
Mail composition
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func NewMessage(opts NewMessageOpts) (*Message, error)
func (*Message) TemplateFiles ¶
func (msg *Message) TemplateFiles(channel Channel, format RenderFormat) []string
type MessageData ¶
type Messenger ¶
type Messenger struct {
LayoutData MessageData
// contains filtered or unexported fields
}
func NewClient ¶
func NewClient(opts ClientOpts) (*Messenger, error)
func (*Messenger) AddMessage ¶
func (msgr *Messenger) AddMessage(opts AddMessageOpts) error
func (*Messenger) ComposeMail ¶ added in v0.0.5
func (msgr *Messenger) ComposeMail(opts ComposeMailOpts) (*MailContents, error)
func (*Messenger) ComposePush ¶ added in v0.0.5
func (msgr *Messenger) ComposePush(opts ComposePushOpts) (*PushContents, error)
func (*Messenger) ComposeSMS ¶ added in v0.0.5
func (msgr *Messenger) ComposeSMS(opts ComposeSMSOpts) (*SMSContents, error)
SMS composition
func (*Messenger) GetMessage ¶ added in v0.0.5
func (*Messenger) LayoutFile ¶
func (msgr *Messenger) LayoutFile(channel Channel, format RenderFormat) string
type NewMessageOpts ¶
type NewMessageOpts struct {
// contains filtered or unexported fields
}
type PushContents ¶ added in v0.0.5
Push composition
type RenderFormat ¶
type RenderFormat string
var ( RenderKindText RenderFormat = "text" RenderKindHTML RenderFormat = "html" )
type RenderOpts ¶
type SMSContents ¶ added in v0.0.5
type SMSContents struct {
Body string
}
type SendOpts ¶
type SendOpts struct {
MessageName string
MailTo string // If MailTo is defined, it will send email
SMSTo string // If SMSTo is defined, it will send SMS
PushTo []provider.PushDevice // If pushTo has devices, it will send via push
Data MessageData
Locale string
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.