Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vtopc committed Nov 8, 2024
1 parent 6596f8d commit ad8fae1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
14 changes: 11 additions & 3 deletions events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ type Delivered struct {
UserVariables interface{} `json:"user-variables"`
}

// Failed - Mailgun could not deliver the email to the recipient email server.
// Use for permanent_fail and temporary_fail webhooks.
type Failed struct {
Generic

Expand All @@ -114,9 +116,15 @@ type Failed struct {
Storage Storage `json:"storage"`

DeliveryStatus DeliveryStatus `json:"delivery-status"`
Severity string `json:"severity"`
Reason string `json:"reason"`
UserVariables interface{} `json:"user-variables"`

// Severity:
//
// - permanent when a message is not delivered;
//
// - temporary when a message is temporarily rejected by an ESP.
Severity string `json:"severity"`
Reason string `json:"reason"`
UserVariables interface{} `json:"user-variables"`
}

type Stored struct {
Expand Down
1 change: 1 addition & 0 deletions webhooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ func (mg *MailgunImpl) ListWebhooks(ctx context.Context) (map[string][]string, e
}

// CreateWebhook installs a new webhook for your domain.
// List of kinds - https://documentation.mailgun.com/docs/mailgun/user-manual/events/#event-types
func (mg *MailgunImpl) CreateWebhook(ctx context.Context, kind string, urls []string) error {
r := newHTTPRequest(generateDomainApiUrl(mg, webhooksEndpoint))
r.setClient(mg.Client())
Expand Down

0 comments on commit ad8fae1

Please sign in to comment.