Skip to content

Commit

Permalink
Merge pull request #13 from belong-inc/add-transactional-email-to-rea…
Browse files Browse the repository at this point in the history
…dme-and-example

Add transactional email to README.md and example_test.go
  • Loading branch information
kk-no authored Feb 9, 2023
2 parents b432c27 + 20d4a03 commit afef880
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 11 deletions.
23 changes: 12 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,17 +201,18 @@ fmt.Println(customDeal.CustomA, customDeal.CustomB)

# API availability

|Category | API | Availability |
|-------------|-----------------|-----------------|
|CRM | Deal | Available |
|CRM | Contact | Available |
|CMS | All | Not Implemented |
|Conversations| All | Not Implemented |
|Events | All | Not Implemented |
|Marketing | Marketing Email | Available |
|Files | All | Not Implemented |
|Settings | All | Not Implemented |
|Webhooks | All | Not Implemented |
|Category | API | Availability |
|-------------|---------------------|-----------------|
|CRM | Deal | Available |
|CRM | Contact | Available |
|CMS | All | Not Implemented |
|Conversations| All | Not Implemented |
|Events | All | Not Implemented |
|Marketing | Marketing Email | Available |
|Marketing | Transactional Email | Available |
|Files | All | Not Implemented |
|Settings | All | Not Implemented |
|Webhooks | All | Not Implemented |

# Authentication availability

Expand Down
35 changes: 35 additions & 0 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,3 +453,38 @@ func ExampleMarketingEmailOp_ListStatistics() {

// // Output:
}

func ExampleTransactionalServiceOp_SendSingleEmail() {
cli, _ := hubspot.NewClient(hubspot.SetPrivateAppToken(os.Getenv("PRIVATE_APP_TOKEN")))

res, err := cli.Marketing.Transactional.SendSingleEmail(&hubspot.SendSingleEmailProperties{
EmailId: 0, // Set proper value.
Message: &hubspot.SendSingleEmailMessage{
To: "[email protected]",
From: "[email protected]",
SendId: "SEND_ID",
ReplyTo: []string{"[email protected]"},
Cc: []string{"[email protected]"},
Bcc: []string{"[email protected]"},
},
ContactProperties: &hubspot.Contact{
FirstName: hubspot.NewString("Bryan"),
LastName: hubspot.NewString("Cooper"),
Email: hubspot.NewString("[email protected]"),
MobilePhone: hubspot.NewString("(877) 929-0687"),
Zip: hubspot.NewString("1000001"),
},
CustomProperties: map[string]string{
"custom_email": "[email protected]",
"custom_firstname": "Bryan",
"custom_lastname": "Cooper",
},
})
if err != nil {
log.Fatal(err)
}

fmt.Printf("%+v", res)

// // Output:
}

0 comments on commit afef880

Please sign in to comment.