Skip to content

Conversation

@caronc
Copy link
Owner

@caronc caronc commented Nov 23, 2025

Description:

Related issue (if applicable): #1441

This PR adds first-class support for Brevo (formerly SendinBlue) as an email notification provider, modelled on the existing SendGrid and Resend plugins. The new brevo:// plugin uses Brevo’s transactional email API (/v3/smtp/email), supports HTML and plain-text content, CC/BCC, Reply-To, and file attachments, and follows the existing Apprise URL and testing conventions.


Brevo Notifications

Brevo is a transactional email platform that exposes a JSON HTTP API for sending mail. The new NotifyBrevo plugin integrates this API with Apprise, using a URL schema consistent with other email providers such as SendGrid and Resend. The plugin:

  • Authenticates using a Brevo API key provided in the URL.
  • Requires a verified “From” address as part of the URL.
  • Accepts recipients from both the URL path and an optional to= query parameter.
  • Supports CC, BCC, and Reply-To addresses.
  • Sends HTML by default, with an automatic text conversion for textContent.
  • Supports file attachments via Brevo’s attachments payload field, using AppriseAttachment and base64 encoding.
  • Implements per-target sending with partial success handling and HTTP error mapping.

The README email table has also been updated to include Brevo alongside other email services, with example syntax consistent with the URL parser.

🛠️ Setup Instructions

  1. Visit https://www.brevo.com/ and sign in to your Brevo account.
  2. Navigate to SMTP & API in your account, then create a Transactional email API key with permission to send email.
  3. Copy the generated API key. This will be used as the APIToken part of your Apprise URL.
  4. Ensure you have at least one verified sender address or authenticated sending domain configured in Brevo. The From Email used in Apprise must be a valid sender, or Brevo will reject the request.
  5. Construct your brevo:// URL using the syntax below, substituting your API key, From address, and target recipients.
  6. Use this URL in your Apprise configuration file or CLI calls.

⚠️ Brevo may send you a confirmation email (subject: Security Alert: Verify a new IP) indicating that Someone tried to use your organization account and make an API call with an IP address you have never used before. We wanted to check this activity with you.. You then need to use the confirmation link to approve the IP in question. From that point forward Apprise should work uninterrupted.


✅ Apprise Support

Syntax

Valid syntax is as follows:

The plugin URL template is:

  • {schema}://{apikey}:{from_email}
  • {schema}://{apikey}:{from_email}/{targets}

🔐 Parameter Breakdown

Variable Required Description
APIToken Yes Your Brevo transactional API key (api-key header value).
FromEmail Yes Verified sender email address in Brevo (sender.email).
ToEmail No One or more recipient email addresses in the URL path.
to No Additional recipients as a comma-separated list in the query string.
cc No Carbon-copy recipients, comma-separated.
bcc No Blind carbon-copy recipients, comma-separated.
reply No Reply-To header, optionally including a display name.
format No Overrides default format (html or text), consistent with Apprise core.

Examples

Send a basic Brevo notification to yourself (from and to are the same):

apprise -vv -t "Test Title" -b "Test Message"   brevo://APIToken:[email protected]

Send an email from [email protected] to a single recipient:

apprise -vv -t "Deployment Complete" -b "The release finished successfully."   brevo://APIToken:[email protected]/[email protected]

Send to multiple recipients with CC, BCC and a Reply-To header:

apprise -vv -t "Incident Report" -b "See attached logs for details."   "brevo://APIToken:[email protected]/[email protected]""[email protected],[email protected]""&[email protected]""&[email protected]""&reply=Support%20Desk%20<[email protected]>"

Send with an attachment:

apprise -vv -t "Nightly Report" -b "Attached is the latest report."   --attach /path/to/report.pdf   brevo://APIToken:[email protected]/[email protected]

New Service Completion Status

  • apprise/plugins/brevo.py
  • pyproject.toml update keywords section to identify our new service (Brevo added alphabetically between “BlueSky” and “BulkSMS”).
  • README.md
    • Added Brevo entry to the Supported Notifications table under Email Notifications.
  • packaging/redhat/python-apprise.spec
    • Updated %global common_description list to mention Brevo (email) support.

Checklist

  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • No lint errors (use tox -e lint and even tox -e format to autofix what it can)
  • Test coverage added (use tox -e minimal)

Notes:

  • A dedicated test_plugin_brevo.py has been added with AppriseURLTester coverage for malformed URLs, good URLs, privacy behaviour, HTTP failure mapping, request exceptions, and attachment handling.

Testing

Anyone can help test this source code as follows:

# Create a virtual environment to work in as follows:
python3 -m venv apprise

# Change into our new directory
cd apprise

# Activate our virtual environment
source bin/activate

# Install the branch
pip install git+https://github.com/caronc/apprise.git@1441-brevo-support

# Test out the changes with the following command:
apprise -t "Test Title" -b "Test Message"   brevo://APIToken:[email protected]/[email protected]

# If you have cloned the branch and have tox available to you
# the following can also allow you to test:
tox -e apprise -- -t "Test Title" -b "Test Message"   brevo://APIToken:[email protected]/[email protected]

@codecov
Copy link

codecov bot commented Nov 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.66%. Comparing base (4705bc6) to head (dc7b5ad).

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1455    +/-   ##
========================================
  Coverage   99.65%   99.66%            
========================================
  Files         176      177     +1     
  Lines       22853    23013   +160     
  Branches     3650     3681    +31     
========================================
+ Hits        22775    22935   +160     
  Misses         70       70            
  Partials        8        8            
Files with missing lines Coverage Δ
apprise/plugins/brevo.py 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@caronc
Copy link
Owner Author

caronc commented Nov 29, 2025

Thank you! I set up the wiki now and added the warning you identified.

Can you do one last check for me and confirm if you can also --attach a file too using this?

Otherwise i think we're good to go for a full merge! I really appreciate all of your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants