Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamUpadhyayInBlue authored Jun 11, 2024
1 parent edd4974 commit 414ece7
Showing 1 changed file with 23 additions and 21 deletions.
44 changes: 23 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});

Expand All @@ -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';
Expand All @@ -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';
Expand All @@ -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';
Expand Down

0 comments on commit 414ece7

Please sign in to comment.