-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
edd4974
commit 414ece7
Showing
1 changed file
with
23 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,26 +71,28 @@ apiInstance.sendTransacEmail(sendSmtpEmail).then(function (data) { | |
------------------------------------------------------------------------------------------------------------------------- | ||
---------------------------------------------- Typescript supported with v2.1.1 -------------------------------------- | ||
------------------------------------------------------------------------------------------------------------------------- | ||
const SibApiV3Sdk = require('@getbrevo/brevo'); | ||
let apiInstance = new SibApiV3Sdk.TransactionalEmailsApi(); | ||
const brevo = require('@getbrevo/brevo'); | ||
let apiInstance = new brevo.TransactionalEmailsApi(); | ||
|
||
let apiKey = apiInstance.authentications['apiKey']; | ||
apiKey.apiKey = 'YOUR API KEY'; | ||
let sendSmtpEmail = new SibApiV3Sdk.SendSmtpEmail(); | ||
|
||
let sendSmtpEmail = new brevo.SendSmtpEmail(); | ||
|
||
sendSmtpEmail.subject = "My {{params.subject}}"; | ||
sendSmtpEmail.htmlContent = "<html><body><h1>This is my first transactional email {{params.parameter}}</h1></body></html>"; | ||
sendSmtpEmail.sender = {"name":"John Doe","email":"[email protected]"}; | ||
sendSmtpEmail.to = [{"email":"[email protected]","name":"Jane Doe"}]; | ||
sendSmtpEmail.cc = [{"email":"[email protected]","name":"Janice Doe"}]; | ||
sendSmtpEmail.bcc = [{"name":"John Doe","email":"[email protected]"}]; | ||
sendSmtpEmail.replyTo = {"email":"[email protected]","name":"John Doe"}; | ||
sendSmtpEmail.headers = {"Some-Custom-Name":"unique-id-1234"}; | ||
sendSmtpEmail.params = {"parameter":"My param value","subject":"New Subject"}; | ||
|
||
apiInstance.sendTransacEmail(sendSmtpEmail).then(function(data) { | ||
console.log('API called successfully. Returned data: ' + JSON.stringify(data)); | ||
sendSmtpEmail.htmlContent = "<html><body><h1>Common: This is my first transactional email {{params.parameter}}</h1></body></html>"; | ||
sendSmtpEmail.sender = { "name": "John", "email": "[email protected]" }; | ||
sendSmtpEmail.to = [ | ||
{ "email": "[email protected]", "name": "shubham upadhyay" } | ||
]; | ||
sendSmtpEmail.replyTo = { "email": "[email protected]", "name": "Shubham Upadhyay" }; | ||
sendSmtpEmail.headers = { "Some-Custom-Name": "unique-id-1234" }; | ||
sendSmtpEmail.params = { "parameter": "My param value", "subject": "common subject" }; | ||
|
||
}, function(error) { | ||
|
||
apiInstance.sendTransacEmail(sendSmtpEmail).then(function (data) { | ||
console.log('API called successfully. Returned data: ' + JSON.stringify(data)); | ||
}, function (error) { | ||
console.error(error); | ||
}); | ||
|
||
|
@@ -99,9 +101,9 @@ apiInstance.sendTransacEmail(sendSmtpEmail).then(function(data) { | |
## Get Contact attributes API example: | ||
```shell | ||
const SibApiV3Sdk = require('@getbrevo/brevo'); | ||
const brevo = require('@getbrevo/brevo'); | ||
|
||
let apiInstance = new SibApiV3Sdk.ContactsApi() | ||
let apiInstance = new brevo.ContactsApi() | ||
|
||
let apiKey = apiInstance.authentications['apiKey']; | ||
apiKey.apiKey = 'YOUR API KEY'; | ||
|
@@ -118,9 +120,9 @@ apiInstance.getAttributes().then(function(data) { | |
## Get Account API example: | ||
```shell | ||
const SibApiV3Sdk = require('@getbrevo/brevo'); | ||
const brevo = require('@getbrevo/brevo'); | ||
|
||
let apiInstance = new SibApiV3Sdk.AccountApi() | ||
let apiInstance = new brevo.AccountApi() | ||
|
||
let apiKey = apiInstance.authentications['apiKey']; | ||
apiKey.apiKey = 'YOUR API KEY'; | ||
|
@@ -136,9 +138,9 @@ apiInstance.getAccount().then(function(data) { | |
------------------------------------------------------------------------------------------------------------------------- | ||
## Get Contacts API example: | ||
```shell | ||
const SibApiV3Sdk = require('@getbrevo/brevo'); | ||
const brevo = require('@getbrevo/brevo'); | ||
|
||
let apiInstance = new SibApiV3Sdk.ContactsApi() | ||
let apiInstance = new brevo.ContactsApi() | ||
|
||
let apiKey = apiInstance.authentications['apiKey']; | ||
apiKey.apiKey = 'YOUR API KEY'; | ||
|