Skip to content

tsubotitsch/Brevo

Repository files navigation

Brevo - A PowerShell module to automate your Brevo environment

PowerShell Gallery Version PowerShell Gallery Downloads Platform GitHub Issues

Brevo is a versatile digital marketing platform that enables businesses to streamline customer communication through multiple channels, including email, SMS, and more.

This PowerShell module contains functions to automate Brevo via the Brevo API

See Brevo API documentation

Functions

General Contact Management Marketing Account and Settings
Connect-Brevo Add-BrevoContactListMember Get-BrevoEmailCampaign Get-BrevoUser
Disconnect-Brevo Get-BrevoContact Remove-BrevoEmailCampaign Get-BrevoUserActivitylog
Invoke-BrevoCall Get-BrevoContactAttribute Send-BrevoEmailCampaign Get-BrevoUserPermission
Get-BrevoContactFolder Send-BrevoUserInvitation
Get-BrevoContactList
Get-BrevoContactListMember Confirm-BrevoDomain
Get-BrevoContactSegment Get-BrevoDomain
Import-BrevoContact New-BrevoDomain
New-BrevoContact Remove-BrevoDomain
Update-BrevoContact Get-BrevoAccount
Remove-BrevoContact Get-BrevoSender
New-BrevoContactList
New-BrevoDomain
Remove-BrevoDomain
Test-BrevoDomain

How to start?

# PowerShellGet 2.x
Install-Module -Name Brevo -Repository PSGallery

# PowerShellGet 3.x
Install-PSResource -Name Brevo

Import-Module Brevo

# List all available cmdlets provided by the module
Get-Command -Module Brevo

# Disconnect from Brevo
Disconnect-Brevo

1st steps

You have to have an API key first. Using your API key to authenticate

  • Login to Brevo.com or register for free
  • Navigate to My Profile > SMTP & API > API-Key > Generate ne API Key
  • Copy the generated key for later use
# Create Credentials
# $apikey = Get-credential -Message "Please enter your Brevo API key (username doesn't matter)"
# $apikey | Export-Clixml -Path ".\Brevo-APIkey.local.xml"

$apikey = Import-Clixml -Path ".\Brevo-APIkey.local.xml"

Connect-Brevo -APIkey $apikey

Retrieving data

List all attributes

Get-BrevoContactAttributes

List all contact folders

Get-BrevoContactFolder | Format-Table

List all contact lists

Get-BrevoContactList | Format-Table

Creating data

Create a contact folder

New-BrevoContactFolder -Name "MyFolder01"

Create a contact list

$ContactFolder = Get-BrevoContactFolder | Where-Object { $_.name -eq "MyFolder01" }
New-BrevoContactList -Name "MyList" -FolderId $ContactFolder.id

Create a contact attribute

New-BrevoContactAttribute -attributeCategory normal -type text -attributeName USERTYPE

Create a new contact

New-BrevoContact -Email "test01@example.org" -attributes @{FNAME="Elly"; LNAME="Roger";COUNTRIES=@("India","China")} -listIds 22,355

About

PowerShell CmdLets for Brevo API

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •