Documentation ¶
Index ¶
- Constants
- func VerifyWebhookSignature(sig mailgun.Signature, webhookApiKey string) (verified bool, err error)
- type Domains
- type MailgunSmtpHandler
- func (m *MailgunSmtpHandler) ListDomains() ([]string, error)
- func (m *MailgunSmtpHandler) ReceiveMail(request http.Request) (*mailiotypes.Mail, error)
- func (m *MailgunSmtpHandler) SendMimeMail(from mail.Address, raw []byte, to []mail.Address) (string, error)
- func (m *MailgunSmtpHandler) SetDomainAndSendApiKey(key string, domain string) error
Constants ¶
View Source
const MaxNumberOfRecipients = 20
Variables ¶
This section is empty.
Functions ¶
func VerifyWebhookSignature ¶ added in v1.0.2
VerifyWebhookSignature is a modified method from mailgun that supports a webhook key, intead of sending api key
Types ¶
type Domains ¶ added in v1.0.4
type Domains struct { TotalCount int `json:"total_count"` Items []struct { CreatedAt string `json:"created_at"` ID string `json:"id"` Name string `json:"name"` State string `json:"state"` WebPrefix string `json:"web_prefix"` Type string `json:"type"` Disabled struct { Code string `json:"code"` Note string `json:"note"` Permanently bool `json:"permanently"` Reason string `json:"reason"` } `json:"disabled"` } `json:"items"` }
type MailgunSmtpHandler ¶
type MailgunSmtpHandler struct {
// contains filtered or unexported fields
}
func NewMailgunSmtpHandler ¶
func NewMailgunSmtpHandler(webhookSigningKey string, developmentApiKey string, baseURL *string) *MailgunSmtpHandler
NewMailgunSmtpHandler creates a new Mailgun SMTP handler with the specified webhook signing key and optional base URL. If the base URL is not provided, it defaults to "https://api.mailgun.net/v3".
Parameters:
- webhookSigningKey: The signing key used for validating webhook requests for incoming emails.
- developmentApiKey: The API key used for sending emails from the development domain.
- baseURL: A pointer to a string specifying the base URL for the Mailgun API. If nil, the default URL is used.
Returns:
- A new instance of MailgunSmtpHandler that implements the mailioutil.SmtpHandler interface.
func (*MailgunSmtpHandler) ListDomains ¶ added in v1.0.4
func (m *MailgunSmtpHandler) ListDomains() ([]string, error)
list all supported domains
func (*MailgunSmtpHandler) ReceiveMail ¶
func (m *MailgunSmtpHandler) ReceiveMail(request http.Request) (*mailiotypes.Mail, error)
* Note: To receive raw MIME messages and perform your own parsing, you must configure a route with a URL ending with "mime". Example: http://myhost/post_mime
func (*MailgunSmtpHandler) SendMimeMail ¶
func (m *MailgunSmtpHandler) SendMimeMail(from mail.Address, raw []byte, to []mail.Address) (string, error)
send mail using mailgun
func (*MailgunSmtpHandler) SetDomainAndSendApiKey ¶ added in v1.0.4
func (m *MailgunSmtpHandler) SetDomainAndSendApiKey(key string, domain string) error
associates the domain with the sending api key
Click to show internal directories.
Click to hide internal directories.