/** ajax module for send test email */ public static function ajax_send_email() { $to = array($_POST['email'] => ''); $subject = __('[SendinBlue SMTP] test email', 'sib_lang'); $fromname = __('SendinBlue', 'sib_lang'); $from_email = __('*****@*****.**', 'sib_lang'); $from = array($from_email, $fromname); $null_array = array(); $email_templates = SIB_Manager::get_email_template('test'); $text = $email_templates['text_content']; $html = $email_templates['html_content']; $html = str_replace('{title}', $subject, $html); $mailin = new Mailin(SIB_Manager::sendinblue_api_url, SIB_Manager::$access_key); $headers = array("Content-Type" => "text/html;charset=iso-8859-1", "X-Mailin-tag" => 'Wordpress Mailin Test'); $data = array("to" => $to, "subject" => $subject, "from" => $from, "text" => $email_templates['text_content'], "html" => $html, "headers" => $headers); $result = $mailin->send_email($data); echo 'success'; die; }
/** ajax module for send test email */ function ajax_send_email() { $to = array($_POST['email'] => ''); $subject = __('[SendinBlue SMTP] test email', 'sib_lang'); $fromname = __('SendinBlue', 'sib_lang'); $from_email = __('*****@*****.**', 'sib_lang'); $from = array($from_email, $fromname); $null_array = array(); $email_templates = SIB_Manager::get_email_template('test'); $text = $email_templates['text_content']; $html = $email_templates['html_content']; $html = str_replace('{title}', $subject, $html); $mailin = new Mailin('https://api.sendinblue.com/v1.0', SIB_Manager::$access_key, SIB_Manager::$secret_key); $headers = array(); $mailin->send_email($to, $subject, $from, $html, $text, $null_array, $null_array, $from, $null_array, $headers); echo 'success'; die; }