: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
'wpcf7_pre_construct_contact_form_properties',
'wpcf7_sendinblue_register_property',
* Registers the sendinblue contact form property.
function wpcf7_sendinblue_register_property( $properties, $contact_form ) {
$service = WPCF7_Sendinblue::get_instance();
if ( $service->is_active() ) {
'wpcf7_save_contact_form',
'wpcf7_sendinblue_save_contact_form',
* Saves the sendinblue property value.
function wpcf7_sendinblue_save_contact_form( $contact_form, $args, $context ) {
$service = WPCF7_Sendinblue::get_instance();
if ( ! $service->is_active() ) {
$prop = (array) ( $_POST['wpcf7-sendinblue'] ?? array() );
'enable_contact_list' => false,
'contact_lists' => array(),
'enable_transactional_email' => false,
$prop['contact_lists'] = array_map( 'absint', $prop['contact_lists'] );
$prop['email_template'] = absint( $prop['email_template'] );
$contact_form->set_properties( array(
'wpcf7_sendinblue_editor_panels',
* Builds the editor panel for the sendinblue property.
function wpcf7_sendinblue_editor_panels( $panels ) {
$service = WPCF7_Sendinblue::get_instance();
if ( ! $service->is_active() ) {
$contact_form = WPCF7_ContactForm::get_current();
$contact_form->prop( 'sendinblue' ),
'enable_contact_list' => false,
'contact_lists' => array(),
'enable_transactional_email' => false,
$editor_panel = static function () use ( $prop, $service ) {
__( "You can set up the Brevo integration here. For details, see %s.", 'contact-form-7' )
__( 'https://contactform7.com/sendinblue-integration/', 'contact-form-7' ),
__( 'Brevo integration', 'contact-form-7' )
$lists = wpcf7_sendinblue_get_lists();
$templates = $service->get_templates();
<h2><?php echo esc_html( __( 'Brevo', 'contact-form-7' ) ); ?></h2>
<legend><?php echo $description; ?></legend>
<table class="form-table" role="presentation">
<tr class="<?php echo $prop['enable_contact_list'] ? '' : 'inactive'; ?>">
echo esc_html( __( 'Contact lists', 'contact-form-7' ) );
<legend class="screen-reader-text">
echo esc_html( __( 'Contact lists', 'contact-form-7' ) );
<label for="wpcf7-sendinblue-enable-contact-list">
<input type="checkbox" name="wpcf7-sendinblue[enable_contact_list]" id="wpcf7-sendinblue-enable-contact-list" value="1" <?php checked( $prop['enable_contact_list'] ); ?> />
__( "Add form submitters to your contact lists", 'contact-form-7' )
esc_html( __( 'Select lists to which contacts are added:', 'contact-form-7' ) )
foreach ( $lists as $list ) {
'<li><label><input %1$s /> %2$s</label></li>',
wpcf7_format_atts( array(
'name' => 'wpcf7-sendinblue[contact_lists][]',
'checked' => in_array( $list['id'], $prop['contact_lists'] ),
esc_html( $list['name'] )
esc_html( __( 'You have no contact list yet.', 'contact-form-7' ) )
'<p><a %1$s>%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
wpcf7_format_atts( array(
'href' => 'https://my.sendinblue.com/lists',
'rel' => 'external noreferrer noopener',
esc_html( __( 'Manage your contact lists', 'contact-form-7' ) ),
esc_html( __( '(opens in a new tab)', 'contact-form-7' ) )
<tr class="<?php echo $prop['enable_transactional_email'] ? '' : 'inactive'; ?>">
echo esc_html( __( 'Welcome email', 'contact-form-7' ) );
<legend class="screen-reader-text">
echo esc_html( __( 'Welcome email', 'contact-form-7' ) );
<label for="wpcf7-sendinblue-enable-transactional-email">
<input type="checkbox" name="wpcf7-sendinblue[enable_transactional_email]" id="wpcf7-sendinblue-enable-transactional-email" value="1" <?php checked( $prop['enable_transactional_email'] ); ?> />
__( "Send a welcome email to new contacts", 'contact-form-7' )
esc_html( __( 'Select an email template:', 'contact-form-7' ) )
echo '<select name="wpcf7-sendinblue[email_template]">';
'<option %1$s>%2$s</option>',
wpcf7_format_atts( array(
'selected' => 0 === $prop['email_template'],
esc_html( __( '— Select —', 'contact-form-7' ) )
foreach ( $templates as $template ) {
'<option %1$s>%2$s</option>',
wpcf7_format_atts( array(
'value' => $template['id'],
'selected' => $prop['email_template'] === $template['id'],
esc_html( $template['name'] )
esc_html( __( 'You have no active email template yet.', 'contact-form-7' ) )
'<p><a %1$s>%2$s <span class="screen-reader-text">%3$s</span><span aria-hidden="true" class="dashicons dashicons-external"></span></a></p>',
wpcf7_format_atts( array(
'href' => 'https://my.sendinblue.com/camp/lists/template',
'rel' => 'external noreferrer noopener',
esc_html( __( 'Manage your email templates', 'contact-form-7' ) ),
esc_html( __( '(opens in a new tab)', 'contact-form-7' ) )
'sendinblue-panel' => array(
'title' => __( 'Brevo', 'contact-form-7' ),
'callback' => $editor_panel,
* Retrieves contact lists from Brevo's database.
function wpcf7_sendinblue_get_lists() {
$service = WPCF7_Sendinblue::get_instance();
if ( ! empty( $lists ) or ! $service->is_active() ) {
while ( count( $lists ) < $limit * 10 ) {
$lists_next = (array) $service->get_lists( array(
if ( ! empty( $lists_next ) ) {
$lists = array_merge( $lists, $lists_next );
if ( count( $lists_next ) < $limit ) {