承接 designbycode/laravel-brevo 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

designbycode/laravel-brevo

Composer 安装命令:

composer require designbycode/laravel-brevo

包简介

wrapper for brevo-php

README 文档

README

Latest Version on Packagist GitHub Tests Action Status GitHub Code Style Action Status Total Downloads

The LaravelBrevo package is a Laravel wrapper for integrating with the Brevo API (formerly Sendinblue). It simplifies interactions with Brevo's email marketing and contact management features, allowing you to manage contacts, subscribe/unsubscribe users, and retrieve contact information seamlessly within your Laravel application.

This version of the documentation demonstrates how to use the package via the Facade for cleaner and more expressive code.

Use Cases

This package is ideal for:

  1. Email Marketing:

    • Subscribe users to mailing lists.
    • Unsubscribe users from mailing lists.
    • Update user attributes (e.g., name, preferences).
  2. Contact Management:

    • Retrieve contact details.
    • Create or update contacts in Brevo.
  3. Automation:

    • Automatically add new users to Brevo lists during registration.
    • Sync user data between your application and Brevo.

Support us

Installation

You can install the package via composer:

composer require designbycode/laravel-brevo

You can publish the config file with:

php artisan vendor:publish --tag="brevo" 

Add your Brevo API key to the .env file:

BREVO_API_KEY=your-api-key

Configuration

return [
    'api_key' => env('BREVO_API_KEY', ''),
];

api_key: Your Brevo API key. This is required to authenticate API requests.

Usage

Retrieve Contact Information.

To retrieve details for a specific contact by email:

use Designbycode\LaravelBrevo\Facades\Brevo;

if ($contact = Brevo::getContactInfo('test@example.com')) {
    echo "Contact Name: " . $contact->getAttributes()->name;
} else {
    echo "Contact not found.";
}

Subscribe a Contact

To subscribe a contact to a mailing list:

use Designbycode\LaravelBrevo\Facades\Brevo;
if ($success = Brevo::subscribe('test@example.com', $listId)) {
    echo "Contact subscribed successfully!";
} else {
    echo "Failed to subscribe contact.";
}

Unsubscribe a Contact

To unsubscribe a contact from a mailing list:

use Designbycode\LaravelBrevo\Facades\Brevo;

if ($success = Brevo::unsubscribe('test@example.com', $listId)) {
    echo "Contact unsubscribed successfully!";
} else {
    echo "Failed to unsubscribe contact.";
}

Methods

Brevo::getContactInfo(string $email): ?GetExtendedContactDetails

  • Retrieves contact details for the specified email.
  • Returns null if the contact is not found.

Brevo::subscribe(string $email, int $listId, array $attributes = []): bool

  • Subscribes a contact to a mailing list.
  • Creates a new contact if they don't exist, or updates an existing contact.
  • Returns true on success, false on failure.

Brevo::unsubscribe(string $email, int $listId): bool

  • Unsubscribes a contact from a mailing list.
  • Returns true on success, false on failure.

Error Handling

The package handles API errors gracefully:

  • 404 Not Found: Logs a warning and returns null or false.
  • 500 Server Error: Logs an error and returns false.
  • Other exceptions are logged and handled appropriately.

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

designbycode/laravel-brevo 适用场景与选型建议

designbycode/laravel-brevo 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 29 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 01 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「laravel」 「designbycode」 「laravel-brevo」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 designbycode/laravel-brevo 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 designbycode/laravel-brevo 我们能提供哪些服务?
定制开发 / 二次开发

基于 designbycode/laravel-brevo 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

与 designbycode/laravel-brevo 相关的其它包

同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:

designbycode/luhn-algorithm 1

The Luhn Algorithm is a simple checksum formula used to validate a variety of identification numbers, such as credit card numbers, IMEI numbers, and others. This documentation provides an overview of the Luhn Algorithm implementation in PHP, including examples and use cases.

designbycode/business-name-generator 1

The Business Name Generator is a PHP class that generates business names based on a combination of adjectives and nouns. It provides a flexible and customizable way to generate business names that can be used for various purposes.

foxtes/alfabank-rest 1

Alfabank REST API integration

designbycode/google-maps-place-details 1

The Reviews class is a part of the Designbycode namespace and is used to fetch reviews, rating, and user ratings total of a place using the Google Places API. It requires a Google Maps API key and a Google Maps place ID to make requests.

designbycode/levenshtein-distance 1

The LevenshteinDistance class provides a method to calculate the Levenshtein distance between two strings. The Levenshtein distance is a measure of the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one word into the other.

designbycode/south-african-id-validator 0

The South African ID Validator is a PHP class that validates and extracts information from South African ID numbers. It uses the Luhn Algorithm to validate the ID number and provides methods to determine the gender, citizenship, and birthdate of the individual.

统计信息

  • 总下载量: 29
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 22
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-22