Skip to content

Commit

Permalink
Use DripCampaign struct instead of Email struct
Browse files Browse the repository at this point in the history
  • Loading branch information
gvohra committed Jul 26, 2016
1 parent 1268956 commit dfc9b19
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions swu.go
Expand Up @@ -54,6 +54,17 @@ type SWUEmail struct {
VersionName string `json:"version_name,omitempty"`
}

type SWUDripCampaign struct {
Recipient *SWURecipient `json:"recipient,omitempty"`
CC []*SWURecipient `json:"cc,omitempty"`
BCC []*SWURecipient `json:"bcc,omitempty"`
Sender *SWUSender `json:"sender,omitempty"`
EmailData map[string]string `json:"email_data,omitempty"`
Tags []string `json:"tags,omitempty"`
ESPAccount string `json:"esp_account,omitempty"`
Locale string `json:"locale,omitempty"`
}

type SWURecipient struct {
Address string `json:"address,omitempty"`
Name string `json:"name,omitempty"`
Expand Down Expand Up @@ -185,8 +196,8 @@ func (c *SWUClient) Send(email *SWUEmail) error {
return err
}

func (c *SWUClient) ActivateDripCampaign(id string, email *SWUEmail) error {
payload, err := json.Marshal(email)
func (c *SWUClient) ActivateDripCampaign(id string, dripCampaign *SWUDripCampaign) error {
payload, err := json.Marshal(dripCampaign)
if err != nil {
return err
}
Expand Down

0 comments on commit dfc9b19

Please sign in to comment.