Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var NewMailgunMessageAction = func(jsonAction *json.RawMessage) (common.Action, error) { // Create an Action object from JSON. var action Action err := json.Unmarshal(*jsonAction, &action) if err != nil { return nil, err } client := mailgun.NewMailgun( action.MailgunDomain, action.MailgunAPIKey, action.MailgunPublicAPIKey, ) action.SetMailgunClient(client) return action, nil }
NewMailgunMessageAction implements the ActionFactory function type. It creates a Mailgun Message Action based on the given JSON-object, and initializes it by injecting the required Mailgun client.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action struct { // Common fields and functions for all Actions. common.ActionBase // Mailgun configuration. MailgunDomain string `json:"mailgun_domain"` MailgunAPIKey string `json:"mailgun_api_key"` MailgunPublicAPIKey string `json:"mailgun_public_api_key"` // Message details. MessageFrom string `json:"message_from"` MessageTo string `json:"message_to"` MessageSubject string `json:"message_subject"` MessageBody string `json:"message_body"` // contains filtered or unexported fields }
Action implements the common.Action interface. It provides an Action that sends an email message via Mailgun. The details of the message are hardcoded per action at the moment, but template capabilities will be provided in the future.
func (Action) Do ¶
Do Implements common.Action.Do(). It executes the Mailgun Action by sending the email message via Mailgun.
func (*Action) SetMailgunClient ¶
func (action *Action) SetMailgunClient(client MailgunClient)
SetMailgunClient allows to inject a Mailgun client into the corresponding field.
Click to show internal directories.
Click to hide internal directories.