Version Description
- Fixed an issue with all templates on Sendinblue account not showing on plugin configuration..
Download this release
Release Info
Developer | amarsib |
Plugin | SendinBlue Subscribe Form And WP SMTP |
Version | 3.1.21 |
Comparing to | |
See all releases |
Code changes from version 3.1.20 to 3.1.21
- inc/SendinblueApiClient.php +31 -1
- inc/sib-api-manager.php +2 -5
- page/page-form.php +0 -18
- readme.txt +3 -0
- sendinblue.php +1 -1
inc/SendinblueApiClient.php
CHANGED
@@ -14,7 +14,7 @@ class SendinblueApiClient
|
|
14 |
const RESPONSE_CODE_CREATED = 201;
|
15 |
const RESPONSE_CODE_ACCEPTED = 202;
|
16 |
const RESPONSE_CODE_UNAUTHORIZED = 401;
|
17 |
-
const PLUGIN_VERSION = '3.1.
|
18 |
const USER_AGENT = 'sendinblue_plugins/wordpress';
|
19 |
|
20 |
private $apiKey;
|
@@ -386,4 +386,34 @@ class SendinblueApiClient
|
|
386 |
{
|
387 |
return $this->lastResponseCode;
|
388 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
389 |
}
|
14 |
const RESPONSE_CODE_CREATED = 201;
|
15 |
const RESPONSE_CODE_ACCEPTED = 202;
|
16 |
const RESPONSE_CODE_UNAUTHORIZED = 401;
|
17 |
+
const PLUGIN_VERSION = '3.1.21';
|
18 |
const USER_AGENT = 'sendinblue_plugins/wordpress';
|
19 |
|
20 |
private $apiKey;
|
386 |
{
|
387 |
return $this->lastResponseCode;
|
388 |
}
|
389 |
+
|
390 |
+
/**
|
391 |
+
* @param $data
|
392 |
+
* @return mixed all template list
|
393 |
+
*/
|
394 |
+
public function getAllEmailTemplates() {
|
395 |
+
$templates = array(
|
396 |
+
'templates' => array(),
|
397 |
+
'count' => 0,
|
398 |
+
);
|
399 |
+
$offset = 0;
|
400 |
+
$limit = 50;
|
401 |
+
do {
|
402 |
+
$template_data = $this->getEmailTemplates(
|
403 |
+
array(
|
404 |
+
'templateStatus' => true,
|
405 |
+
'limit' => $limit,
|
406 |
+
'offset' => $offset,
|
407 |
+
)
|
408 |
+
);
|
409 |
+
if ( empty( $template_data ) ) {
|
410 |
+
break;
|
411 |
+
}
|
412 |
+
$templates['templates'] = array_merge( $templates['templates'], $template_data['templates'] );
|
413 |
+
$offset += 50;
|
414 |
+
} while ( ! empty( $templates['templates'] ) && count( $templates['templates'] ) < $template_data['count'] );
|
415 |
+
$templates['count'] = count( $templates['templates'] );
|
416 |
+
|
417 |
+
return $templates;
|
418 |
+
}
|
419 |
}
|
inc/sib-api-manager.php
CHANGED
@@ -117,11 +117,8 @@ if ( ! class_exists( 'SIB_API_Manager' ) ) {
|
|
117 |
$templates = get_transient( 'sib_template_' . md5( SIB_Manager::$access_key ) );
|
118 |
|
119 |
if ( false === $templates || false == $templates ) {
|
120 |
-
$mailin
|
121 |
-
$
|
122 |
-
'templateStatus' => true
|
123 |
-
);
|
124 |
-
$templates = $mailin->getEmailTemplates( $data );
|
125 |
$template_data = array();
|
126 |
|
127 |
if ( $mailin->getLastResponseCode() === SendinblueApiClient::RESPONSE_CODE_OK ) {
|
117 |
$templates = get_transient( 'sib_template_' . md5( SIB_Manager::$access_key ) );
|
118 |
|
119 |
if ( false === $templates || false == $templates ) {
|
120 |
+
$mailin = new SendinblueApiClient();
|
121 |
+
$templates = $mailin->getAllEmailTemplates();
|
|
|
|
|
|
|
122 |
$template_data = array();
|
123 |
|
124 |
if ( $mailin->getLastResponseCode() === SendinblueApiClient::RESPONSE_CODE_OK ) {
|
page/page-form.php
CHANGED
@@ -990,24 +990,6 @@ For your information, you cannot select a template with the tag [DOUBLEOPTIN].',
|
|
990 |
}
|
991 |
}
|
992 |
|
993 |
-
/**
|
994 |
-
* Get template lists of sendinblue
|
995 |
-
*/
|
996 |
-
public static function get_template_lists() {
|
997 |
-
$mailin = new SendinblueApiClient();
|
998 |
-
$data = array(
|
999 |
-
'templateStatus' => true
|
1000 |
-
);
|
1001 |
-
$response = $mailin->getEmailTemplates( $data );
|
1002 |
-
if ( $mailin->getLastResponseCode() === SendinblueApiClient::RESPONSE_CODE_OK) {
|
1003 |
-
return $response['templates'];
|
1004 |
-
}
|
1005 |
-
else {
|
1006 |
-
return null;
|
1007 |
-
}
|
1008 |
-
}
|
1009 |
-
|
1010 |
-
|
1011 |
/** Ajax process when change template id */
|
1012 |
public static function ajax_change_template() {
|
1013 |
check_ajax_referer( 'ajax_sib_admin_nonce', 'security' );
|
990 |
}
|
991 |
}
|
992 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
993 |
/** Ajax process when change template id */
|
994 |
public static function ajax_change_template() {
|
995 |
check_ajax_referer( 'ajax_sib_admin_nonce', 'security' );
|
readme.txt
CHANGED
@@ -116,6 +116,9 @@ In order to create a signup form, you need to:
|
|
116 |
|
117 |
== Changelog ==
|
118 |
|
|
|
|
|
|
|
119 |
= 3.1.20 =
|
120 |
* Fixing issue with plugin deactivation on update.
|
121 |
|
116 |
|
117 |
== Changelog ==
|
118 |
|
119 |
+
= 3.1.21 =
|
120 |
+
* Fixed an issue with all templates on Sendinblue account not showing on plugin configuration..
|
121 |
+
|
122 |
= 3.1.20 =
|
123 |
* Fixing issue with plugin deactivation on update.
|
124 |
|
sendinblue.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: Newsletter, SMTP, Email marketing and Subscribe forms by Sendinblue
|
4 |
* Plugin URI: https://www.sendinblue.com/?r=wporg
|
5 |
* Description: Manage your contact lists, subscription forms and all email and marketing-related topics from your wp panel, within one single plugin
|
6 |
-
* Version: 3.1.
|
7 |
* Author: Sendinblue
|
8 |
* Author URI: https://www.sendinblue.com/?r=wporg
|
9 |
* License: GPLv2 or later
|
3 |
* Plugin Name: Newsletter, SMTP, Email marketing and Subscribe forms by Sendinblue
|
4 |
* Plugin URI: https://www.sendinblue.com/?r=wporg
|
5 |
* Description: Manage your contact lists, subscription forms and all email and marketing-related topics from your wp panel, within one single plugin
|
6 |
+
* Version: 3.1.21
|
7 |
* Author: Sendinblue
|
8 |
* Author URI: https://www.sendinblue.com/?r=wporg
|
9 |
* License: GPLv2 or later
|