Modules@robinpath/brevo
brevo

@robinpath/brevo

0.1.2Node.jsPublic

Brevo module for RobinPath.

Brevo

Brevo module for RobinPath.

Package: @robinpath/brevo | Category: Email Marketing | Type: Integration

Authentication

brevo.setCredentials "your-credentials"

Call this once at the start of your script before using any other function. Credentials persist for the duration of the script execution.

Use Cases

Use the brevo module when you need to:

  • sendTransactionalEmail -- Use brevo.sendTransactionalEmail to perform this operation
  • sendTransactionalSms -- Use brevo.sendTransactionalSms to perform this operation
  • listContacts -- Use brevo.listContacts to perform this operation
  • getContact -- Use brevo.getContact to perform this operation
  • createContact -- Use brevo.createContact to perform this operation

Quick Reference

FunctionDescriptionReturns
setCredentialsConfigure brevo credentials.object
sendTransactionalEmailsendTransactionalEmailobject
sendTransactionalSmssendTransactionalSmsobject
listContactslistContactsobject
getContactgetContactobject
createContactcreateContactobject
updateContactupdateContactobject
deleteContactdeleteContactobject
listListslistListsobject
getListgetListobject
createListcreateListobject
addContactToListaddContactToListobject
removeContactFromListremoveContactFromListobject
listCampaignslistCampaignsobject
getCampaigngetCampaignobject
createEmailCampaigncreateEmailCampaignobject
sendCampaignsendCampaignobject
getEmailEventsgetEmailEventsobject
importContactsimportContactsobject

Functions

setCredentials

Configure brevo credentials.

Module: brevo | Returns: object -- API response.

brevo.setCredentials
ParameterTypeRequiredDescription
apiKeystringYesapiKey

sendTransactionalEmail

sendTransactionalEmail

Module: brevo | Returns: object -- API response.

brevo.sendTransactionalEmail
ParameterTypeRequiredDescription
inputstringNoInput parameter

sendTransactionalSms

sendTransactionalSms

Module: brevo | Returns: object -- API response.

brevo.sendTransactionalSms
ParameterTypeRequiredDescription
inputstringNoInput parameter

listContacts

listContacts

Module: brevo | Returns: object -- API response.

brevo.listContacts
ParameterTypeRequiredDescription
inputstringNoInput parameter

getContact

getContact

Module: brevo | Returns: object -- API response.

brevo.getContact
ParameterTypeRequiredDescription
inputstringNoInput parameter

createContact

createContact

Module: brevo | Returns: object -- API response.

brevo.createContact
ParameterTypeRequiredDescription
inputstringNoInput parameter

updateContact

updateContact

Module: brevo | Returns: object -- API response.

brevo.updateContact
ParameterTypeRequiredDescription
inputstringNoInput parameter

deleteContact

deleteContact

Module: brevo | Returns: object -- API response.

brevo.deleteContact
ParameterTypeRequiredDescription
inputstringNoInput parameter

listLists

listLists

Module: brevo | Returns: object -- API response.

brevo.listLists
ParameterTypeRequiredDescription
inputstringNoInput parameter

getList

getList

Module: brevo | Returns: object -- API response.

brevo.getList
ParameterTypeRequiredDescription
inputstringNoInput parameter

createList

createList

Module: brevo | Returns: object -- API response.

brevo.createList
ParameterTypeRequiredDescription
inputstringNoInput parameter

addContactToList

addContactToList

Module: brevo | Returns: object -- API response.

brevo.addContactToList
ParameterTypeRequiredDescription
inputstringNoInput parameter

removeContactFromList

removeContactFromList

Module: brevo | Returns: object -- API response.

brevo.removeContactFromList
ParameterTypeRequiredDescription
inputstringNoInput parameter

listCampaigns

listCampaigns

Module: brevo | Returns: object -- API response.

brevo.listCampaigns
ParameterTypeRequiredDescription
inputstringNoInput parameter

getCampaign

getCampaign

Module: brevo | Returns: object -- API response.

brevo.getCampaign
ParameterTypeRequiredDescription
inputstringNoInput parameter

