Skip to content

Commit

Permalink
Merge pull request #177 from thrawn01/thrawn/develop
Browse files Browse the repository at this point in the history
Update Event Objects
  • Loading branch information
thrawn01 authored Mar 28, 2019
2 parents b57fc76 + b360d58 commit 9f84664
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 20 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.3.2] - 2019-03-28
### Changes
* Uncommented DeliveryStatus.Code and change it to an integer (See #175)
* Added UserVariables to all Message events (See #176)

## [3.3.1] - 2019-03-13
### Changes
* Updated Template calls to reflect the most recent Template API changes.
Expand Down
38 changes: 22 additions & 16 deletions events/events.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,13 @@ type Accepted struct {
Message Message `json:"message"`
Flags Flags `json:"flags"`

Recipient string `json:"recipient"`
RecipientDomain string `json:"recipient-domain"`
Method string `json:"method"`
OriginatingIP string `json:"originating-ip"`
Tags []string `json:"tags"`
Campaigns []Campaign `json:"campaigns"`
Recipient string `json:"recipient"`
RecipientDomain string `json:"recipient-domain"`
Method string `json:"method"`
OriginatingIP string `json:"originating-ip"`
Tags []string `json:"tags"`
Campaigns []Campaign `json:"campaigns"`
UserVariables map[string]string `json:"user-variables"`
}

type Rejected struct {
Expand All @@ -74,8 +75,9 @@ type Rejected struct {
Storage Storage `json:"storage"`
Flags Flags `json:"flags"`

Tags []string `json:"tags"`
Campaigns []Campaign `json:"campaigns"`
Tags []string `json:"tags"`
Campaigns []Campaign `json:"campaigns"`
UserVariables map[string]string `json:"user-variables"`
}

type Delivered struct {
Expand All @@ -91,7 +93,8 @@ type Delivered struct {
Tags []string `json:"tags"`
Campaigns []Campaign `json:"campaigns"`

DeliveryStatus DeliveryStatus `json:"delivery-status"`
DeliveryStatus DeliveryStatus `json:"delivery-status"`
UserVariables map[string]string `json:"user-variables"`
}

type Failed struct {
Expand All @@ -107,9 +110,10 @@ type Failed struct {
Tags []string `json:"tags"`
Campaigns []Campaign `json:"campaigns"`

DeliveryStatus DeliveryStatus `json:"delivery-status"`
Severity string `json:"severity"`
Reason string `json:"reason"`
DeliveryStatus DeliveryStatus `json:"delivery-status"`
Severity string `json:"severity"`
Reason string `json:"reason"`
UserVariables map[string]string `json:"user-variables"`
}

type Stored struct {
Expand All @@ -119,8 +123,9 @@ type Stored struct {
Storage Storage `json:"storage"`
Flags Flags `json:"flags"`

Tags []string `json:"tags"`
Campaigns []Campaign `json:"campaigns"`
Tags []string `json:"tags"`
Campaigns []Campaign `json:"campaigns"`
UserVariables map[string]string `json:"user-variables"`
}

//
Expand Down Expand Up @@ -189,8 +194,9 @@ type Complained struct {
Message Message `json:"message"`
Campaigns []Campaign `json:"campaigns"`

Recipient string `json:"recipient"`
Tags []string `json:"tags"`
Recipient string `json:"recipient"`
Tags []string `json:"tags"`
UserVariables map[string]string `json:"user-variables"`
}

//
Expand Down
4 changes: 1 addition & 3 deletions events/objects.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ type Campaign struct {
}

type DeliveryStatus struct {
// The code is an int or a string from time to time so
// we can't uncomment this field until all emitters unified.
// Code string `json:"code"`
Code int `json:"code"`
Message string `json:"message"`
SessionSeconds float64 `json:"session-seconds"`
}
2 changes: 1 addition & 1 deletion version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mailgun

// Version of current release
const Version = "3.0.0"
const Version = "3.3.2"

0 comments on commit 9f84664

Please sign in to comment.