Skip to content

Commit afef880

Browse files
authored
Merge pull request #13 from belong-inc/add-transactional-email-to-readme-and-example
Add transactional email to README.md and example_test.go
2 parents b432c27 + 20d4a03 commit afef880

File tree

2 files changed

+47
-11
lines changed

2 files changed

+47
-11
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -201,17 +201,18 @@ fmt.Println(customDeal.CustomA, customDeal.CustomB)
201201

202202
# API availability
203203

204-
|Category | API | Availability |
205-
|-------------|-----------------|-----------------|
206-
|CRM | Deal | Available |
207-
|CRM | Contact | Available |
208-
|CMS | All | Not Implemented |
209-
|Conversations| All | Not Implemented |
210-
|Events | All | Not Implemented |
211-
|Marketing | Marketing Email | Available |
212-
|Files | All | Not Implemented |
213-
|Settings | All | Not Implemented |
214-
|Webhooks | All | Not Implemented |
204+
|Category | API | Availability |
205+
|-------------|---------------------|-----------------|
206+
|CRM | Deal | Available |
207+
|CRM | Contact | Available |
208+
|CMS | All | Not Implemented |
209+
|Conversations| All | Not Implemented |
210+
|Events | All | Not Implemented |
211+
|Marketing | Marketing Email | Available |
212+
|Marketing | Transactional Email | Available |
213+
|Files | All | Not Implemented |
214+
|Settings | All | Not Implemented |
215+
|Webhooks | All | Not Implemented |
215216

216217
# Authentication availability
217218

example_test.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -453,3 +453,38 @@ func ExampleMarketingEmailOp_ListStatistics() {
453453

454454
// // Output:
455455
}
456+
457+
func ExampleTransactionalServiceOp_SendSingleEmail() {
458+
cli, _ := hubspot.NewClient(hubspot.SetPrivateAppToken(os.Getenv("PRIVATE_APP_TOKEN")))
459+
460+
res, err := cli.Marketing.Transactional.SendSingleEmail(&hubspot.SendSingleEmailProperties{
461+
EmailId: 0, // Set proper value.
462+
Message: &hubspot.SendSingleEmailMessage{
463+
To: "to@example.com",
464+
From: "from@example.com",
465+
SendId: "SEND_ID",
466+
ReplyTo: []string{"reply@example.com"},
467+
Cc: []string{"cc@example.com"},
468+
Bcc: []string{"bcc@example.com"},
469+
},
470+
ContactProperties: &hubspot.Contact{
471+
FirstName: hubspot.NewString("Bryan"),
472+
LastName: hubspot.NewString("Cooper"),
473+
Email: hubspot.NewString("hubspot@example.com"),
474+
MobilePhone: hubspot.NewString("(877) 929-0687"),
475+
Zip: hubspot.NewString("1000001"),
476+
},
477+
CustomProperties: map[string]string{
478+
"custom_email": "hubspot@example.com",
479+
"custom_firstname": "Bryan",
480+
"custom_lastname": "Cooper",
481+
},
482+
})
483+
if err != nil {
484+
log.Fatal(err)
485+
}
486+
487+
fmt.Printf("%+v", res)
488+
489+
// // Output:
490+
}

0 commit comments

Comments
 (0)