<?php 
defined('ABSPATH') or die('No script kiddies please!!');
if (!empty($form_details['general']['sendinblue_id']) || !empty($std_settings['sendinblue']['sendinblue_lists'])) {
    $settings_sendinblue_lists_obj = json_decode($std_settings['sendinblue']['sendinblue_lists']);
    $settings_sendinblue_lists = [];
    if (!empty($std_settings['sendinblue']['enable'])) {
        if (!empty($settings_sendinblue_lists_obj->lists)) {
            foreach ($settings_sendinblue_lists_obj->lists as $sendinblue_list) {
                $settings_sendinblue_lists[] = $sendinblue_list->id;
            }
        }
    }
    $sendinblue_lists = (!empty($form_details['general']['sendinblue_id'])) ? $form_details['general']['sendinblue_id'] : $settings_sendinblue_lists;
    if (!empty($sendinblue_lists)) {
        $post_parameters = [
            'email' => $form_data['std_email'],
            'attributes' => ['FIRSTNAME' => $fname, 'LASTNAME' => $lname],
            'listIds' => array_map('intval', $sendinblue_lists),
            'updateEnabled' => true
        ];
        /**
         * Filters parameters being sent to Mailerlite
         *
         * @param array $post_parameters
         * @param array $form_data
         * @param array $form_details
         */
        $post_parameters = apply_filters('std_sib_post_parameters', $post_parameters, $form_data, $form_details);

        $this->subscribe_to_sendinblue($post_parameters);
    }
}