createEmailCampaign

createEmailCampaign

Module: brevo | Returns: object -- API response.

brevo.createEmailCampaign
ParameterTypeRequiredDescription
inputstringNoInput parameter

sendCampaign

sendCampaign

Module: brevo | Returns: object -- API response.

brevo.sendCampaign
ParameterTypeRequiredDescription
inputstringNoInput parameter

getEmailEvents

getEmailEvents

Module: brevo | Returns: object -- API response.

brevo.getEmailEvents
ParameterTypeRequiredDescription
inputstringNoInput parameter

importContacts

importContacts

Module: brevo | Returns: object -- API response.

brevo.importContacts
ParameterTypeRequiredDescription
inputstringNoInput parameter

Error Handling

All functions throw on failure. Common errors:

ErrorCause
Brevo API error (${res.status}): ${t}Check the error message for details
brevo.setCredentials requires apiKey.Check the error message for details
brevo.updateContact requires an ID.Check the error message for details
brevo.deleteContact requires an ID.Check the error message for details
brevo.removeContactFromList requires an ID.Check the error message for details
Brevo: "..." not configured. Call brevo.setCredentials first.Check the error message for details
@desc "Send transactional email and validate result"
do
  set $result as brevo.sendTransactionalEmail
  if $result != null
    print "Success"
  else
    print "No result"
  end
enddo

Recipes

1. List and iterate Contacts

Retrieve all items and loop through them.

@desc "Setup authentication"
do
  brevo.setCredentials $token
enddo

@desc "List contacts and iterate results"
do
  set $result as brevo.listContacts
  each $item in $result
    print $item
  end
enddo

2. Create a new item with sendTransactionalEmail

Create a new resource and capture the result.

@desc "Setup authentication"
do
  brevo.setCredentials $token
enddo

@desc "Send transactional email"
do
  set $result as brevo.sendTransactionalEmail
  print "Created: " + $result
enddo

3. Create and update workflow

Create an item and then update it.

@desc "Setup authentication"
do
  brevo.setCredentials $token
enddo

@desc "Send transactional email and update contact"
do
  set $created as brevo.sendTransactionalEmail
  # Update the created item
  brevo.updateContact
enddo

4. Check before creating

List existing items and only create if needed.

@desc "Setup authentication"
do
  brevo.setCredentials $token
enddo

@desc "List contacts and send transactional email"
do
  set $existing as brevo.listContacts
  if $existing == null
    brevo.sendTransactionalEmail
    print "Item created"
  else
    print "Item already exists"
  end
enddo

5. Multi-step Brevo workflow

Chain multiple brevo operations together.

@desc "Setup authentication"
do
  brevo.setCredentials $token
enddo

@desc "Send transactional email, send transactional sms, and more"
do
  set $r_sendTransactionalEmail as brevo.sendTransactionalEmail
  set $r_sendTransactionalSms as brevo.sendTransactionalSms
  set $r_listContacts as brevo.listContacts
  print "All operations complete"
enddo

6. Safe sendTransactionalEmail with validation

Check results before proceeding.

@desc "Setup authentication"
do
  brevo.setCredentials $token
enddo

@desc "Send transactional email and validate result"
do
  set $result as brevo.sendTransactionalEmail
  if $result != null
    print "Success: " + $result
  else
    print "Operation returned no data"
  end
enddo

Related Modules

  • activecampaign -- ActiveCampaign module for complementary functionality
  • convertkit -- Convertkit module for complementary functionality
  • mailchimp -- Mailchimp module for complementary functionality
  • sendgrid -- SendGrid module for complementary functionality
  • lemlist -- Lemlist module for complementary functionality

Versions (1)

VersionTagPublished
0.1.2latest1 months ago
Install
$ robinpath add @robinpath/brevo

Collaborators

Dumitru Balaban
Dumitru Balaban
@dumitru
View all @robinpath modules
Version0.1.2
LicenseMIT
Unpacked Size4.8 KB
Versions1
Weekly Downloads26
Total Downloads26
Stars0
Last Publish1 months ago
Created1 months ago

Category

marketing