Documentation ¶
Index ¶
- Variables
- func RenderHTML(opts RenderOpts) (string, error)
- func RenderText(opts RenderOpts) (string, error)
- type AddMessageOpts
- type Channel
- type ClientOpts
- type ComposeOpts
- type MailChannelOpts
- type Message
- type MessageData
- type Messenger
- func (msgr *Messenger) AddMessage(opts AddMessageOpts) error
- func (msgr *Messenger) Compose(opts ComposeOpts) (string, error)
- func (msgr *Messenger) LayoutFile(channel Channel, format RenderFormat) string
- func (msgr *Messenger) Preview(opts PreviewOpts) error
- func (msgr *Messenger) Send(opts SendOpts) error
- type NewMessageOpts
- type PreviewOpts
- type RenderFormat
- type RenderOpts
- 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 MailChannelOpts *MailChannelOpts }
type ClientOpts ¶
type ClientOpts struct { // Path to email layout, locales, and templates TemplatesRoot string DefaultFrom string MailProvider provider.MailProvider SMSProvider provider.SMSProvider DefaultLocale string // Dynamic data to be used in the layout LayoutData MessageData }
type ComposeOpts ¶
type ComposeOpts struct { Message Message Channel Channel Format RenderFormat Locale string Data MessageData }
type MailChannelOpts ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func NewMessage(opts NewMessageOpts) (*Message, error)
func (*Message) MailSubject ¶
func (msg *Message) MailSubject( locale string, data MessageData, ) (string, error)
func (*Message) TemplateFiles ¶
func (msg *Message) TemplateFiles(channel Channel, format RenderFormat) []string
type MessageData ¶
type Messenger ¶
type Messenger struct {
// 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) LayoutFile ¶
func (msgr *Messenger) LayoutFile(channel Channel, format RenderFormat) string
func (*Messenger) Preview ¶
func (msgr *Messenger) Preview(opts PreviewOpts) error
type NewMessageOpts ¶
type NewMessageOpts struct {
// contains filtered or unexported fields
}
type PreviewOpts ¶
type PreviewOpts struct { MessageName string Data MessageData Locale string }
type RenderFormat ¶
type RenderFormat string
var ( RenderKindText RenderFormat = "text" RenderKindHTML RenderFormat = "html" )
type RenderOpts ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.