Contact Form & SMTP Plugin for WordPress by PirateForms - Version 2.3.4

Version Description

  • 2018-02-15
Download this release

Release Info

Developer codeinwp
Plugin Icon 128x128 Contact Form & SMTP Plugin for WordPress by PirateForms
Version 2.3.4
Comparing to
See all releases

Code changes from version 2.3.3 to 2.3.4

Files changed (40) hide show
  1. CHANGELOG.md +6 -0
  2. admin/img/loader.gif +0 -0
  3. admin/partials/pirateforms-settings-sidebar-subscribe.php +3 -1
  4. includes/class-pirateforms.php +1 -1
  5. pirate-forms.php +2 -2
  6. public/class-pirateforms-public.php +3 -3
  7. public/css/front.css +13 -8
  8. public/js/scripts.js +28 -15
  9. readme.md +7 -0
  10. readme.txt +7 -0
  11. themeisle-hash.json +1 -1
  12. vendor/autoload.php +1 -1
  13. vendor/autoload_52.php +1 -1
  14. vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-loader.php +1 -1
  15. vendor/codeinwp/themeisle-sdk/load.php +1 -1
  16. vendor/composer/autoload_namespaces.php +1 -0
  17. vendor/composer/autoload_real.php +5 -5
  18. vendor/composer/autoload_real_52.php +3 -3
  19. vendor/composer/installed.json +49 -4
  20. vendor/mailin-api/mailin-api-php/LICENSE.md +21 -0
  21. vendor/mailin-api/mailin-api-php/README.md +29 -0
  22. vendor/mailin-api/mailin-api-php/V1.0/README.md +122 -0
  23. vendor/mailin-api/mailin-api-php/V1.0/examples/README.md +90 -0
  24. vendor/mailin-api/mailin-api-php/V1.0/examples/tutorial1.php +23 -0
  25. vendor/mailin-api/mailin-api-php/V1.0/examples/tutorial2.php +15 -0
  26. vendor/mailin-api/mailin-api-php/V1.0/examples/tutorial3.php +15 -0
  27. vendor/mailin-api/mailin-api-php/V1.0/mailin.php +333 -0
  28. vendor/mailin-api/mailin-api-php/V2.0/Mailin.php +948 -0
  29. vendor/mailin-api/mailin-api-php/V2.0/README.md +135 -0
  30. vendor/mailin-api/mailin-api-php/V2.0/examples/README.md +90 -0
  31. vendor/mailin-api/mailin-api-php/V2.0/examples/tutorial1.php +39 -0
  32. vendor/mailin-api/mailin-api-php/V2.0/examples/tutorial2.php +24 -0
  33. vendor/mailin-api/mailin-api-php/V2.0/examples/tutorial3.php +26 -0
  34. vendor/mailin-api/mailin-api-php/composer.json +26 -0
  35. vendor/mailin-api/mailin-api-php/src/Sendinblue/Mailin.php +946 -0
  36. vendor/mailin-api/mailin-api-php/src/Sendinblue/README.md +154 -0
  37. vendor/mailin-api/mailin-api-php/src/Sendinblue/examples/README.md +90 -0
  38. vendor/mailin-api/mailin-api-php/src/Sendinblue/examples/tutorial1.php +39 -0
  39. vendor/mailin-api/mailin-api-php/src/Sendinblue/examples/tutorial2.php +24 -0
  40. vendor/mailin-api/mailin-api-php/src/Sendinblue/examples/tutorial3.php +26 -0
CHANGELOG.md CHANGED
@@ -1,4 +1,10 @@
1
 
 
 
 
 
 
 
2
  ### v2.3.3 - 2018-01-06
3
  **Changes:**
4
  * Fix double reCAPTCHA box bug.
1
 
2
+ ### v2.3.4 - 2018-02-15
3
+ **Changes:**
4
+ * Added missing Loader.gif file
5
+ * Fixed undefined notice
6
+ * Fix submit button leaving form when ReCaptcha is enabled
7
+
8
  ### v2.3.3 - 2018-01-06
9
  **Changes:**
10
  * Fix double reCAPTCHA box bug.
admin/img/loader.gif ADDED
Binary file
admin/partials/pirateforms-settings-sidebar-subscribe.php CHANGED
@@ -26,7 +26,9 @@ endif;
26
  <div class="pirate-forms-subscribe-content">
27
  <?php
28
  if ( ! empty( $_POST['pirate_forms_mail'] ) ) {
29
- require( PIRATE_FORMS_PATH . 'mailin.php' );
 
 
30
  $user_info = get_userdata( 1 );
31
  $mailin = new Mailin( 'https://api.sendinblue.com/v2.0', 'cHW5sxZnzE7mhaYb' );
32
  $data = array(
26
  <div class="pirate-forms-subscribe-content">
27
  <?php
28
  if ( ! empty( $_POST['pirate_forms_mail'] ) ) {
29
+ if ( ! class_exists( 'Mailin' ) ) {
30
+ require_once PIRATEFORMS_DIR . 'vendor/mailin-api/mailin-api-php/V2.0/Mailin.php';
31
+ }
32
  $user_info = get_userdata( 1 );
33
  $mailin = new Mailin( 'https://api.sendinblue.com/v2.0', 'cHW5sxZnzE7mhaYb' );
34
  $data = array(
includes/class-pirateforms.php CHANGED
@@ -69,7 +69,7 @@ class PirateForms {
69
  public function __construct() {
70
 
71
  $this->plugin_name = 'pirateforms';
72
- $this->version = '2.3.3';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
69
  public function __construct() {
70
 
71
  $this->plugin_name = 'pirateforms';
72
+ $this->version = '2.3.4';
73
 
74
  $this->load_dependencies();
75
  $this->set_locale();
pirate-forms.php CHANGED
@@ -16,7 +16,7 @@
16
  * Plugin Name: Free & Simple Contact Form Plugin - Pirateforms
17
  * Plugin URI: http://themeisle.com/plugins/pirate-forms/
18
  * Description: Easily creates a nice looking, simple contact form on your WP site.
19
- * Version: 2.3.3
20
  * Author: Themeisle
21
  * Author URI: http://themeisle.com
22
  * Text Domain: pirate-forms
@@ -36,7 +36,7 @@ if ( ! defined( 'WPINC' ) ) {
36
  define( 'PIRATEFORMS_NAME', 'Pirate Forms' );
37
  define( 'PIRATEFORMS_SLUG', 'pirate-forms' );
38
  define( 'PIRATEFORMS_USELL_LINK', 'https://themeisle.com/plugins/pirate-forms-extended/' );
39
- define( 'PIRATE_FORMS_VERSION', '2.3.3' );
40
  define( 'PIRATEFORMS_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
41
  define( 'PIRATEFORMS_URL', plugin_dir_url( __FILE__ ) );
42
  define( 'PIRATEFORMS_BASENAME', plugin_basename( __FILE__ ) );
16
  * Plugin Name: Free & Simple Contact Form Plugin - Pirateforms
17
  * Plugin URI: http://themeisle.com/plugins/pirate-forms/
18
  * Description: Easily creates a nice looking, simple contact form on your WP site.
19
+ * Version: 2.3.4
20
  * Author: Themeisle
21
  * Author URI: http://themeisle.com
22
  * Text Domain: pirate-forms
36
  define( 'PIRATEFORMS_NAME', 'Pirate Forms' );
37
  define( 'PIRATEFORMS_SLUG', 'pirate-forms' );
38
  define( 'PIRATEFORMS_USELL_LINK', 'https://themeisle.com/plugins/pirate-forms-extended/' );
39
+ define( 'PIRATE_FORMS_VERSION', '2.3.4' );
40
  define( 'PIRATEFORMS_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
41
  define( 'PIRATEFORMS_URL', plugin_dir_url( __FILE__ ) );
42
  define( 'PIRATEFORMS_BASENAME', plugin_basename( __FILE__ ) );
public/class-pirateforms-public.php CHANGED
@@ -79,7 +79,7 @@ class PirateForms_Public {
79
  $deps = array( 'jquery' );
80
  $pirate_forms_options = get_option( 'pirate_forms_settings_array' );
81
  if ( ! empty( $pirate_forms_options ) ) :
82
- if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && 'yes' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) :
83
  if ( defined( 'POLYLANG_VERSION' ) && function_exists( 'pll_current_language' ) ) {
84
  $pirate_forms_contactus_language = pll_current_language();
85
  } else {
@@ -324,7 +324,7 @@ class PirateForms_Public {
324
  endif;
325
  /**
326
  ******* ReCaptcha */
327
- if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && 'yes' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) :
328
  $pirateformsopt_recaptcha_sitekey = $pirate_forms_options['pirateformsopt_recaptcha_sitekey'];
329
  $pirateformsopt_recaptcha_secretkey = $pirate_forms_options['pirateformsopt_recaptcha_secretkey'];
330
  $elements[] = array(
@@ -340,7 +340,7 @@ class PirateForms_Public {
340
  );
341
  endif;
342
 
343
- if ( 'custom' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) :
344
  $elements[] = array(
345
  'type' => 'div',
346
  'class' => 'pirate-forms-maps-custom', // spam.reverse() = maps
79
  $deps = array( 'jquery' );
80
  $pirate_forms_options = get_option( 'pirate_forms_settings_array' );
81
  if ( ! empty( $pirate_forms_options ) ) :
82
+ if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_field'] ) && ( 'yes' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) ) :
83
  if ( defined( 'POLYLANG_VERSION' ) && function_exists( 'pll_current_language' ) ) {
84
  $pirate_forms_contactus_language = pll_current_language();
85
  } else {
324
  endif;
325
  /**
326
  ******* ReCaptcha */
327
+ if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_secretkey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_sitekey'] ) && ! empty( $pirate_forms_options['pirateformsopt_recaptcha_field'] ) && ( 'yes' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) ) :
328
  $pirateformsopt_recaptcha_sitekey = $pirate_forms_options['pirateformsopt_recaptcha_sitekey'];
329
  $pirateformsopt_recaptcha_secretkey = $pirate_forms_options['pirateformsopt_recaptcha_secretkey'];
330
  $elements[] = array(
340
  );
341
  endif;
342
 
343
+ if ( ! empty( $pirate_forms_options['pirateformsopt_recaptcha_field'] ) && ( 'custom' === $pirate_forms_options['pirateformsopt_recaptcha_field'] ) ) :
344
  $elements[] = array(
345
  'type' => 'div',
346
  'class' => 'pirate-forms-maps-custom', // spam.reverse() = maps
public/css/front.css CHANGED
@@ -1,5 +1,5 @@
1
  /*
2
- Version: 2.3.3
3
  */
4
  .pirate_forms_wrap .form_field_wrap,
5
  .widget .pirate_forms_wrap .form_field_wrap {
@@ -39,8 +39,17 @@ Version: 2.3.3
39
  text-align: right;
40
  }
41
 
 
 
 
 
 
 
 
 
 
42
  .pirate-forms-maps-custom label {
43
- display: inline-block;
44
  cursor: pointer;
45
  }
46
 
@@ -48,11 +57,6 @@ Version: 2.3.3
48
  margin-left: 5px;
49
  }
50
 
51
- .pirate-forms-fields-container {
52
- margin-right: -15px;
53
- margin-left: -15px;
54
- }
55
-
56
  .pirate-forms-fields-container .form_field_wrap {
57
  box-sizing: border-box;
58
  padding-right: 15px;
@@ -75,7 +79,6 @@ Version: 2.3.3
75
  .pirate_forms_wrap .form_field_wrap .pirate-forms-submit-button {
76
  display: inline-block;
77
  width: auto;
78
- max-width: 100%;
79
  }
80
 
81
  .pirate_forms_wrap .pirate-forms-footer {
@@ -85,10 +88,12 @@ Version: 2.3.3
85
  }
86
 
87
  .pirate_forms_wrap .pirate-forms-footer .form_field_wrap {
 
88
  display: table-cell;
89
  float: none;
90
  margin: 0;
91
  vertical-align: middle;
 
92
  }
93
 
94
  @media (max-width: 480px) {
1
  /*
2
+ Version: 2.3.4
3
  */
4
  .pirate_forms_wrap .form_field_wrap,
5
  .widget .pirate_forms_wrap .form_field_wrap {
39
  text-align: right;
40
  }
41
 
42
+ .pirate-forms-maps-custom {
43
+ min-width: 150px;
44
+ }
45
+
46
+ .pirate-forms-maps-custom input {
47
+ display: inline;
48
+ width: auto;
49
+ }
50
+
51
  .pirate-forms-maps-custom label {
52
+ display: inline;
53
  cursor: pointer;
54
  }
55
 
57
  margin-left: 5px;
58
  }
59
 
 
 
 
 
 
60
  .pirate-forms-fields-container .form_field_wrap {
61
  box-sizing: border-box;
62
  padding-right: 15px;
79
  .pirate_forms_wrap .form_field_wrap .pirate-forms-submit-button {
80
  display: inline-block;
81
  width: auto;
 
82
  }
83
 
84
  .pirate_forms_wrap .pirate-forms-footer {
88
  }
89
 
90
  .pirate_forms_wrap .pirate-forms-footer .form_field_wrap {
91
+ width: auto;
92
  display: table-cell;
93
  float: none;
94
  margin: 0;
95
  vertical-align: middle;
96
+ padding-bottom: 10px;
97
  }
98
 
99
  @media (max-width: 480px) {
public/js/scripts.js CHANGED
@@ -1,18 +1,31 @@
1
  /* global jQuery */
2
- jQuery(document).ready(function() {
 
 
 
 
 
 
 
 
3
 
4
- jQuery('.pirate-forms-file-upload-button').on('click', function () {
5
- var $button = jQuery(this);
6
- $button.parent().find('input[type=file]').on('change', function(){
7
- $button.parent().find('input[type=text]').val(jQuery(this).val()).change();
8
- });
9
- $button.parent().find('input[type=file]').focus().click();
10
- });
11
 
12
- jQuery('.pirate-forms-file-upload-input').on('click', function(){
13
- jQuery(this).parent().find('.pirate-forms-file-upload-button').trigger('click');
14
- });
15
- jQuery('.pirate-forms-file-upload-input').on('focus', function(){
16
- jQuery(this).blur();
17
- });
18
- });
 
 
 
 
 
1
  /* global jQuery */
2
+ jQuery( document ).ready( function () {
3
+ 'use strict';
4
+ jQuery( '.pirate-forms-file-upload-button' ).on( 'click', function () {
5
+ var $button = jQuery( this );
6
+ $button.parent().find( 'input[type=file]' ).on( 'change', function () {
7
+ $button.parent().find( 'input[type=text]' ).val( jQuery( this ).val() ).change();
8
+ } );
9
+ $button.parent().find( 'input[type=file]' ).focus().click();
10
+ } );
11
 
12
+ jQuery( '.pirate-forms-file-upload-input' ).on( 'click', function () {
13
+ jQuery( this ).parent().find( '.pirate-forms-file-upload-button' ).trigger( 'click' );
14
+ } );
15
+ jQuery( '.pirate-forms-file-upload-input' ).on( 'focus', function () {
16
+ jQuery( this ).blur();
17
+ } );
18
+ } );
19
 
20
+ jQuery( window ).load( function () {
21
+ 'use strict';
22
+ if ( jQuery( '.pirate_forms_wrap' ).length ) {
23
+ jQuery( '.pirate_forms_wrap' ).each( function () {
24
+ var formWidth = jQuery( this ).innerWidth();
25
+ var footerWidth = jQuery( this ).find( '.pirate-forms-footer' ).innerWidth();
26
+ if ( footerWidth > formWidth ) {
27
+ jQuery( this ).find( '.contact_submit_wrap, .form_captcha_wrap, .pirateform_wrap_classes_spam_wrap' ).css( {'text-align' : 'left', 'display' : 'block' } );
28
+ }
29
+ } );
30
+ }
31
+ } );
readme.md CHANGED
@@ -187,6 +187,13 @@ Activating the Pirate Contact Form plugin is just like any other plugin. If you'
187
  4. Screenshot 4. Enabling SMTP
188
 
189
  ## Changelog ##
 
 
 
 
 
 
 
190
  ### 2.3.3 - 2018-01-06 ###
191
 
192
  * Fix double reCAPTCHA box bug.
187
  4. Screenshot 4. Enabling SMTP
188
 
189
  ## Changelog ##
190
+ ### 2.3.4 - 2018-02-15 ###
191
+
192
+ * Added missing Loader.gif file
193
+ * Fixed undefined notice
194
+ * Fix submit button leaving form when ReCaptcha is enabled
195
+
196
+
197
  ### 2.3.3 - 2018-01-06 ###
198
 
199
  * Fix double reCAPTCHA box bug.
readme.txt CHANGED
@@ -187,6 +187,13 @@ Activating the Pirate Contact Form plugin is just like any other plugin. If you'
187
  4. Screenshot 4. Enabling SMTP
188
 
189
  == Changelog ==
 
 
 
 
 
 
 
190
  = 2.3.3 - 2018-01-06 =
191
 
192
  * Fix double reCAPTCHA box bug.
187
  4. Screenshot 4. Enabling SMTP
188
 
189
  == Changelog ==
190
+ = 2.3.4 - 2018-02-15 =
191
+
192
+ * Added missing Loader.gif file
193
+ * Fixed undefined notice
194
+ * Fix submit button leaving form when ReCaptcha is enabled
195
+
196
+
197
  = 2.3.3 - 2018-01-06 =
198
 
199
  * Fix double reCAPTCHA box bug.
themeisle-hash.json CHANGED
@@ -1 +1 @@
1
- {"index.php":"39ab8276fb0e4bd3fcab3270822c5977","pirate-forms.php":"d2b7b37491ed4ea5462d5bc53013fc59","uninstall.php":"9d936442a63521d971a6dbc28df9c0d1"}
1
+ {"index.php":"39ab8276fb0e4bd3fcab3270822c5977","pirate-forms.php":"432a59b298618b624cef5729ef21cee2","uninstall.php":"9d936442a63521d971a6dbc28df9c0d1"}
vendor/autoload.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
- return ComposerAutoloaderInite4e16cf00d7681e8ee43ec3e0e1e0b72::getLoader();
4
 
5
  require_once __DIR__ . '/composer' . '/autoload_real.php';
6
 
7
+ return ComposerAutoloaderInit827b7f6ae2e6aa5ae9503153e0b8dd88::getLoader();
vendor/autoload_52.php CHANGED
@@ -4,4 +4,4 @@
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
- return ComposerAutoloaderInitdd46fa6f7bf6f1d5119268cef91fcc46::getLoader();
4
 
5
  require_once dirname(__FILE__) . '/composer'.'/autoload_real_52.php';
6
 
7
+ return ComposerAutoloaderInitbe773d6b228b4c23ed753bd0428c6a8c::getLoader();
vendor/codeinwp/themeisle-sdk/class-themeisle-sdk-loader.php CHANGED
@@ -48,7 +48,7 @@ if ( ! class_exists( 'ThemeIsle_SDK_Loader' ) ) :
48
 
49
  $notifications = array();
50
  // Based on the WordPress Available file header we enable the logger or not.
51
- if ( ! $product_object->is_wordpress_available() ) {
52
  $licenser = new ThemeIsle_SDK_Licenser( $product_object );
53
  $licenser->enable();
54
  }
48
 
49
  $notifications = array();
50
  // Based on the WordPress Available file header we enable the logger or not.
51
+ if ( ! $product_object->is_wordpress_available() && apply_filters( $product_object->get_key() . '_enable_licenser', true ) === true ) {
52
  $licenser = new ThemeIsle_SDK_Licenser( $product_object );
53
  $licenser->enable();
54
  }
vendor/codeinwp/themeisle-sdk/load.php CHANGED
@@ -11,7 +11,7 @@
11
  */
12
 
13
  // Current SDK version and path.
14
- $themeisle_sdk_version = '2.1.0';
15
  $themeisle_sdk_path = dirname( __FILE__ );
16
 
17
  global $themeisle_sdk_max_version;
11
  */
12
 
13
  // Current SDK version and path.
14
+ $themeisle_sdk_version = '2.1.1';
15
  $themeisle_sdk_path = dirname( __FILE__ );
16
 
17
  global $themeisle_sdk_max_version;
vendor/composer/autoload_namespaces.php CHANGED
@@ -7,4 +7,5 @@ $baseDir = dirname($vendorDir);
7
 
8
  return array(
9
  'xrstf\\Composer52' => array($vendorDir . '/xrstf/composer-php52/lib'),
 
10
  );
7
 
8
  return array(
9
  'xrstf\\Composer52' => array($vendorDir . '/xrstf/composer-php52/lib'),
10
+ 'Sendinblue' => array($vendorDir . '/mailin-api/mailin-api-php/src'),
11
  );
vendor/composer/autoload_real.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
- class ComposerAutoloaderInite4e16cf00d7681e8ee43ec3e0e1e0b72
6
  {
7
  private static $loader;
8
 
@@ -19,9 +19,9 @@ class ComposerAutoloaderInite4e16cf00d7681e8ee43ec3e0e1e0b72
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInite4e16cf00d7681e8ee43ec3e0e1e0b72', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInite4e16cf00d7681e8ee43ec3e0e1e0b72', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
@@ -42,14 +42,14 @@ class ComposerAutoloaderInite4e16cf00d7681e8ee43ec3e0e1e0b72
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
- composerRequiree4e16cf00d7681e8ee43ec3e0e1e0b72($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
- function composerRequiree4e16cf00d7681e8ee43ec3e0e1e0b72($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
2
 
3
  // autoload_real.php @generated by Composer
4
 
5
+ class ComposerAutoloaderInit827b7f6ae2e6aa5ae9503153e0b8dd88
6
  {
7
  private static $loader;
8
 
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInit827b7f6ae2e6aa5ae9503153e0b8dd88', 'loadClassLoader'), true, true);
23
  self::$loader = $loader = new \Composer\Autoload\ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInit827b7f6ae2e6aa5ae9503153e0b8dd88', 'loadClassLoader'));
25
 
26
  $map = require __DIR__ . '/autoload_namespaces.php';
27
  foreach ($map as $namespace => $path) {
42
 
43
  $includeFiles = require __DIR__ . '/autoload_files.php';
44
  foreach ($includeFiles as $fileIdentifier => $file) {
45
+ composerRequire827b7f6ae2e6aa5ae9503153e0b8dd88($fileIdentifier, $file);
46
  }
47
 
48
  return $loader;
49
  }
50
  }
51
 
52
+ function composerRequire827b7f6ae2e6aa5ae9503153e0b8dd88($fileIdentifier, $file)
53
  {
54
  if (empty($GLOBALS['__composer_autoload_files'][$fileIdentifier])) {
55
  require $file;
vendor/composer/autoload_real_52.php CHANGED
@@ -2,7 +2,7 @@
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
- class ComposerAutoloaderInitdd46fa6f7bf6f1d5119268cef91fcc46 {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
@@ -19,9 +19,9 @@ class ComposerAutoloaderInitdd46fa6f7bf6f1d5119268cef91fcc46 {
19
  return self::$loader;
20
  }
21
 
22
- spl_autoload_register(array('ComposerAutoloaderInitdd46fa6f7bf6f1d5119268cef91fcc46', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
- spl_autoload_unregister(array('ComposerAutoloaderInitdd46fa6f7bf6f1d5119268cef91fcc46', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
2
 
3
  // autoload_real_52.php generated by xrstf/composer-php52
4
 
5
+ class ComposerAutoloaderInitbe773d6b228b4c23ed753bd0428c6a8c {
6
  private static $loader;
7
 
8
  public static function loadClassLoader($class) {
19
  return self::$loader;
20
  }
21
 
22
+ spl_autoload_register(array('ComposerAutoloaderInitbe773d6b228b4c23ed753bd0428c6a8c', 'loadClassLoader'), true /*, true */);
23
  self::$loader = $loader = new xrstf_Composer52_ClassLoader();
24
+ spl_autoload_unregister(array('ComposerAutoloaderInitbe773d6b228b4c23ed753bd0428c6a8c', 'loadClassLoader'));
25
 
26
  $vendorDir = dirname(dirname(__FILE__));
27
  $baseDir = dirname($vendorDir);
vendor/composer/installed.json CHANGED
@@ -6,15 +6,15 @@
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
- "reference": "ae69f3966081f0a7c7c468c00275c411cc0be063"
10
  },
11
  "dist": {
12
  "type": "zip",
13
- "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/ae69f3966081f0a7c7c468c00275c411cc0be063",
14
- "reference": "ae69f3966081f0a7c7c468c00275c411cc0be063",
15
  "shasum": ""
16
  },
17
- "time": "2018-01-04 13:30:43",
18
  "type": "library",
19
  "installation-source": "dist",
20
  "autoload": {
@@ -71,5 +71,50 @@
71
  "license": [
72
  "MIT"
73
  ]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
74
  }
75
  ]
6
  "source": {
7
  "type": "git",
8
  "url": "https://github.com/Codeinwp/themeisle-sdk.git",
9
+ "reference": "032c9dcc34c7c8589eebe3e0b3c72418fcbd3d76"
10
  },
11
  "dist": {
12
  "type": "zip",
13
+ "url": "https://api.github.com/repos/Codeinwp/themeisle-sdk/zipball/032c9dcc34c7c8589eebe3e0b3c72418fcbd3d76",
14
+ "reference": "032c9dcc34c7c8589eebe3e0b3c72418fcbd3d76",
15
  "shasum": ""
16
  },
17
+ "time": "2018-01-13 12:07:08",
18
  "type": "library",
19
  "installation-source": "dist",
20
  "autoload": {
71
  "license": [
72
  "MIT"
73
  ]
74
+ },
75
+ {
76
+ "name": "mailin-api/mailin-api-php",
77
+ "version": "dev-master",
78
+ "version_normalized": "9999999-dev",
79
+ "source": {
80
+ "type": "git",
81
+ "url": "https://github.com/mailin-api/mailin-api-php.git",
82
+ "reference": "b437808566f46979309f01b796c31b7b6bacfb42"
83
+ },
84
+ "dist": {
85
+ "type": "zip",
86
+ "url": "https://api.github.com/repos/mailin-api/mailin-api-php/zipball/b437808566f46979309f01b796c31b7b6bacfb42",
87
+ "reference": "b437808566f46979309f01b796c31b7b6bacfb42",
88
+ "shasum": ""
89
+ },
90
+ "require": {
91
+ "ext-curl": "*",
92
+ "php": ">=5.3"
93
+ },
94
+ "time": "2017-04-19 13:00:21",
95
+ "type": "library",
96
+ "extra": {
97
+ "branch-alias": {
98
+ "dev-master": "1.0.x-dev"
99
+ }
100
+ },
101
+ "installation-source": "dist",
102
+ "autoload": {
103
+ "psr-0": {
104
+ "Sendinblue": "src/"
105
+ }
106
+ },
107
+ "notification-url": "https://packagist.org/downloads/",
108
+ "license": [
109
+ "MIT"
110
+ ],
111
+ "authors": [
112
+ {
113
+ "name": "SendinBlue",
114
+ "homepage": "https://www.sendinblue.com/"
115
+ }
116
+ ],
117
+ "description": "Official SendinBlue provided API V2 wrapper",
118
+ "homepage": "https://github.com/mailin-api/mailin-api-php"
119
  }
120
  ]
vendor/mailin-api/mailin-api-php/LICENSE.md ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2016 SendinBlue
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
vendor/mailin-api/mailin-api-php/README.md ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SendinBlue Php Library
2
+
3
+ This is the SendinBlue Php library. It implements the various exposed APIs that you can read more about on https://apidocs.sendinblue.com.
4
+
5
+ SendinBlue API's use HTTP Authentication through an api key. You can create your api key from [API Console](https://my.sendinblue.com/advanced/apikey), after you sign up for an account with SendinBlue. You must use latest version 2.0, access key, for accessing APIs.
6
+
7
+
8
+ ## Quickstart Guide
9
+
10
+ Learn how to send email campaigns from your application using SendinBlue API.
11
+
12
+ You must sign up for SendinBlue account for using APIs. All our APIs require HTTP authentication using access key, which are accessible from your [API Console](https://my.sendinblue.com/advanced/apikey).
13
+
14
+ The following guides give you a start and understanding of how to use our API.
15
+
16
+ * [Get all your campaigns](https://apidocs.sendinblue.com/how-to-get-all-you-campaigns/)
17
+ * [Send transactional emails](https://apidocs.sendinblue.com/tutorial-sending-transactional-email/)
18
+ * [Setup your webhooks](https://apidocs.sendinblue.com/how-to-setup-webhooks/)
19
+
20
+
21
+ ## Support and Feedback
22
+
23
+ Be sure to visit the SendinBlue official [documentation website](https://apidocs.sendinblue.com) for additional information about our API.
24
+
25
+ We also support [Composer](https://packagist.org/packages/mailin-api/mailin-api-php).
26
+
27
+ If you find a bug, please submit the issue in [Github directly](https://github.com/mailin-api/mailin-api-php/issues).
28
+
29
+ As always, if you need additional assistance, drop us a note [here](https://apidocs.sendinblue.com/support/).
vendor/mailin-api/mailin-api-php/V1.0/README.md ADDED
@@ -0,0 +1,122 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SendinBlue Php Library
2
+
3
+ This is the SendinBlue Php library. It implements the various exposed APIs that you can read more about on https://apidocs.sendinblue.com.
4
+
5
+
6
+ ## Quickstart
7
+
8
+ * You will need to first get the Access key and Secret key from [SendinBlue](https://www.sendinblue.com).
9
+
10
+ * Assuming that you have cloned this git repo, or downloaded mailin.php and its in the same directory than the script. You can use this small sample script to get started
11
+
12
+ ```PHP
13
+ <?php
14
+ require('mailin.php');
15
+ /*
16
+ * This will initiate the API with the endpoint and your access and secret key.
17
+ *
18
+ */
19
+ $mailin = new Mailin('https://api.sendinblue.com/v1.0','Your access key','Your secret key');
20
+
21
+ /** Prepare variables for easy use **/
22
+
23
+ $to = array("to@example.net"=>"to whom!"); //mandatory
24
+ $subject = "My subject"; //mandatory
25
+ $from = array("from@email.com","from email!"); //mandatory
26
+ $html = "This is the <h1>HTML</h1>"; //mandatory
27
+ $text= "This is the text";
28
+ $cc = array("cc@example.net"=>"cc whom!");
29
+ $bcc = array("bcc@example.net"=>"bcc whom!");
30
+ $replyto = array("replyto@email.com","reply to!");
31
+ $attachment = array(); //provide the absolute url of the attachment/s
32
+ $headers = array("Content-Type"=> "text/html; charset=iso-8859-1","X-Ewiufkdsjfhn"=> "hello","X-Custom" => "Custom");
33
+ var_dump($mailin->send_email($to,$subject,$from,$html,$text,$cc,$bcc,$replyto,$attachment,$headers));
34
+
35
+ ?>
36
+ ```
37
+
38
+ * To explore more, you should visit the [SendinBlue API documentation](https://apidocs.sendinblue.com).
39
+
40
+ ## Available functions
41
+
42
+ List of API calls that you can make. Please do note that the order of parameters are important.
43
+
44
+ ### Campaign calls
45
+
46
+ * get_account() - Get your account information
47
+ * get_smtp_details() - Get your SMTP account information
48
+ * create_child_account($email,$password,$company_org,$first_name,$last_name,$credits,$associate_ip) - Create a Reseller child account
49
+ * update_child_account($child_authkey,$company_org,$first_name,$last_name,$password,$associate_ip,$disassociate_ip) - Update a Reseller child account
50
+ * delete_child_account($child_authkey) - Delete a Reseller child account
51
+ * get_child_account($child_authkey) - Get Reseller child accounts
52
+ * add_remove_child_credits($childauthkey,$add_credits,$remove_credits) - Add/Remove Reseller child credits
53
+ * get_campaigns($type,$status,$page,$page_limit) - Get list of all campaigns or of specific type or status or both
54
+ * get_campaign($id) - Get specific campaign object
55
+ * create_campaign($category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$attachmentUrl,$inline_image) - Create a campaign
56
+ * delete_campaign($id) - Delete a campaign
57
+ * update_campaign($id,$category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$attachmentUrl,$inline_image) - Update campaign information
58
+ * campaign_report_email($id,$lang,$email_subject,$email_to,$email_content_type,$email_bcc,$email_cc,$email_body) - Sending reports to specific emails
59
+ * campaign_recipients_export($id,$notify_url,$type) - Export recipients of a campaign
60
+ * send_bat_email($campid,$email_to) - Send a test Email (bat)
61
+ * create_trigger_campaign($category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$recurring,$attachmentUrl,$inline_image) - Create a trigger campaign
62
+ * update_trigger_campaign($id,$category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$recurring,$attachmentUrl,$inline_image) - Update trigger campaign information
63
+ * campaign_share_link($campaign_ids) - Get campaign share link
64
+ * update_campaign_status($id,$status) - Modify a campaign status
65
+ * get_folders() - Get list of all the folder details.
66
+ * get_folder($id) - Get all the folder details for folder with id <id>
67
+ * create_folder($name) - Create a folder
68
+ * delete_folder($id) - Delete folder with folder id <id>
69
+ * update_folder($id,$name) - Update folder with folder id <id>
70
+ * get_lists() - Get all the lists
71
+ * get_list($id) - Get information about a list
72
+ * create_list($list_name,$list_parent) - Create a list
73
+ * delete_list($id) - Delete a list
74
+ * update_list($id,$list_name,$list_parent) - Updating a list
75
+ * display_list_users($listids,$page,$page_limit) - Display details of all users for the given lists
76
+ * add_users_list($id,$users) - Add users to a list
77
+ * delete_users_list($id,$users) - Delete users from a list
78
+ * get_attributes() - Listing all attributes
79
+ * get_attribute($type) - Listing a certain type attributes
80
+ * create_attribute($type,$data) - Creating attributes
81
+ * delete_attribute($type,$data) - Deleting attributes of the given type
82
+ * get_user($email) - Get information about a user/email
83
+ * create_update_user($email,$attributes,$blacklisted,$listid,$listid_unlink,$blacklisted_sms) - Create/Update a user information
84
+ * delete_user($email) - Deleting user from db is not permitted but this action will unlink him from all lists
85
+ * import_users($url,$listids,$notify_url,$name,$folder_id) - Import users/emails
86
+ * export_users($export_attrib,$filter,$notify_url) - Export users/emails
87
+ * get_processes() - Get information about all background processes
88
+ * get_process($id) - Get information about a specific process
89
+ * get_senders($option) - Get information about all/specific senders
90
+ * create_sender($sender_name,$sender_email,$ip_domain) - Create a sender
91
+ * delete_sender($id) - Delete a sender
92
+ * update_sender($id,$sender_name,$sender_email,$ip_domain) - Update a sender
93
+
94
+ ### SMTP calls
95
+
96
+ * get_report($limit,$start_date,$end_date,$offset,$date,$days,$email) - Retrieve information for all report events
97
+ * get_statistics($aggregate,$tag,$days,$end_date,$start_date) - Get aggregate statistics about emails sent
98
+ * get_webhooks() - List registered webhooks
99
+ * get_webhook($id) - Get information about a webhook
100
+ * create_webhook($url,$description,$events) - Registering a webhook
101
+ * delete_webhook($id) - Deleting a webhook
102
+ * update_webhook($id,$url,$description,$events) - Editing a webhook
103
+ * delete_bounces($start_date,$end_date,$email) - Deleting bounces
104
+ * send_email($to,$subject,$from,$html,$text,$cc,$bcc,$replyto,$attachment,$headers) - Sending out a transactional email
105
+ * send_transactional_template($id,$to,$cc,$bcc,$attr,$attachmentUrl,$attachment) - Send templates created on SendinBlue, through SendinBlue smtp.
106
+ * create_template($from_name,$name,$bat_sent,$html_content,$html_url,$subject,$from_email,$reply_to,$to_field,$status,$attach) - Create a template
107
+ * update_template($id,$from_name,$name,$bat_sent,$html_content,$html_url,$subject,$from_email,$reply_to,$to_field,$status,$attach) - Update template information
108
+
109
+ ### SMS call
110
+
111
+ * send_sms($to,$from,$text,$web_url,$tag,$type) - Sending a SMS
112
+ * create_sms_campaign($camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date) - Create a SMS campaign
113
+ * update_sms_campaign($id,$camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date) - Update a SMS campaign
114
+ * send_bat_sms($campid,$mobilephone) - Send a test SMS campaign
115
+
116
+ ####Recommendation:
117
+
118
+ If you face any error like "Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:func(144):reason(134)\n", with our library then by adding the below line of code just before curl_exec() ( line no. 48 ) in mailin.php file, you may no longer face this issue.
119
+ ```PHP
120
+ curl_setopt($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");
121
+ ```
122
+ The content of the file is available here: http://curl.haxx.se/ca/cacert.pem
vendor/mailin-api/mailin-api-php/V1.0/examples/README.md ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Examples
2
+
3
+ * tutorial1.php - Sending a transactional email
4
+ * tutorial2.php - Get all campaigns
5
+ * tutorial3.php - Send an SMS
6
+
7
+ ## Available functions
8
+
9
+ List of API calls that you can make, you can click to read more about it. Please do note that the order of parameters are important.
10
+
11
+
12
+ ### Campaign calls
13
+
14
+ * get_account() - Get your account information
15
+ * get_smtp_details() - Get your SMTP account information
16
+ * create_child_account($email,$password,$company_org,$first_name,$last_name,$credits,$associate_ip) - Create a Reseller child account
17
+ * update_child_account($child_authkey,$company_org,$first_name,$last_name,$password,$associate_ip,$disassociate_ip) - Update a Reseller child account
18
+ * delete_child_account($child_authkey) - Delete a Reseller child account
19
+ * get_child_account($child_authkey) - Get Reseller child accounts
20
+ * add_remove_child_credits($childauthkey,$add_credits,$remove_credits) - Add/Remove Reseller child credits
21
+ * get_campaigns($type,$status,$page,$page_limit) - Get list of all campaigns or of specific type or status or both
22
+ * get_campaign($id) - Get specific campaign object
23
+ * create_campaign($category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$attachmentUrl,$inline_image) - Create a campaign
24
+ * delete_campaign($id) - Delete a campaign
25
+ * update_campaign($id,$category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$attachmentUrl,$inline_image) - Update campaign information
26
+ * campaign_report_email($id,$lang,$email_subject,$email_to,$email_content_type,$email_bcc,$email_cc,$email_body) - Sending reports to specific emails
27
+ * campaign_recipients_export($id,$notify_url,$type) - Export recipients of a campaign
28
+ * send_bat_email($campid,$email_to) - Send a test Email (bat)
29
+ * create_trigger_campaign($category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$recurring,$attachmentUrl,$inline_image) - Create a trigger campaign
30
+ * update_trigger_campaign($id,$category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$recurring,$attachmentUrl,$inline_image) - Update trigger campaign information
31
+ * campaign_share_link($campaign_ids) - Get campaign share link
32
+ * update_campaign_status($id,$status) - Modify a campaign status
33
+ * get_folders() - Get list of all the folder details.
34
+ * get_folder($id) - Get all the folder details for folder with id <id>
35
+ * create_folder($name) - Create a folder
36
+ * delete_folder($id) - Delete folder with folder id <id>
37
+ * update_folder($id,$name) - Update folder with folder id <id>
38
+ * get_lists() - Get all the lists
39
+ * get_list($id) - Get information about a list
40
+ * create_list($list_name,$list_parent) - Create a list
41
+ * delete_list($id) - Delete a list
42
+ * update_list($id,$list_name,$list_parent) - Updating a list
43
+ * display_list_users($listids,$page,$page_limit) - Display details of all users for the given lists
44
+ * add_users_list($id,$users) - Add users to a list
45
+ * delete_users_list($id,$users) - Delete users from a list
46
+ * get_attributes() - Listing all attributes
47
+ * get_attribute($type) - Listing a certain type attributes
48
+ * create_attribute($type,$data) - Creating attributes
49
+ * delete_attribute($type,$data) - Deleting attributes of the given type
50
+ * get_user($email) - Get information about a user/email
51
+ * create_update_user($email,$attributes,$blacklisted,$listid,$listid_unlink,$blacklisted_sms) - Create/Update a user information
52
+ * delete_user($email) - Deleting user from db is not permitted but this action will unlink him from all lists
53
+ * import_users($url,$listids,$notify_url,$name,$folder_id) - Import users/emails
54
+ * export_users($export_attrib,$filter,$notify_url) - Export users/emails
55
+ * get_processes() - Get information about all background processes
56
+ * get_process($id) - Get information about a specific process
57
+ * get_senders($option) - Get information about all/specific senders
58
+ * create_sender($sender_name,$sender_email,$ip_domain) - Create a sender
59
+ * delete_sender($id) - Delete a sender
60
+ * update_sender($id,$sender_name,$sender_email,$ip_domain) - Update a sender
61
+
62
+ ### SMTP calls
63
+
64
+ * get_report($limit,$start_date,$end_date,$offset,$date,$days,$email) - Retrieve information for all report events
65
+ * get_statistics($aggregate,$tag,$days,$end_date,$start_date) - Get aggregate statistics about emails sent
66
+ * get_webhooks() - List registered webhooks
67
+ * get_webhook($id) - Get information about a webhook
68
+ * create_webhook($url,$description,$events) - Registering a webhook
69
+ * delete_webhook($id) - Deleting a webhook
70
+ * update_webhook($id,$url,$description,$events) - Editing a webhook
71
+ * delete_bounces($start_date,$end_date,$email) - Deleting bounces
72
+ * send_email($to,$subject,$from,$html,$text,$cc,$bcc,$replyto,$attachment,$headers) - Sending out a transactional email
73
+ * send_transactional_template($id,$to,$cc,$bcc,$attr,$attachmentUrl,$attachment) - Send templates created on SendinBlue, through SendinBlue smtp.
74
+ * create_template($from_name,$name,$bat_sent,$html_content,$html_url,$subject,$from_email,$reply_to,$to_field,$status,$attach) - Create a template
75
+ * update_template($id,$from_name,$name,$bat_sent,$html_content,$html_url,$subject,$from_email,$reply_to,$to_field,$status,$attach) - Update template information
76
+
77
+ ### SMS call
78
+
79
+ * send_sms($to,$from,$text,$web_url,$tag,$type) - Sending a SMS
80
+ * create_sms_campaign($camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date) - Create a SMS campaign
81
+ * update_sms_campaign($id,$camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date) - Update a SMS campaign
82
+ * send_bat_sms($campid,$mobilephone) - Send a test SMS campaign
83
+
84
+ ####Recommendation:
85
+
86
+ If you face any error like "Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:func(144):reason(134)\n", with our library then by adding the below line of code just before curl_exec() ( line no. 48 ) in mailin.php file, you may no longer face this issue.
87
+ ```PHP
88
+ curl_setopt($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");
89
+ ```
90
+ The content of the file is available here: http://curl.haxx.se/ca/cacert.pem
vendor/mailin-api/mailin-api-php/V1.0/examples/tutorial1.php ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require('../mailin.php');
4
+ /*
5
+ * This will initiate the API with the endpoint and your access and secret key.
6
+ *
7
+ */
8
+ $mailin = new Mailin('https://api.sendinblue.com/v1.0','Your access key','Your secret key');
9
+
10
+ /** Prepare variables for easy use **/
11
+
12
+ $to = array("to@example.net"=>"to whom!"); //mandatory
13
+ $subject = "My subject"; //mandatory
14
+ $from = array("from@email.com","from email!"); //mandatory
15
+ $html = "This is the <h1>HTML</h1>"; //mandatory
16
+ $text = "This is the text";
17
+ $cc = array("cc@example.net"=>"cc whom!");
18
+ $bcc = array("bcc@example.net"=>"bcc whom!");
19
+ $replyto = array("replyto@email.com","reply to!");
20
+ $attachment = array(); //provide the absolute url of the attachment/s
21
+ $headers = array("Content-Type"=> "text/html; charset=iso-8859-1","X-Ewiufkdsjfhn"=> "hello","X-Custom" => "Custom");
22
+
23
+ var_dump($mailin->send_email($to,$subject,$from,$html,$text,$cc,$bcc,$replyto,$attachment,$headers));
vendor/mailin-api/mailin-api-php/V1.0/examples/tutorial2.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require('../mailin.php');
4
+ /*
5
+ * This will initiate the API with the endpoint and your access and secret key.
6
+ *
7
+ */
8
+ $mailin = new Mailin('https://api.sendinblue.com/v1.0','Your access key','Your secret key');
9
+ /*
10
+ * This will get all your campaigns
11
+ *
12
+ */
13
+ var_dump($mailin->get_campaigns());
14
+
15
+ ?>
vendor/mailin-api/mailin-api-php/V1.0/examples/tutorial3.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require('../mailin.php');
4
+ /*
5
+ * This will initiate the API with the endpoint and your access and secret key.
6
+ *
7
+ */
8
+ $mailin = new Mailin('https://api.sendinblue.com/v1.0','Your access key','Your secret key');
9
+ /*
10
+ * This will send an SMS
11
+ *
12
+ */
13
+ var_dump($mailin->send_sms("1231231313","From!","This is a test","http://example.com","tag1"));
14
+
15
+ ?>
vendor/mailin-api/mailin-api-php/V1.0/mailin.php ADDED
@@ -0,0 +1,333 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Mailin REST client
4
+ */
5
+ class Mailin
6
+ {
7
+ public $access_key;
8
+ public $secret_key;
9
+ public $base_url;
10
+ public $curl_opts = array();
11
+ public function __construct($base_url,$access_key,$secret_key)
12
+ {
13
+ if(!function_exists('curl_init'))
14
+ {
15
+ throw new Exception('Mailin requires CURL module');
16
+ }
17
+ $this->base_url = $base_url;
18
+ $this->access_key = $access_key;
19
+ $this->secret_key = $secret_key;
20
+ }
21
+ /**
22
+ * Do CURL request with authorization
23
+ */
24
+ private function do_request($resource,$method,$input)
25
+ {
26
+ $called_url = $this->base_url."/".$resource;
27
+ $ch = curl_init($called_url);
28
+ $c_date_time = date("r");
29
+ $md5_content = "";
30
+ if($input!="") {
31
+ $md5_content = md5($input);
32
+ }
33
+ $content_type = "application/json";
34
+ $sign_string = $method."\n".$md5_content."\n".$content_type."\n".$c_date_time."\n".$called_url;
35
+ $time_header = 'X-mailin-date:'.$c_date_time;
36
+ $auth_header = 'Authorization:'.$this->access_key.":".base64_encode(hash_hmac('sha1' , utf8_encode($sign_string) ,$this->secret_key));
37
+ $content_header = "Content-Type:application/json";
38
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
39
+ // Windows only over-ride
40
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
41
+ }
42
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array($time_header,$auth_header,$content_header));
43
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
44
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
45
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
46
+ curl_setopt($ch, CURLOPT_HEADER, 0);
47
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $input);
48
+ $data = curl_exec($ch);
49
+ if(curl_errno($ch))
50
+ {
51
+ echo 'Curl error: ' . curl_error($ch). '\n';
52
+ }
53
+ curl_close($ch);
54
+ return json_decode($data,true);
55
+ }
56
+ public function get($resource,$input)
57
+ {
58
+ return $this->do_request($resource,"GET",$input);
59
+ }
60
+ public function put($resource,$input)
61
+ {
62
+ return $this->do_request($resource,"PUT",$input);
63
+ }
64
+ public function post($resource,$input)
65
+ {
66
+ return $this->do_request($resource,"POST",$input);
67
+ }
68
+ public function delete($resource,$input)
69
+ {
70
+ return $this->do_request($resource,"DELETE",$input);
71
+ }
72
+ public function get_account()
73
+ {
74
+ return $this->get("account","");
75
+ }
76
+ public function get_smtp_details()
77
+ {
78
+ return $this->get("account/smtpdetail","");
79
+ }
80
+ public function create_child_account($email,$password,$company_org,$first_name,$last_name,$credits,$associate_ip)
81
+ {
82
+ return $this->post("account",json_encode(array("child_email"=>$email,"password"=>$password,"company_org"=>$company_org,"first_name"=>$first_name,"last_name"=>$last_name,"credits"=>$credits,"associate_ip"=>$associate_ip)));
83
+ }
84
+ public function update_child_account($child_authkey,$company_org,$first_name,$last_name,$password,$associate_ip,$disassociate_ip)
85
+ {
86
+ return $this->put("account",json_encode(array("auth_key"=>$child_authkey,"company_org"=>$company_org,"first_name"=>$first_name,"last_name"=>$last_name,"password"=>$password,"associate_ip"=>$associate_ip,"disassociate_ip"=>$disassociate_ip)));
87
+ }
88
+ public function delete_child_account($child_authkey)
89
+ {
90
+ return $this->delete("account/".$child_authkey,"");
91
+ }
92
+ public function get_child_account($child_authkey)
93
+ {
94
+ return $this->post("account/getchild",json_encode(array("auth_key"=>$child_authkey)));
95
+ }
96
+ public function add_remove_child_credits($child_authkey,$add_credits,$remove_credits)
97
+ {
98
+ return $this->post("account/addrmvcredit",json_encode(array("auth_key"=>$child_authkey,"add_credit"=>$add_credits,"rmv_credit"=>$remove_credits)));
99
+ }
100
+ public function send_sms($to,$from,$text,$web_url,$tag,$type)
101
+ {
102
+ return $this->post("sms",json_encode(array("text"=>$text,"tag"=>$tag,"web_url"=>$web_url,"from"=>$from,"to"=>$to,"type"=>$type)));
103
+ }
104
+ public function create_sms_campaign($camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date)
105
+ {
106
+ return $this->post("sms",json_encode(array("name"=>$camp_name,"sender"=>$sender,"content"=>$content,"bat"=>$bat_sent,"listid"=>$listids,"exclude_list"=>$exclude_list, "scheduled_date"=>$scheduled_date)));
107
+ }
108
+ public function update_sms_campaign($id,$camp_name,$sender,$content,$bat_sent,$listids,$exclude_list,$scheduled_date)
109
+ {
110
+ return $this->put("sms/".$id,json_encode(array("name"=>$camp_name,"sender"=>$sender,"content"=>$content,"bat"=>$bat_sent,"listid"=>$listids,"exclude_list"=>$exclude_list, "scheduled_date"=>$scheduled_date)));
111
+ }
112
+ public function send_bat_sms($campid,$mobilephone)
113
+ {
114
+ return $this->get("sms/".$campid,json_encode(array("to"=>$mobilephone)));
115
+ }
116
+ public function get_campaigns($type,$status,$page,$page_limit)
117
+ {
118
+ return $this->get("campaign",json_encode(array("type"=>$type,"status"=>$status,"page"=>$page,"page_limit"=>$page_limit)));
119
+ }
120
+ public function get_campaign($id)
121
+ {
122
+ return $this->get("campaign/".$id,"");
123
+ }
124
+ public function create_campaign($category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$attachmentUrl,$inline_image)
125
+ {
126
+ return $this->post("campaign",json_encode(array("category"=>$category,"from_name"=>$from_name,"name"=>$name,"bat"=>$bat_sent,"html_content"=>$html_content,"html_url"=>$html_url,"listid"=>$listid,"scheduled_date"=>$scheduled_date,"subject"=>$subject,"from_email"=>$from_email,"reply_to"=>$reply_to,"to_field"=>$to_field,"exclude_list"=>$exclude_list,"attachment_url"=>$attachmentUrl,"inline_image"=>$inline_image)));
127
+ }
128
+ public function delete_campaign($id)
129
+ {
130
+ return $this->delete("campaign/".$id,"");
131
+ }
132
+ public function update_campaign($id,$category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$attachmentUrl,$inline_image)
133
+ {
134
+ return $this->put("campaign/".$id,json_encode(array("category"=>$category,"from_name"=>$from_name,"name"=>$name,"bat"=>$bat_sent,"html_content"=>$html_content,"html_url"=>$html_url,"listid"=>$listid,"scheduled_date"=>$scheduled_date,"subject"=>$subject,"from_email"=>$from_email,"reply_to"=>$reply_to,"to_field"=>$to_field,"exclude_list"=>$exclude_list,"attachment_url"=>$attachmentUrl,"inline_image"=>$inline_image)));
135
+ }
136
+ public function campaign_report_email($id,$lang,$email_subject,$email_to,$email_content_type,$email_bcc,$email_cc,$email_body)
137
+ {
138
+ return $this->post("campaign/".$id."/report",json_encode(array("lang"=>$lang,"email_subject"=>$email_subject,"email_to"=>$email_to,"email_content_type"=>$email_content_type,"email_bcc"=>$email_bcc,"email_cc"=>$email_cc,"email_body"=>$email_body)));
139
+ }
140
+ public function campaign_recipients_export($id,$notify_url,$type)
141
+ {
142
+ return $this->post("campaign/".$id."/recipients",json_encode(array("notify_url"=>$notify_url,"type"=>$type)));
143
+ }
144
+ public function send_bat_email($campid,$email_to)
145
+ {
146
+ return $this->post("campaign/".$campid."/test",json_encode(array("emails"=>$email_to)));
147
+ }
148
+ public function create_trigger_campaign($category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$recurring,$attachmentUrl,$inline_image)
149
+ {
150
+ return $this->post("campaign",json_encode(array("category"=>$category,"from_name"=>$from_name,"trigger_name"=>$name,"bat"=>$bat_sent,"html_content"=>$html_content,"html_url"=>$html_url,"listid"=>$listid,"scheduled_date"=>$scheduled_date,"subject"=>$subject,"from_email"=>$from_email,"reply_to"=>$reply_to,"to_field"=>$to_field,"exclude_list"=>$exclude_list,"recurring"=>$recurring,"attachment_url"=>$attachmentUrl,"inline_image"=>$inline_image)));
151
+ }
152
+ public function update_trigger_campaign($id,$category,$from_name,$name,$bat_sent,$html_content,$html_url,$listid,$scheduled_date,$subject,$from_email,$reply_to,$to_field,$exclude_list,$recurring,$attachmentUrl,$inline_image)
153
+ {
154
+ return $this->put("campaign/".$id,json_encode(array("category"=>$category,"from_name"=>$from_name,"trigger_name"=>$name,"bat"=>$bat_sent,"html_content"=>$html_content,"html_url"=>$html_url,"listid"=>$listid,"scheduled_date"=>$scheduled_date,"subject"=>$subject,"from_email"=>$from_email,"reply_to"=>$reply_to,"to_field"=>$to_field,"exclude_list"=>$exclude_list,"recurring"=>$recurring,"attachment_url"=>$attachmentUrl,"inline_image"=>$inline_image)));
155
+ }
156
+ public function campaign_share_link($campaign_ids)
157
+ {
158
+ return $this->post("campaign/sharelink",json_encode(array("camp_ids"=>$campaign_ids)));
159
+ }
160
+ public function update_campaign_status($id,$status)
161
+ {
162
+ return $this->put("campaign/".$id."/updatecampstatus",json_encode(array("status"=>$status)));
163
+ }
164
+ public function get_processes()
165
+ {
166
+ return $this->get("process","");
167
+ }
168
+ public function get_process($id)
169
+ {
170
+ return $this->get("process/".$id,"");
171
+ }
172
+ public function get_lists()
173
+ {
174
+ return $this->get("list","");
175
+ }
176
+ public function get_list($id)
177
+ {
178
+ return $this->get("list/".$id,"");
179
+ }
180
+ public function create_list($list_name,$list_parent)
181
+ {
182
+ return $this->post("list",json_encode(array("list_name"=>$list_name,"list_parent"=>$list_parent)));
183
+ }
184
+ public function delete_list($id)
185
+ {
186
+ return $this->delete("list/".$id,"");
187
+ }
188
+ public function update_list($id,$list_name,$list_parent)
189
+ {
190
+ return $this->put("list/".$id,json_encode(array("list_name"=>$list_name,"list_parent"=>$list_parent)));
191
+ }
192
+ public function display_list_users($listids,$page,$page_limit)
193
+ {
194
+ return $this->post("list/display",json_encode(array("listids"=>$listids, "page"=>$page, "page_limit"=>$page_limit)));
195
+ }
196
+ public function add_users_list($id,$users)
197
+ {
198
+ return $this->post("list/".$id."/users",json_encode(array("users"=>$users)));
199
+ }
200
+ public function delete_users_list($id,$users)
201
+ {
202
+ return $this->delete("list/".$id."/delusers",json_encode(array("users"=>$users)));
203
+ }
204
+ public function send_email($to,$subject,$from,$html,$text,$cc,$bcc,$replyto,$attachment,$headers)
205
+ {
206
+ return $this->post("email",json_encode(array("cc"=>$cc,"text"=>$text,"bcc"=>$bcc,"replyto"=>$replyto,"html"=>$html,"to"=>$to,"attachment"=>$attachment,"from"=>$from,"subject"=>$subject,"headers"=>$headers)));
207
+ }
208
+ public function get_webhooks()
209
+ {
210
+ return $this->get("webhook","");
211
+ }
212
+ public function get_webhook($id)
213
+ {
214
+ return $this->get("webhook/".$id,"");
215
+ }
216
+ public function create_webhook($url,$description,$events)
217
+ {
218
+ return $this->post("webhook",json_encode(array("url"=>$url,"description"=>$description,"events"=>$events)));
219
+ }
220
+ public function delete_webhook($id)
221
+ {
222
+ return $this->delete("webhook/".$id,"");
223
+ }
224
+ public function update_webhook($id,$url,$description,$events)
225
+ {
226
+ return $this->put("webhook/".$id,json_encode(array("url"=>$url,"description"=>$description,"events"=>$events)));
227
+ }
228
+ public function get_statistics($aggregate,$tag,$days,$end_date,$start_date)
229
+ {
230
+ return $this->post("statistics",json_encode(array("aggregate"=>$aggregate,"tag"=>$tag,"days"=>$days,"end_date"=>$end_date,"start_date"=>$start_date)));
231
+ }
232
+ public function get_user($email)
233
+ {
234
+ return $this->get("user/".$email,"");
235
+ }
236
+ public function create_user($attributes,$blacklisted,$email,$listid)
237
+ {
238
+ return $this->post("user",json_encode(array("attributes"=>$attributes,"blacklisted"=>$blacklisted,"email"=>$email,"listid"=>$listid)));
239
+ }
240
+ public function delete_user($email)
241
+ {
242
+ return $this->delete("user/".$email,"");
243
+ }
244
+ public function update_user($email,$attributes,$blacklisted,$listid,$listid_unlink)
245
+ {
246
+ return $this->put("user/".$email,json_encode(array("attributes"=>$attributes,"blacklisted"=>$blacklisted,"listid"=>$listid,"listid_unlink"=>$listid_unlink)));
247
+ }
248
+ public function import_users($url,$listids,$notify_url,$name,$folder_id)
249
+ {
250
+ return $this->post("user/import",json_encode(array("url"=>$url,"listids"=>$listids,"notify_url"=>$notify_url,"name"=>$name,"list_parent"=>$folder_id)));
251
+ }
252
+ public function export_users($export_attrib,$filter,$notify_url)
253
+ {
254
+ return $this->post("user/export",json_encode(array("export_attrib"=>$export_attrib,"filter"=>$filter,"notify_url"=>$notify_url)));
255
+ }
256
+ public function create_update_user($email,$attributes,$blacklisted,$listid,$listid_unlink,$blacklisted_sms)
257
+ {
258
+ return $this->post("user/createdituser",json_encode(array("email"=>$email,"attributes"=>$attributes,"blacklisted"=>$blacklisted,"listid"=>$listid,"listid_unlink"=>$listid_unlink,"blacklisted_sms"=>$blacklisted_sms)));
259
+ }
260
+ public function get_attributes()
261
+ {
262
+ return $this->get("attribute","");
263
+ }
264
+ public function get_attribute($type)
265
+ {
266
+ return $this->get("attribute/".$type,"");
267
+ }
268
+ public function create_attribute($type,$data)
269
+ {
270
+ return $this->post("attribute",json_encode(array("type"=>$type,"data"=>$data)));
271
+ }
272
+ public function delete_attribute($type,$data)
273
+ {
274
+ return $this->post("attribute/".$type,json_encode(array("data"=>$data)));
275
+ }
276
+ public function get_report($limit,$start_date,$end_date,$offset,$date,$days,$email)
277
+ {
278
+ return $this->post("report",json_encode(array("limit"=>$limit,"start_date"=>$start_date,"end_date"=>$end_date,"offset"=>$offset,"date"=>$date,"days"=>$days,"email"=>$email)));
279
+ }
280
+ public function get_folders()
281
+ {
282
+ return $this->get("folder","");
283
+ }
284
+ public function get_folder($id)
285
+ {
286
+ return $this->get("folder/".$id,"");
287
+ }
288
+ public function create_folder($name)
289
+ {
290
+ return $this->post("folder",json_encode(array("name"=>$name)));
291
+ }
292
+ public function delete_folder($id)
293
+ {
294
+ return $this->delete("folder/".$id,"");
295
+ }
296
+ public function update_folder($id,$name)
297
+ {
298
+ return $this->put("folder/".$id,json_encode(array("name"=>$name)));
299
+ }
300
+ public function delete_bounces($start_date,$end_date,$email)
301
+ {
302
+ return $this->post("bounces",json_encode(array("start_date"=>$start_date,"end_date"=>$end_date,"email"=>$email)));
303
+ }
304
+ public function send_transactional_template($id,$to,$cc,$bcc,$attr,$attachmentUrl,$attachment)
305
+ {
306
+ return $this->put("template/".$id,json_encode(array("cc"=>$cc,"to"=>$to,"attr"=>$attr,"bcc"=>$bcc,"attachment_url"=>$attachmentUrl,"attachment"=>$attachment)));
307
+ }
308
+ public function create_template($from_name,$name,$bat_sent,$html_content,$html_url,$subject,$from_email,$reply_to,$to_field,$status,$attach)
309
+ {
310
+ return $this->post("template",json_encode(array("from_name"=>$from_name,"template_name"=>$name,"bat"=>$bat_sent,"html_content"=>$html_content,"html_url"=>$html_url,"subject"=>$subject,"from_email"=>$from_email,"reply_to"=>$reply_to,"to_field"=>$to_field,"status"=>$status,"attachment"=>$attach)));
311
+ }
312
+ public function update_template($id,$from_name,$name,$bat_sent,$html_content,$html_url,$subject,$from_email,$reply_to,$to_field,$status,$attach)
313
+ {
314
+ return $this->put("template/".$id,json_encode(array("from_name"=>$from_name,"template_name"=>$name,"bat"=>$bat_sent,"html_content"=>$html_content,"html_url"=>$html_url,"subject"=>$subject,"from_email"=>$from_email,"reply_to"=>$reply_to,"to_field"=>$to_field,"status"=>$status,"attachment"=>$attach)));
315
+ }
316
+ public function get_senders($option)
317
+ {
318
+ return $this->get("advanced",json_encode(array("option"=>$option)));
319
+ }
320
+ public function create_sender($sender_name,$sender_email,$ip_domain)
321
+ {
322
+ return $this->post("advanced",json_encode(array("name"=>$sender_name,"email"=>$sender_email,"ip_domain"=>$ip_domain)));
323
+ }
324
+ public function update_sender($id,$sender_name,$sender_email,$ip_domain)
325
+ {
326
+ return $this->put("advanced/".$id,json_encode(array("name"=>$sender_name,"email"=>$sender_email,"ip_domain"=>$ip_domain)));
327
+ }
328
+ public function delete_sender($id)
329
+ {
330
+ return $this->delete("advanced/".$id,"");
331
+ }
332
+ }
333
+ ?>
vendor/mailin-api/mailin-api-php/V2.0/Mailin.php ADDED
@@ -0,0 +1,948 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * SendinBlue REST client
5
+ */
6
+
7
+ class Mailin
8
+ {
9
+ public $api_key;
10
+ public $base_url;
11
+ public $timeout;
12
+ public $curl_opts = array();
13
+ public function __construct($base_url,$api_key,$timeout='')
14
+ {
15
+ if(!function_exists('curl_init'))
16
+ {
17
+ throw new RuntimeException('Mailin requires cURL module');
18
+ }
19
+ $this->base_url = $base_url;
20
+ $this->api_key = $api_key;
21
+ $this->timeout = $timeout;
22
+ }
23
+ /**
24
+ * Do CURL request with authorization
25
+ */
26
+ private function do_request($resource,$method,$input)
27
+ {
28
+ $called_url = $this->base_url."/".$resource;
29
+ $ch = curl_init($called_url);
30
+ $auth_header = 'api-key:'.$this->api_key;
31
+ $content_header = "Content-Type:application/json";
32
+ $timeout = ($this->timeout!='')?($this->timeout):30000; //default timeout: 30 secs
33
+ if ($timeout!='' && ($timeout <= 0 || $timeout > 60000)) {
34
+ throw new Exception('value not allowed for timeout');
35
+ }
36
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
37
+ // Windows only over-ride
38
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
39
+ }
40
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array($auth_header,$content_header));
41
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
42
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
43
+ curl_setopt($ch, CURLOPT_TIMEOUT_MS, $timeout);
44
+ curl_setopt($ch, CURLOPT_HEADER, 0);
45
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $input);
46
+ $data = curl_exec($ch);
47
+ if(curl_errno($ch))
48
+ {
49
+ throw new RuntimeException('cURL error: ' . curl_error($ch));
50
+ }
51
+ if(!is_string($data) || !strlen($data)) {
52
+ throw new RuntimeException('Request Failed');
53
+ }
54
+ curl_close($ch);
55
+ return json_decode($data,true);
56
+ }
57
+ public function get($resource,$input)
58
+ {
59
+ return $this->do_request($resource,"GET",$input);
60
+ }
61
+ public function put($resource,$input)
62
+ {
63
+ return $this->do_request($resource,"PUT",$input);
64
+ }
65
+ public function post($resource,$input)
66
+ {
67
+ return $this->do_request($resource,"POST",$input);
68
+ }
69
+ public function delete($resource,$input)
70
+ {
71
+ return $this->do_request($resource,"DELETE",$input);
72
+ }
73
+
74
+ /*
75
+ Get Account.
76
+ No input required
77
+ */
78
+ public function get_account()
79
+ {
80
+ return $this->get("account","");
81
+ }
82
+
83
+ /*
84
+ Get SMTP details.
85
+ No input required
86
+ */
87
+ public function get_smtp_details()
88
+ {
89
+ return $this->get("account/smtpdetail","");
90
+ }
91
+
92
+ /*
93
+ Create Child Account.
94
+ @param {Array} data contains php array with key value pair.
95
+ @options data {String} child_email: Email address of Reseller child [Mandatory]
96
+ @options data {String} password: Password of Reseller child to login [Mandatory]
97
+ @options data {String} company_org: Name of Reseller child’s company [Mandatory]
98
+ @options data {String} first_name: First name of Reseller child [Mandatory]
99
+ @options data {String} last_name: Last name of Reseller child [Mandatory]
100
+ @options data {Array} credits: Number of email & sms credits respectively, which will be assigned to the Reseller child’s account [Optional]
101
+ - email_credit {Integer} number of email credits
102
+ - sms_credit {Integer} Number of sms credts
103
+ @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional]
104
+ */
105
+ public function create_child_account($data)
106
+ {
107
+ return $this->post("account",json_encode($data));
108
+ }
109
+
110
+ /*
111
+ Update Child Account.
112
+ @param {Array} data contains php array with key value pair.
113
+ @options data {String} auth_key: 16 character authorization key of Reseller child to be modified [Mandatory]
114
+ @options data {String} company_org: Name of Reseller child’s company [Optional]
115
+ @options data {String} first_name: First name of Reseller child [Optional]
116
+ @options data {String} last_name: Last name of Reseller child [Optional]
117
+ @options data {String} password: Password of Reseller child to login [Optional]
118
+ @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional]
119
+ @options data {Array} disassociate_ip: Disassociate dedicated IPs from reseller child. You can use commas to separate multiple IPs [Optional]
120
+ */
121
+ public function update_child_account($data)
122
+ {
123
+ return $this->put("account",json_encode($data));
124
+ }
125
+
126
+ /*
127
+ Delete Child Account.
128
+ @param {Array} data contains php array with key value pair.
129
+ @options data {String} auth_key: 16 character authorization key of Reseller child to be deleted [Mandatory]
130
+ */
131
+ public function delete_child_account($data)
132
+ {
133
+ return $this->delete("account/".$data['auth_key'],"");
134
+ }
135
+
136
+ /*
137
+ Get Reseller child Account.
138
+ @param {Array} data contains php array with key value pair.
139
+ @options data {String} auth_key: 16 character authorization key of Reseller child. Example : To get the details of more than one child account, use, {"key1":"abC01De2fGHI3jkL","key2":"mnO45Pq6rSTU7vWX"} [Mandatory]
140
+ */
141
+ public function get_reseller_child($data)
142
+ {
143
+ return $this->post("account/getchildv2",json_encode($data));
144
+ }
145
+
146
+ /*
147
+ Add/Remove Reseller child's Email/Sms credits.
148
+ @param {Array} data contains php array with key value pair.
149
+ @options data {String} auth_key: 16 character authorization key of Reseller child to modify credits [Mandatory]
150
+ @options data {Array} add_credit: Number of email & sms credits to be added. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if rmv_credit is empty]
151
+ - email_credit {Integer} number of email credits
152
+ - sms_credit {Integer} Number of sms credts
153
+ @options data {Array} rmv_credit: Number of email & sms credits to be removed. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if add_credits is empty]
154
+ - email_credit {Integer} number of email credits
155
+ - sms_credit {Integer} Number of sms credts
156
+ */
157
+ public function add_remove_child_credits($data)
158
+ {
159
+ return $this->post("account/addrmvcredit",json_encode($data));
160
+ }
161
+
162
+ /*
163
+ Get a particular campaign detail.
164
+ @param {Array} data contains php array with key value pair.
165
+ @options data {Integer} id: Unique Id of the campaign [Mandatory]
166
+ */
167
+ public function get_campaign_v2($data)
168
+ {
169
+ return $this->get("campaign/".$data['id']."/detailsv2","");
170
+ }
171
+
172
+ /*
173
+ Get all campaigns detail.
174
+ @param {Array} data contains php array with key value pair.
175
+ @options data {String} type: Type of campaign. Possible values – classic, trigger, sms, template ( case sensitive ) [Optional]
176
+ @options data {String} status: Status of campaign. Possible values – draft, sent, archive, queued, suspended, in_process, temp_active, temp_inactive ( case sensitive ) [Optional]
177
+ @options data {Integer} page: Maximum number of records per request is 500, if there are more than 500 campaigns then you can use this parameter to get next 500 results [Optional]
178
+ @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional]
179
+ */
180
+ public function get_campaigns_v2($data)
181
+ {
182
+ return $this->get("campaign/detailsv2",json_encode($data));
183
+ }
184
+
185
+ /*
186
+ Create and Schedule your campaigns. It returns the ID of the created campaign.
187
+ @param {Array} data contains php array with key value pair.
188
+ @options data {String} category: Tag name of the campaign [Optional]
189
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
190
+ @options data {String} name: Name of the campaign [Mandatory]
191
+ @options data {String} bat: Email address for test mail [Optional]
192
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
193
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
194
+ @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
195
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
196
+ @options data {String} subject: Subject of the campaign [Mandatory]
197
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
198
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
199
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM] To use the contact attributes here, these should already exist in SendinBlue account [Optional]
200
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
201
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
202
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
203
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
204
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
205
+
206
+ */
207
+ public function create_campaign($data)
208
+ {
209
+ return $this->post("campaign",json_encode($data));
210
+ }
211
+
212
+ /*
213
+ Update your campaign.
214
+ @param {Array} data contains php array with key value pair.
215
+ @options data {Integer} id: Id of campaign to be modified [Mandatory]
216
+ @options data {String} category: Tag name of the campaign [Optional]
217
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
218
+ @options data {String} name: Name of the campaign [Optional]
219
+ @options data {String} bat: Email address for test mail [Optional]
220
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Optional]
221
+ @options data {String} html_url: Url which content is the body of content [Optional]
222
+ @options data {Array} listid These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
223
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
224
+ @options data {String} subject: Subject of the campaign.
225
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
226
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
227
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
228
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
229
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
230
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
231
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
232
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
233
+ */
234
+ public function update_campaign($data)
235
+ {
236
+ $id = $data['id'];
237
+ unset($data['id']);
238
+ return $this->put("campaign/".$id,json_encode($data));
239
+ }
240
+
241
+ /*
242
+ Delete your campaigns.
243
+ @param {Array} data contains php array with key value pair.
244
+ @options data {Integer} id: Id of campaign to be deleted [Mandatory]
245
+ */
246
+ public function delete_campaign($data)
247
+ {
248
+ return $this->delete("campaign/".$data['id'],"");
249
+ }
250
+
251
+ /*
252
+ Send report of Sent and Archived campaign.
253
+ @param {Array} data contains php array with key value pair.
254
+ @options data {Integer} id: Id of campaign to send its report [Mandatory]
255
+ @options data {String} lang: Language of email content. Possible values – fr (default), en, es, it & pt [Optional]
256
+ @options data {String} email_subject: Message subject [Mandatory]
257
+ @options data {Array} email_to: Email address of the recipient(s). Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory]
258
+ @options data {String} email_content_type: Body of the message in text/HTML version. Possible values – text & html [Mandatory]
259
+ @options data {Array} email_bcc: Same as email_to but for Bcc [Optional]
260
+ @options data {Array} email_cc: Same as email_to but for Cc [Optional]
261
+ @options data {String} email_body: Body of the message [Mandatory]
262
+ */
263
+ public function campaign_report_email($data)
264
+ {
265
+ $id = $data['id'];
266
+ unset($data['id']);
267
+ return $this->post("campaign/".$id."/report",json_encode($data));
268
+ }
269
+
270
+ /*
271
+ Export the recipients of a specified campaign.
272
+ @param {Array} data contains php array with key value pair.
273
+ @options data {Integer} id: Id of campaign to export its recipients [Mandatory]
274
+ @options data {String} notify_url: URL that will be called once the export process is finished [Mandatory]
275
+ @options data {String} type: Type of recipients. Possible values – all, non_clicker, non_opener, clicker, opener, soft_bounces, hard_bounces & unsubscribes [Mandatory]
276
+ */
277
+ public function campaign_recipients_export($data)
278
+ {
279
+ $id = $data['id'];
280
+ unset($data['id']);
281
+ return $this->post("campaign/".$id."/recipients",json_encode($data));
282
+ }
283
+
284
+ /*
285
+ Get the Campaign name, subject and share link of the classic type campaigns only which are sent, for those which are not sent and the rest of campaign types like trigger, template & sms, will return an error message of share link not available.
286
+ @param {Array} data contains php array with key value pair.
287
+ @options data {Array} camp_ids: Id of campaign to get share link. You can use commas to separate multiple ids [Mandatory]
288
+ */
289
+
290
+ public function share_campaign($data)
291
+ {
292
+ return $this->post("campaign/sharelinkv2",json_encode($data));
293
+ }
294
+
295
+ /*
296
+ Send a Test Campaign.
297
+ @param {Array} data contains php array with key value pair.
298
+ @options data {Integer} id: Id of the campaign [Mandatory]
299
+ @options data {Array} emails: Email address of recipient(s) existing in the one of the lists & should not be blacklisted. Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory]
300
+ */
301
+ public function send_bat_email($data)
302
+ {
303
+ $id = $data['id'];
304
+ unset($data['id']);
305
+ return $this->post("campaign/".$id."/test",json_encode($data));
306
+ }
307
+
308
+ /*
309
+ Update the Campaign status.
310
+ @param {Array} data contains php array with key value pair.
311
+ @options data {Integer} id: Id of campaign to update its status [Mandatory]
312
+ @options data {String} status: Types of status. Possible values – suspended, archive, darchive, sent, queued, replicate and replicate_template ( case sensitive ) [Mandatory]
313
+ */
314
+ public function update_campaign_status($data)
315
+ {
316
+ $id = $data['id'];
317
+ unset($data['id']);
318
+ return $this->put("campaign/".$id."/updatecampstatus",json_encode($data));
319
+ }
320
+
321
+ /*
322
+ Create and schedule your Trigger campaigns.
323
+ @param {Array} data contains php array with key value pair.
324
+ @options data {String} category: Tag name of the campaign [Optional]
325
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
326
+ @options data {String} trigger_name: Name of the campaign [Mandatory]
327
+ @options data {String} bat: Email address for test mail [Optional]
328
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
329
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
330
+ @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
331
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
332
+ @options data {String} subject: Subject of the campaign [Mandatory]
333
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
334
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
335
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
336
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
337
+ @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional]
338
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
339
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
340
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
341
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
342
+ */
343
+ public function create_trigger_campaign($data)
344
+ {
345
+ return $this->post("campaign",json_encode($data));
346
+ }
347
+
348
+ /*
349
+ Update and schedule your Trigger campaigns.
350
+ @param {Array} data contains php array with key value pair.
351
+ @options data {Integer} id: Id of Trigger campaign to be modified [Mandatory]
352
+ @options data {String} category: Tag name of the campaign [Optional]
353
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
354
+ @options data {String} trigger_name: Name of the campaign [Mandatory]
355
+ @options data {String} bat Email address for test mail [Optional]
356
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
357
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
358
+ @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
359
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
360
+ @options data {String} subject: Subject of the campaign [Mandatory]
361
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
362
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
363
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
364
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
365
+ @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional]
366
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
367
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
368
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
369
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
370
+ */
371
+ public function update_trigger_campaign($data)
372
+ {
373
+ $id = $data['id'];
374
+ unset($data['id']);
375
+ return $this->put("campaign/".$id,json_encode($data));
376
+ }
377
+
378
+ /*
379
+ Get all folders detail.
380
+ @param {Array} data contains php array with key value pair.
381
+ @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 folders then you can use this parameter to get next 50 results [Mandatory]
382
+ @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
383
+ */
384
+ public function get_folders($data)
385
+ {
386
+ return $this->get("folder",json_encode($data));
387
+ }
388
+
389
+ /*
390
+ Get a particular folder detail.
391
+ @param {Array} data contains php array with key value pair.
392
+ @options data {Integer} id: Id of folder to get details [Mandatory]
393
+ */
394
+ public function get_folder($data)
395
+ {
396
+ return $this->get("folder/".$data['id'],"");
397
+ }
398
+
399
+ /*
400
+ Create a new folder.
401
+ @param {Array} data contains php array with key value pair.
402
+ @options data {String} name: Desired name of the folder to be created [Mandatory]
403
+ */
404
+ public function create_folder($data)
405
+ {
406
+ return $this->post("folder",json_encode($data));
407
+ }
408
+
409
+ /*
410
+ Delete a specific folder information.
411
+ @param {Array} data contains php array with key value pair.
412
+ @options data {Integer} id: Id of folder to be deleted [Mandatory]
413
+ */
414
+ public function delete_folder($data)
415
+ {
416
+ return $this->delete("folder/".$data['id'],"");
417
+ }
418
+
419
+ /*
420
+ Update an existing folder.
421
+ @param {Array} data contains php array with key value pair.
422
+ @options data {Integer} id: Id of folder to be modified [Mandatory]
423
+ @options data {String} name: Desired name of the folder to be modified [Mandatory]
424
+ */
425
+ public function update_folder($data)
426
+ {
427
+ $id = $data['id'];
428
+ unset($data['id']);
429
+ return $this->put("folder/".$id,json_encode($data));
430
+ }
431
+
432
+ /*
433
+ Get all lists detail.
434
+ @param {Array} data contains php array with key value pair.
435
+ @options data {Integer} list_parent: This is the existing folder id & can be used to get all lists belonging to it [Optional]
436
+ @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory]
437
+ @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
438
+ */
439
+ public function get_lists($data)
440
+ {
441
+ return $this->get("list",json_encode($data));
442
+ }
443
+
444
+ /*
445
+ Get a particular list detail.
446
+ @param {Array} data contains php array with key value pair.
447
+ @options data {Integer} id: Id of list to get details [Mandatory]
448
+ */
449
+ public function get_list($data)
450
+ {
451
+ return $this->get("list/".$data['id'],"");
452
+ }
453
+
454
+ /*
455
+ Create a new list.
456
+ @param {Array} data contains php array with key value pair.
457
+ @options data {String} list_name: Desired name of the list to be created [Mandatory]
458
+ @options data {Integer} list_parent: Folder ID [Mandatory]
459
+ */
460
+ public function create_list($data)
461
+ {
462
+ return $this->post("list",json_encode($data));
463
+ }
464
+
465
+ /*
466
+ Update a list.
467
+ @param {Array} data contains php array with key value pair.
468
+ @options data {Integer} id: Id of list to be modified [Mandatory]
469
+ @options data {String} list_name: Desired name of the list to be modified [Optional]
470
+ @options data {Integer} list_parent: Folder ID [Mandatory]
471
+ */
472
+ public function update_list($data)
473
+ {
474
+ $id = $data['id'];
475
+ unset($data['id']);
476
+ return $this->put("list/".$id,json_encode($data));
477
+ }
478
+
479
+ /*
480
+ Delete a specific list.
481
+ @param {Array} data contains php array with key value pair.
482
+ @options data {Integer} id: Id of list to be deleted [Mandatory]
483
+ */
484
+ public function delete_list($data)
485
+ {
486
+ return $this->delete("list/".$data['id'],"");
487
+ }
488
+
489
+ /*
490
+ Display details of all users for the given lists.
491
+ @param {Array} data contains php array with key value pair.
492
+ @options data {Array} listids: These are the list ids to get their data. The ids found will display records [Mandatory]
493
+ @options data {String} timestamp: This is date-time filter to fetch modified user records >= this time. Valid format Y-m-d H:i:s. Example: "2015-05-22 14:30:00" [Optional]
494
+ @options data {Integer} page: Maximum number of records per request is 500, if in your list there are more than 500 users then you can use this parameter to get next 500 results [Optional]
495
+ @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional]
496
+ */
497
+ public function display_list_users($data)
498
+ {
499
+ return $this->post("list/display",json_encode($data));
500
+ }
501
+
502
+ /*
503
+ Add already existing users in the SendinBlue contacts to the list.
504
+ @param {Array} data contains php array with key value pair.
505
+ @options data {Integer} id: Id of list to link users in it [Mandatory]
506
+ @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts. Example: "test@example.net". You can use commas to separate multiple users [Mandatory]
507
+ */
508
+
509
+ public function add_users_list($data)
510
+ {
511
+ $id = $data['id'];
512
+ unset($data['id']);
513
+ return $this->post("list/".$id."/users",json_encode($data));
514
+ }
515
+
516
+ /*
517
+ Delete already existing users in the SendinBlue contacts from the list.
518
+ @param {Array} data contains php array with key value pair.
519
+ @options data {Integer} id: Id of list to unlink users from it [Mandatory]
520
+ @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts to be modified. Example: "test@example.net". You can use commas to separate multiple users [Mandatory]
521
+ */
522
+ public function delete_users_list($data)
523
+ {
524
+ $id = $data['id'];
525
+ unset($data['id']);
526
+ return $this->delete("list/".$id."/delusers",json_encode($data));
527
+ }
528
+
529
+ /*
530
+ Access all the attributes information under the account.
531
+ No input required
532
+ */
533
+ public function get_attributes()
534
+ {
535
+ return $this->get("attribute","");
536
+ }
537
+
538
+ /*
539
+ Access the specific type of attribute information.
540
+ @param {Array} data contains php array with key value pair.
541
+ @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global [Optional]
542
+ */
543
+ public function get_attribute($data)
544
+ {
545
+ return $this->get("attribute/".$data['type'],"");
546
+ }
547
+
548
+ /*
549
+ Create an Attribute.
550
+ @param {Array} data contains php array with key value pair.
551
+ @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global ( case sensitive ) [Mandatory]
552
+ @options data {Array} data: The name and data type of ‘normal’ & ‘transactional’ attribute to be created in your SendinBlue account. It should be sent as an associative array. Example: array(‘ATTRIBUTE_NAME1′ => ‘DATA_TYPE1′, ‘ATTRIBUTE_NAME2’=> ‘DATA_TYPE2′).
553
+ The name and data value of ‘category’, ‘calculated’ & ‘global’, should be sent as JSON string. Example: ‘[{ "name":"ATTRIBUTE_NAME1", "value":"Attribute_value1" }, { "name":"ATTRIBUTE_NAME2", "value":"Attribute_value2" }]’. You can use commas to separate multiple attributes [Mandatory]
554
+ */
555
+ public function create_attribute($data)
556
+ {
557
+ return $this->post("attribute/",json_encode($data));
558
+ }
559
+
560
+ /*
561
+ Delete a specific type of attribute information.
562
+ @param {Array} data contains php array with key value pair.
563
+ @options data {Integer} type: Type of attribute to be deleted [Mandatory]
564
+ */
565
+ public function delete_attribute($data)
566
+ {
567
+ $type = $data['type'];
568
+ unset($data['type']);
569
+ return $this->post("attribute/".$type,json_encode($data));
570
+ }
571
+
572
+ /*
573
+ Create a new user if an email provided as input, doesn’t exists in the contact list of your SendinBlue account, otherwise it will update the existing user.
574
+ @param {Array} data contains php array with key value pair.
575
+ @options data {String} email: Email address of the user to be created in SendinBlue contacts. Already existing email address of user in the SendinBlue contacts to be modified [Mandatory]
576
+ @options data {Array} attributes: The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional]
577
+ @options data {Integer} blacklisted: This is used to blacklist/ Unblacklist a user. Possible values – 0 & 1. blacklisted = 1 means user has been blacklisted [Optional]
578
+ @options data {Array} listid: The list id(s) to be linked from user [Optional]
579
+ @options data {Array} listid_unlink: The list id(s) to be unlinked from user [Optional]
580
+ @options data {Array} blacklisted_sms: This is used to blacklist/ Unblacklist a user’s SMS number. Possible values – 0 & 1. blacklisted_sms = 1 means user’s SMS number has been blacklisted [Optional]
581
+ */
582
+ public function create_update_user($data)
583
+ {
584
+ return $this->post("user/createdituser",json_encode($data));
585
+ }
586
+
587
+ /*
588
+ Get Access a specific user Information.
589
+ @param {Array} data contains php array with key value pair.
590
+ @options data {String} email: Email address of the already existing user in the SendinBlue contacts [Mandatory]
591
+ */
592
+ public function get_user($data)
593
+ {
594
+ return $this->get("user/".$data['email'],"");
595
+ }
596
+
597
+ /*
598
+ Unlink existing user from all lists.
599
+ @param {Array} data contains php array with key value pair.
600
+ @options data {String} email: Email address of the already existing user in the SendinBlue contacts to be unlinked from all lists [Mandatory]
601
+ */
602
+ public function delete_user($data)
603
+ {
604
+ return $this->delete("user/".$data['email'],"");
605
+ }
606
+
607
+ /*
608
+ Import Users Information.
609
+ @param {Array} data contains php array with key value pair.
610
+ @options data {String} url: The URL of the file to be imported. Possible file types – .txt, .csv [Mandatory: if body is empty]
611
+ @options data {String} body: The Body with csv content to be imported. Example: ‘NAME;SURNAME;EMAIL\n"Name1";"Surname1";"example1@example.net"\n"Name2";"Surname2";"example2@example.net"‘, where \n separates each user data. You can use semicolon to separate multiple attributes [Mandatory: if url is empty]
612
+ @options data {Array} listids: These are the list ids in which the the users will be imported [Mandatory: if name is empty]
613
+ @options data {String} notify_url: URL that will be called once the import process is finished [Optional] In notify_url, we are sending the content using POST method
614
+ @options data {String} name: This is new list name which will be created first & then users will be imported in it [Mandatory: if listids is empty]
615
+ @options data {Integer} list_parent: This is the existing folder id & can be used with name parameter to make newly created list’s desired parent [Optional]
616
+ */
617
+ public function import_users($data)
618
+ {
619
+ return $this->post("user/import",json_encode($data));
620
+ }
621
+
622
+ /*
623
+ Export Users Information.
624
+ @param {Array} data contains php array with key value pair.
625
+ @options data {String} export_attrib: The name of attribute present in your SendinBlue account. You can use commas to separate multiple attributes. Example: "EMAIL,NAME,SMS" [Optional]
626
+ @options data {String} filter: Filter can be added to export users. Example: "{\"blacklisted\":1}", will export all blacklisted users [Mandatory]
627
+ @options data {String} notify_url: URL that will be called once the export process is finished [Optional]
628
+ */
629
+ public function export_users($data)
630
+ {
631
+ return $this->post("user/export",json_encode($data));
632
+ }
633
+
634
+ /*
635
+ Get all the processes information under the account.
636
+ @param {Array} data contains php array with key value pair.
637
+ @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory]
638
+ @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
639
+ */
640
+ public function get_processes($data)
641
+ {
642
+ return $this->get("process",json_encode($data));
643
+ }
644
+
645
+ /*
646
+ Get the process information.
647
+ @param {Array} data contains php array with key value pair.
648
+ @options data {Integer} id: Id of process to get details [Mandatory]
649
+ */
650
+ public function get_process($data)
651
+ {
652
+ return $this->get("process/".$data['id'],"");
653
+ }
654
+
655
+ /*
656
+ To retrieve details of all webhooks.
657
+ @param {Array} data contains php array with key value pair.
658
+ @options data {String} is_plat: Flag to get webhooks. Possible values – 0 & 1. Example: to get Transactional webhooks, use $is_plat=0, to get Marketing webhooks, use $is_plat=1, & to get all webhooks, use $is_plat="" [Optional]
659
+ */
660
+ public function get_webhooks($data)
661
+ {
662
+ return $this->get("webhook",json_encode($data));
663
+ }
664
+
665
+ /*
666
+ To retrieve details of any particular webhook.
667
+ @param {Array} data contains php array with key value pair.
668
+ @options data {Integer} id: Id of webhook to get details [Mandatory]
669
+ */
670
+ public function get_webhook($data)
671
+ {
672
+ return $this->get("webhook/".$data['id'],"");
673
+ }
674
+
675
+ /*
676
+ Create a Webhook.
677
+ @param {Array} data contains php array with key value pair.
678
+ @options data {String} url: URL that will be triggered by a webhook [Mandatory]
679
+ @options data {String} description: Webook description [Optional]
680
+ @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory]
681
+ @options data {Integer} is_plat: Flag to create webhook type. Possible values – 0 (default) & 1. Example: to create Transactional webhooks, use $is_plat=0, & to create Marketing webhooks, use $is_plat=1 [Optional]
682
+ */
683
+ public function create_webhook($data)
684
+ {
685
+ return $this->post("webhook",json_encode($data));
686
+ }
687
+
688
+ /*
689
+ Delete a webhook.
690
+ @param {Array} data contains php array with key value pair.
691
+ @options data {Integer} id: Id of webhook to be deleted [Mandatory]
692
+ */
693
+ public function delete_webhook($data)
694
+ {
695
+ return $this->delete("webhook/".$data['id'],"");
696
+ }
697
+
698
+ /*
699
+ Update a webhook.
700
+ @param {Array} data contains php array with key value pair.
701
+ @options data {Integer} id: Id of webhook to be modified [Mandatory]
702
+ @options data {String} url: URL that will be triggered by a webhook [Mandatory]
703
+ @options data {String} description: Webook description [Optional]
704
+ @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory]
705
+ */
706
+ public function update_webhook($data)
707
+ {
708
+ $id = $data['id'];
709
+ unset($data['id']);
710
+ return $this->put("webhook/".$id,json_encode($data));
711
+ }
712
+
713
+ /*
714
+ Get Access of created senders information.
715
+ @param {Array} data contains php array with key value pair.
716
+ @options data {String} option: Options to get senders. Possible options – IP-wise, & Domain-wise ( only for dedicated IP clients ). Example: to get senders with specific IP, use $option=’1.2.3.4′, to get senders with specific domain use, $option=’domain.com’, & to get all senders, use $option="" [Optional]
717
+ */
718
+ public function get_senders($data)
719
+ {
720
+ return $this->get("advanced",json_encode($data));
721
+ }
722
+
723
+ /*
724
+ Create your Senders.
725
+ @param {Array} data contains php array with key value pair.
726
+ @options data {String} name: Name of the sender [Mandatory]
727
+ @options data {String} email: Email address of the sender [Mandatory]
728
+ @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank]
729
+ */
730
+ public function create_sender($data)
731
+ {
732
+ return $this->post("advanced",json_encode($data));
733
+ }
734
+
735
+ /*
736
+ Update your Senders.
737
+ @param {Array} data contains php array with key value pair.
738
+ @options data {Integer} id: Id of sender to be modified [Mandatory]
739
+ @options data {String} name: Name of the sender [Mandatory]
740
+ @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank]
741
+ */
742
+ public function update_sender($data)
743
+ {
744
+ $id = $data['id'];
745
+ unset($data['id']);
746
+ return $this->put("advanced/".$id,json_encode($data));
747
+ }
748
+
749
+ /*
750
+ Delete your Sender Information.
751
+ @param {Array} data contains php array with key value pair.
752
+ @options data {Integer} id: Id of sender to be deleted [Mandatory]
753
+ */
754
+ public function delete_sender($data)
755
+ {
756
+ return $this->delete("advanced/".$data['id'],"");
757
+ }
758
+
759
+ /*
760
+ Send Transactional Email.
761
+ @param {Array} data contains php array with key value pair.
762
+ @options data {Array} to: Email address of the recipient(s). It should be sent as an associative array. Example: array("to@example.net"=>"to whom"). You can use commas to separate multiple recipients [Mandatory]
763
+ @options data {String} subject: Message subject [Mandatory]
764
+ @options data {Array} from Email address for From header. It should be sent as an array. Example: array("from@email.com","from email") [Mandatory]
765
+ @options data {String} html: Body of the message. (HTML version) [Mandatory]. To send inline images, use <img src="{YourFileName.Extension}" alt="image" border="0" >, the 'src' attribute value inside {} (curly braces) should be same as the filename used in 'inline_image' parameter
766
+ @options data {String} text: Body of the message. (text version) [Optional]
767
+ @options data {Array} cc: Same as to but for Cc. Example: array("cc@example.net","cc whom") [Optional]
768
+ @options data {Array} bcc: Same as to but for Bcc. Example: array("bcc@example.net","bcc whom") [Optional]
769
+ @options data {Array} replyto: Same as from but for Reply To. Example: array("from@email.com","from email") [Optional]
770
+ @options data {Array} attachment: Provide the absolute url of the attachment/s. Possible extension values = gif, png, bmp, cgm, jpg, jpeg, txt, css, shtml, html, htm, csv, zip, pdf, xml, doc, xls, ppt, tar, and ez. To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple attachments [Optional]
771
+ @options data {Array} headers: The headers will be sent along with the mail headers in original email. Example: array("Content-Type"=>"text/html; charset=iso-8859-1"). You can use commas to separate multiple headers [Optional]
772
+ @options data {Array} inline_image: Pass your inline image/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple inline images [Optional]
773
+ */
774
+ public function send_email($data)
775
+ {
776
+ return $this->post("email",json_encode($data));
777
+ }
778
+
779
+ /*
780
+ Aggregate / date-wise report of the SendinBlue SMTP account.
781
+ @param {Array} data contains php array with key value pair.
782
+ @options data {Integer} aggregate: This is used to indicate, you are interested in all-time totals. Possible values – 0 & 1. aggregate = 0 means it will not aggregate records, and will show stats per day/date wise [Optional]
783
+ @options data {String} start_date: The start date to look up statistics. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
784
+ @options data {String} end_date: The end date to look up statistics. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
785
+ @options data {Integer} days: Number of days in the past to include statistics ( Includes today ). It must be an integer greater than 0 [Optional]
786
+ @options data {String} tag: The tag you will specify to retrieve detailed stats. It must be an existing tag that has statistics [Optional]
787
+ */
788
+ public function get_statistics($data)
789
+ {
790
+ return $this->post("statistics",json_encode($data));
791
+ }
792
+
793
+ /*
794
+ Get Email Event report.
795
+ @param {Array} data contains php array with key value pair.
796
+ @options data {Integer} limit: To limit the number of results returned. It should be an integer [Optional]
797
+ @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
798
+ @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
799
+ @options data {Integer} offset: Beginning point in the list to retrieve from. It should be an integer [Optional]
800
+ @options data {String} date: Specific date to get its report. Date must be in YYYY-MM-DD format and should be earlier than todays date [Optional]
801
+ @options data {Integer} days: Number of days in the past (includes today). If specified, must be an integer greater than 0 [Optional]
802
+ @options data {String} email: Email address to search report for [Optional]
803
+ */
804
+ public function get_report($data)
805
+ {
806
+ return $this->post("report",json_encode($data));
807
+ }
808
+
809
+ /*
810
+ Delete any hardbounce, which actually would have been blocked due to some temporary ISP failures.
811
+ @param {Array} data contains php array with key value pair.
812
+ @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
813
+ @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
814
+ @options data {String} email: Email address to delete its bounces [Optional]
815
+ */
816
+ public function delete_bounces($data)
817
+ {
818
+ return $this->post("bounces",json_encode($data));
819
+ }
820
+
821
+ /*
822
+ Send templates created on SendinBlue, through SendinBlue SMTP (transactional mails).
823
+ @param {Array} data contains php array with key value pair.
824
+ @options data {Integer} id: Id of the template created on SendinBlue account [Mandatory]
825
+ @options data {String} to: Email address of the recipient(s). You can use pipe ( | ) to separate multiple recipients. Example: "to-example@example.net|to2-example@example.net" [Mandatory]
826
+ @options data {String} cc: Same as to but for Cc [Optional]
827
+ @options data {String} bcc: Same as to but for Bcc [Optional]
828
+ @options data {Array} attrv The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional]
829
+ @options data {String} attachment_url: Provide the absolute url of the attachment. Url not allowed from local machine. File must be hosted somewhere [Optional]
830
+ @options data {Array} attachment: To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array [Optional]
831
+ */
832
+ public function send_transactional_template($data)
833
+ {
834
+ $id = $data['id'];
835
+ unset($data['id']);
836
+ return $this->put("template/".$id,json_encode($data));
837
+ }
838
+
839
+ /*
840
+ Create a Template.
841
+ @param {Array} data contains php array with key value pair.
842
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
843
+ @options data {String} template_name: Name of the Template [Mandatory]
844
+ @options data {String} bat: Email address for test mail [Optional]
845
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
846
+ @options data {String} html_url Url: which content is the body of content [Mandatory: if html_content is empty]
847
+ @options data {String} subject: Subject of the campaign [Mandatory]
848
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
849
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
850
+ @options data {String} to_fieldv This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
851
+ @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional]
852
+ @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional]
853
+ */
854
+ public function create_template($data)
855
+ {
856
+ return $this->post("template",json_encode($data));
857
+ }
858
+
859
+ /*
860
+ Update a Template.
861
+ @param {Array} data contains php array with key value pair.
862
+ @options data {Integer} id: Id of Template to be modified [Mandatory]
863
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
864
+ @options data {String} template_name: Name of the Template [Mandatory]
865
+ @options data {String} bat: Email address for test mail [Optional]
866
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
867
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
868
+ @options data {String} subject: Subject of the campaign [Mandatory]
869
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
870
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
871
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
872
+ @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional]
873
+ @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional]
874
+ */
875
+ public function update_template($data)
876
+ {
877
+ $id = $data['id'];
878
+ unset($data['id']);
879
+ return $this->put("template/".$id,json_encode($data));
880
+ }
881
+
882
+ /*
883
+ Send a transactional SMS.
884
+ @param {Array} data contains php array with key value pair.
885
+ @options data {String} to: The mobile number to send SMS to with country code [Mandatory]
886
+ @options data {String} from: The name of the sender. The number of characters is limited to 11 (alphanumeric format) [Mandatory]
887
+ @options data {String} text: The text of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Mandatory]
888
+ @options data {String} web_url: The web URL that can be called once the message is successfully delivered [Optional]
889
+ @options data {String} tag: The tag that you can associate with the message [Optional]
890
+ @options data {String} type: Type of message. Possible values – marketing (default) & transactional. You can use marketing for sending marketing SMS, & for sending transactional SMS, use transactional type [Optional]
891
+ */
892
+ public function send_sms($data)
893
+ {
894
+ return $this->post("sms",json_encode($data));
895
+ }
896
+
897
+ /*
898
+ Create & Schedule your SMS campaigns.
899
+ @param {Array} data contains php array with key value pair.
900
+ @options data {String} name: Name of the SMS campaign [Mandatory]
901
+ @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional]
902
+ @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional]
903
+ @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional]
904
+ @options data {Array} listid: These are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty]
905
+ @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional]
906
+ @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional]
907
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
908
+ */
909
+ public function create_sms_campaign($data)
910
+ {
911
+ return $this->post("sms",json_encode($data));
912
+ }
913
+
914
+ /*
915
+ Update your SMS campaigns.
916
+ @param {Array} data contains php array with key value pair.
917
+ @options data {Integer} id: Id of the SMS campaign [Mandatory]
918
+ @options data {String} name: Name of the SMS campaign [Optional]
919
+ @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional]
920
+ @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional]
921
+ @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional]
922
+ @options data {Array} listid: hese are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty]
923
+ @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional]
924
+ @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional]
925
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
926
+ */
927
+ public function update_sms_campaign($data)
928
+ {
929
+ $id = $data['id'];
930
+ unset($data['id']);
931
+ return $this->put("sms/".$id,json_encode($data));
932
+ }
933
+
934
+ /*
935
+ Send a Test SMS.
936
+ @param {Array} data contains php array with key value pair.
937
+ @options data {Integer} id: Id of the SMS campaign [Mandatory]
938
+ @options data {String} to: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Mandatory]
939
+ */
940
+ public function send_bat_sms($data)
941
+ {
942
+ $id = $data['id'];
943
+ unset($data['id']);
944
+ return $this->get("sms/".$id,json_encode($data));
945
+ }
946
+
947
+ }
948
+ ?>
vendor/mailin-api/mailin-api-php/V2.0/README.md ADDED
@@ -0,0 +1,135 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SendinBlue Php Library
2
+
3
+ This is the SendinBlue Php library. It implements the various exposed APIs that you can read more about on https://apidocs.sendinblue.com.
4
+
5
+
6
+ ## Installation and Quickstart
7
+
8
+ * You will need to first get the Access key from [SendinBlue](https://www.sendinblue.com).
9
+
10
+ * Our library supports a timeout value, default is 30,000 MS ( 30 secs ), which you can pass as 3rd parameter in Mailin class Object.
11
+
12
+ * Assuming that you have cloned this git repo, or downloaded Mailin.php and its in the same directory than the script. You can use this small sample script to get started.
13
+
14
+ ```PHP
15
+ <?php
16
+ require('Mailin.php');
17
+ /*
18
+ * This will initiate the API with the endpoint and your access key.
19
+ *
20
+ */
21
+ $mailin = new Mailin('https://api.sendinblue.com/v2.0','Your access key', 5000); // Optional parameter: Timeout in MS
22
+
23
+ /** Prepare variables for easy use **/
24
+
25
+ $data = array( "to" => array("to@example.net"=>"to whom!"),
26
+ "cc" => array("cc@example.net"=>"cc whom!"),
27
+ "bcc" =>array("bcc@example.net"=>"bcc whom!"),
28
+ "from" => array("from@email.com","from email!"),
29
+ "replyto" => array("replyto@email.com","reply to!"),
30
+ "subject" => "My subject",
31
+ "text" => "This is the text",
32
+ "html" => "This is the <h1>HTML</h1><br/>
33
+ This is inline image 1.<br/>
34
+ <img src=\"{myinlineimage1.png}\" alt=\"image1\" border=\"0\"><br/>
35
+ Some text<br/>
36
+ This is inline image 2.<br/>
37
+ <img src=\"{myinlineimage2.jpg}\" alt=\"image2\" border=\"0\"><br/>
38
+ Some more text<br/>
39
+ Re-used inline image 1.<br/>
40
+ <img src=\"{myinlineimage1.png}\" alt=\"image3\" border=\"0\">",
41
+ "attachment" => array(),
42
+ "headers" => array("Content-Type"=> "text/html; charset=iso-8859-1","X-param1"=> "value1", "X-param2"=> "value2",...,"X-Mailin-custom"=>"my custom value", "X-Mailin-IP"=> "102.102.1.2", "X-Mailin-Tag" => "My tag"),
43
+ "inline_image" => array('myinlineimage1.png' => "your_png_files_base64_encoded_chunk_data",'myinlineimage2.jpg' => "your_jpg_files_base64_encoded_chunk_data")
44
+ );
45
+
46
+ var_dump($mailin->send_email($data));
47
+
48
+ ?>
49
+ ```
50
+
51
+ * To explore more, you should visit the [SendinBlue API documentation](https://apidocs.sendinblue.com).
52
+
53
+ ## Available functions
54
+
55
+ List of API calls that you can make, you can click to read more about it. Please do note that the order of parameters are important.
56
+
57
+ ### Campaign calls
58
+
59
+ * [get_account](https://apidocs.sendinblue.com/account/#1)() - Get your account information
60
+ * [get_smtp_details](https://apidocs.sendinblue.com/account/#7)() - Get your SMTP account information
61
+ * [create_child_account](https://apidocs.sendinblue.com/account/#2)($data) - Create a Reseller child account
62
+ * [update_child_account](https://apidocs.sendinblue.com/account/#3)($data) - Update a Reseller child account
63
+ * [delete_child_account](https://apidocs.sendinblue.com/account/#4)($data) - Delete a Reseller child account
64
+ * [get_reseller_child](https://apidocs.sendinblue.com/account/#5)($data) - Get Reseller child accounts
65
+ * [add_remove_child_credits](https://apidocs.sendinblue.com/account/#6)($data) - Add/Remove Reseller child credits
66
+ * [get_campaigns_v2](https://apidocs.sendinblue.com/campaign/#1)($data) - Get list of all campaigns or of specific type or status or both
67
+ * [get_campaign_v2](https://apidocs.sendinblue.com/campaign/#1)($data) - Get specific campaign object
68
+ * [create_campaign](https://apidocs.sendinblue.com/campaign/#2)($data) - Create a campaign
69
+ * [delete_campaign](https://apidocs.sendinblue.com/campaign/#3)($data) - Delete a campaign
70
+ * [update_campaign](https://apidocs.sendinblue.com/campaign/#4)($data) - Update campaign information
71
+ * [campaign_report_email](https://apidocs.sendinblue.com/campaign/#5)($data) - Sending reports to specific emails
72
+ * [campaign_recipients_export](https://apidocs.sendinblue.com/campaign/#6)($data) - Export recipients of a campaign
73
+ * [send_bat_email](https://apidocs.sendinblue.com/campaign/#7)($data) - Send a test Email (bat)
74
+ * [create_trigger_campaign](https://apidocs.sendinblue.com/campaign/#8)($data) - Create a trigger campaign
75
+ * [update_trigger_campaign](https://apidocs.sendinblue.com/campaign/#9)($data) - Update trigger campaign information
76
+ * [share_campaign](https://apidocs.sendinblue.com/campaign/#10)($data) - Get campaign share link
77
+ * [update_campaign_status](https://apidocs.sendinblue.com/campaign/#11)($data) - Modify a campaign status
78
+ * [get_folders](https://apidocs.sendinblue.com/folder/#1)($data) - Get list of all the folder details.
79
+ * [get_folder](https://apidocs.sendinblue.com/folder/#2)($data) - Get all the folder details for folder with id <id>
80
+ * [create_folder](https://apidocs.sendinblue.com/folder/#3)($data) - Create a folder
81
+ * [delete_folder](https://apidocs.sendinblue.com/folder/#4)($data) - Delete folder with folder id <id>
82
+ * [update_folder](https://apidocs.sendinblue.com/folder/#5)($data) - Update folder with folder id <id>
83
+ * [get_lists](https://apidocs.sendinblue.com/list/#1)($data) - Get all the lists
84
+ * [get_list](https://apidocs.sendinblue.com/list/#2)($data) - Get information about a list
85
+ * [create_list](https://apidocs.sendinblue.com/list/#3)($data) - Create a list
86
+ * [delete_list](https://apidocs.sendinblue.com/list/#4)($data) - Delete a list
87
+ * [update_list](https://apidocs.sendinblue.com/list/#5)($data) - Updating a list
88
+ * [display_list_users](https://apidocs.sendinblue.com/list/#8)($data) - Display details of all users for the given lists
89
+ * [add_users_list](https://apidocs.sendinblue.com/list/#6)($data) - Add users to a list
90
+ * [delete_users_list](https://apidocs.sendinblue.com/list/#7)($data) - Delete users from a list
91
+ * [get_attributes](https://apidocs.sendinblue.com/attribute/#1)() - Listing all attributes
92
+ * [get_attribute](https://apidocs.sendinblue.com/attribute/#2)($data) - Listing a certain type attributes
93
+ * [create_attribute](https://apidocs.sendinblue.com/attribute/#3)($data) - Creating attributes
94
+ * [delete_attribute](https://apidocs.sendinblue.com/attribute/#4)($data) - Deleting attributes of the given type
95
+ * [get_user](https://apidocs.sendinblue.com/user/#2)($data) - Get information about a user/email
96
+ * [create_update_user](https://apidocs.sendinblue.com/user/#1)($data) - Create/Update a user information
97
+ * [delete_user](https://apidocs.sendinblue.com/user/#3)($data) - Deleting user from db is not permitted but this action will unlink him from all lists
98
+ * [import_users](https://apidocs.sendinblue.com/user/#4)($data) - Import users/emails
99
+ * [export_users](https://apidocs.sendinblue.com/user/#5)($data) - Export users/emails
100
+ * [get_processes](https://apidocs.sendinblue.com/process/#1)($data) - Get information about all background processes
101
+ * [get_process](https://apidocs.sendinblue.com/process/#2)($data) - Get information about a specific process
102
+ * [get_senders](https://apidocs.sendinblue.com/sender-management/#1)($data) - Get information about all/specific senders
103
+ * [create_sender](https://apidocs.sendinblue.com/sender-management/#2)($data) - Create a sender
104
+ * [delete_sender](https://apidocs.sendinblue.com/sender-management/#3)($data) - Delete a sender
105
+ * [update_sender](https://apidocs.sendinblue.com/sender-management/#4)($data) - Update a sender
106
+
107
+ ### SMTP calls
108
+
109
+ * [get_report](https://apidocs.sendinblue.com/report/)($data) - Retrieve information for all report events
110
+ * [get_statistics](https://apidocs.sendinblue.com/statistics/)($data) - Get aggregate statistics about emails sent
111
+ * [get_webhooks](https://apidocs.sendinblue.com/webhooks/#1)($data) - Get list of all registered webhooks or of specific type
112
+ * [get_webhook](https://apidocs.sendinblue.com/webhooks/#2)($data) - Get information about a webhook
113
+ * [create_webhook](https://apidocs.sendinblue.com/webhooks/#3)($data) - Registering a webhook
114
+ * [delete_webhook](https://apidocs.sendinblue.com/webhooks/#5)($data) - Deleting a webhook
115
+ * [update_webhook](https://apidocs.sendinblue.com/webhooks/#4)($data) - Editing a webhook
116
+ * [delete_bounces](https://apidocs.sendinblue.com/bounces/)($data) - Deleting bounces
117
+ * [send_email](https://apidocs.sendinblue.com/tutorial-sending-transactional-email/)($data) - Sending out a transactional email
118
+ * [send_transactional_template](https://apidocs.sendinblue.com/template/)($data) - Send templates created on SendinBlue, through SendinBlue smtp.
119
+ * [create_template](https://apidocs.sendinblue.com/template/#2)($data) - Create a template
120
+ * [update_template](https://apidocs.sendinblue.com/template/#3)($data) - Update template information
121
+
122
+ ### SMS call
123
+
124
+ * [send_sms](https://apidocs.sendinblue.com/mailin-sms/#1)($data) - Sending a SMS
125
+ * [create_sms_campaign](https://apidocs.sendinblue.com/mailin-sms/#2)($data) - Create a SMS campaign
126
+ * [update_sms_campaign](https://apidocs.sendinblue.com/mailin-sms/#3)($data) - Update a SMS campaign
127
+ * [send_bat_sms](https://apidocs.sendinblue.com/mailin-sms/#4)($data) - Send a test SMS campaign
128
+
129
+ ####Recommendation:
130
+
131
+ If you face any error like "Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:func(144):reason(134)\n", with our library then by adding the below line of code just before curl_exec() ( line no. 46 ) in mailin.php file, you may no longer face this issue.
132
+ ```PHP
133
+ curl_setopt($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");
134
+ ```
135
+ The content of the file is available here: http://curl.haxx.se/ca/cacert.pem
vendor/mailin-api/mailin-api-php/V2.0/examples/README.md ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Examples
2
+
3
+ * tutorial1.php - Sending a transactional email
4
+ * tutorial2.php - Get all campaigns
5
+ * tutorial3.php - Send a transactional SMS
6
+
7
+ ## Available functions
8
+
9
+ List of API calls that you can make, you can click to read more about it. Please do note that the order of parameters are important.
10
+
11
+
12
+ ### Campaign calls
13
+
14
+ * [get_account](https://apidocs.sendinblue.com/account/#1)() - Get your account information
15
+ * [get_smtp_details](https://apidocs.sendinblue.com/account/#7)() - Get your SMTP account information
16
+ * [create_child_account](https://apidocs.sendinblue.com/account/#2)($data) - Create a Reseller child account
17
+ * [update_child_account](https://apidocs.sendinblue.com/account/#3)($data) - Update a Reseller child account
18
+ * [delete_child_account](https://apidocs.sendinblue.com/account/#4)($data) - Delete a Reseller child account
19
+ * [get_reseller_child](https://apidocs.sendinblue.com/account/#5)($data) - Get Reseller child accounts
20
+ * [add_remove_child_credits](https://apidocs.sendinblue.com/account/#6)($data) - Add/Remove Reseller child credits
21
+ * [get_campaigns_v2](https://apidocs.sendinblue.com/campaign/#1)($data) - Get list of all campaigns or of specific type or status or both
22
+ * [get_campaign_v2](https://apidocs.sendinblue.com/campaign/#1)($data) - Get specific campaign object
23
+ * [create_campaign](https://apidocs.sendinblue.com/campaign/#2)($data) - Create a campaign
24
+ * [delete_campaign](https://apidocs.sendinblue.com/campaign/#3)($data) - Delete a campaign
25
+ * [update_campaign](https://apidocs.sendinblue.com/campaign/#4)($data) - Update campaign information
26
+ * [campaign_report_email](https://apidocs.sendinblue.com/campaign/#5)($data) - Sending reports to specific emails
27
+ * [campaign_recipients_export](https://apidocs.sendinblue.com/campaign/#6)($data) - Export recipients of a campaign
28
+ * [send_bat_email](https://apidocs.sendinblue.com/campaign/#7)($data) - Send a test Email (bat)
29
+ * [create_trigger_campaign](https://apidocs.sendinblue.com/campaign/#8)($data) - Create a trigger campaign
30
+ * [update_trigger_campaign](https://apidocs.sendinblue.com/campaign/#9)($data) - Update trigger campaign information
31
+ * [share_campaign](https://apidocs.sendinblue.com/campaign/#10)($data) - Get campaign share link
32
+ * [update_campaign_status](https://apidocs.sendinblue.com/campaign/#11)($data) - Modify a campaign status
33
+ * [get_folders](https://apidocs.sendinblue.com/folder/#1)($data) - Get list of all the folder details.
34
+ * [get_folder](https://apidocs.sendinblue.com/folder/#2)($data) - Get all the folder details for folder with id <id>
35
+ * [create_folder](https://apidocs.sendinblue.com/folder/#3)($data) - Create a folder
36
+ * [delete_folder](https://apidocs.sendinblue.com/folder/#4)($data) - Delete folder with folder id <id>
37
+ * [update_folder](https://apidocs.sendinblue.com/folder/#5)($data) - Update folder with folder id <id>
38
+ * [get_lists](https://apidocs.sendinblue.com/list/#1)($data) - Get all the lists
39
+ * [get_list](https://apidocs.sendinblue.com/list/#2)($data) - Get information about a list
40
+ * [create_list](https://apidocs.sendinblue.com/list/#3)($data) - Create a list
41
+ * [delete_list](https://apidocs.sendinblue.com/list/#4)($data) - Delete a list
42
+ * [update_list](https://apidocs.sendinblue.com/list/#5)($data) - Updating a list
43
+ * [display_list_users](https://apidocs.sendinblue.com/list/#8)($data) - Display details of all users for the given lists
44
+ * [add_users_list](https://apidocs.sendinblue.com/list/#6)($data) - Add users to a list
45
+ * [delete_users_list](https://apidocs.sendinblue.com/list/#7)($data) - Delete users from a list
46
+ * [get_attributes](https://apidocs.sendinblue.com/attribute/#1)() - Listing all attributes
47
+ * [get_attribute](https://apidocs.sendinblue.com/attribute/#2)($data) - Listing a certain type attributes
48
+ * [create_attribute](https://apidocs.sendinblue.com/attribute/#3)($data) - Creating attributes
49
+ * [delete_attribute](https://apidocs.sendinblue.com/attribute/#4)($data) - Deleting attributes of the given type
50
+ * [get_user](https://apidocs.sendinblue.com/user/#2)($data) - Get information about a user/email
51
+ * [create_update_user](https://apidocs.sendinblue.com/user/#1)($data) - Create/Update a user information
52
+ * [delete_user](https://apidocs.sendinblue.com/user/#3)($data) - Deleting user from db is not permitted but this action will unlink him from all lists
53
+ * [import_users](https://apidocs.sendinblue.com/user/#4)($data) - Import users/emails
54
+ * [export_users](https://apidocs.sendinblue.com/user/#5)($data) - Export users/emails
55
+ * [get_processes](https://apidocs.sendinblue.com/process/#1)($data) - Get information about all background processes
56
+ * [get_process](https://apidocs.sendinblue.com/process/#2)($data) - Get information about a specific process
57
+ * [get_senders](https://apidocs.sendinblue.com/sender-management/#1)($data) - Get information about all/specific senders
58
+ * [create_sender](https://apidocs.sendinblue.com/sender-management/#2)($data) - Create a sender
59
+ * [delete_sender](https://apidocs.sendinblue.com/sender-management/#3)($data) - Delete a sender
60
+ * [update_sender](https://apidocs.sendinblue.com/sender-management/#4)($data) - Update a sender
61
+
62
+ ### SMTP calls
63
+
64
+ * [get_report](https://apidocs.sendinblue.com/report/)($data) - Retrieve information for all report events
65
+ * [get_statistics](https://apidocs.sendinblue.com/statistics/)($data) - Get aggregate statistics about emails sent
66
+ * [get_webhooks](https://apidocs.sendinblue.com/webhooks/#1)($data) - Get list of all registered webhooks or of specific type
67
+ * [get_webhook](https://apidocs.sendinblue.com/webhooks/#2)($data) - Get information about a webhook
68
+ * [create_webhook](https://apidocs.sendinblue.com/webhooks/#3)($data) - Registering a webhook
69
+ * [delete_webhook](https://apidocs.sendinblue.com/webhooks/#5)($data) - Deleting a webhook
70
+ * [update_webhook](https://apidocs.sendinblue.com/webhooks/#4)($data) - Editing a webhook
71
+ * [delete_bounces](https://apidocs.sendinblue.com/bounces/)($data) - Deleting bounces
72
+ * [send_email](https://apidocs.sendinblue.com/tutorial-sending-transactional-email/)($data) - Sending out a transactional email
73
+ * [send_transactional_template](https://apidocs.sendinblue.com/template/)($data) - Send templates created on SendinBlue, through SendinBlue smtp.
74
+ * [create_template](https://apidocs.sendinblue.com/template/#2)($data) - Create a template
75
+ * [update_template](https://apidocs.sendinblue.com/template/#3)($data) - Update template information
76
+
77
+ ### SMS call
78
+
79
+ * [send_sms](https://apidocs.sendinblue.com/mailin-sms/#1)($data) - Sending a SMS
80
+ * [create_sms_campaign](https://apidocs.sendinblue.com/mailin-sms/#2)($data) - Create a SMS campaign
81
+ * [update_sms_campaign](https://apidocs.sendinblue.com/mailin-sms/#3)($data) - Update a SMS campaign
82
+ * [send_bat_sms](https://apidocs.sendinblue.com/mailin-sms/#4)($data) - Send a test SMS campaign
83
+
84
+ ####Recommendation:
85
+
86
+ If you face any error like "Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:func(144):reason(134)\n", with our library then by adding the below line of code just before curl_exec() ( line no. 37 ) in mailin.php file, you may no longer face this issue.
87
+ ```PHP
88
+ curl_setopt($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");
89
+ ```
90
+ The content of the file is available here: http://curl.haxx.se/ca/cacert.pem
vendor/mailin-api/mailin-api-php/V2.0/examples/tutorial1.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require('Mailin.php');
4
+ /*
5
+ * This will initiate the API with the endpoint and your access key.
6
+ *
7
+ */
8
+ $mailin = new Mailin('https://api.sendinblue.com/v2.0','Your access key');
9
+
10
+ /*
11
+ * This will send a transactional email
12
+ *
13
+ */
14
+ /** Prepare variables for easy use **/
15
+
16
+ $data = array( "to" => array("to@example.net"=>"to whom!"),
17
+ "cc" => array("cc@example.net"=>"cc whom!"),
18
+ "bcc" =>array("bcc@example.net"=>"bcc whom!"),
19
+ "from" => array("from@email.com","from email!"),
20
+ "replyto" => array("replyto@email.com","reply to!"),
21
+ "subject" => "My subject",
22
+ "text" => "This is the text",
23
+ "html" => "This is the <h1>HTML</h1><br/>
24
+ This is inline image 1.<br/>
25
+ <img src=\"{myinlineimage1.png}\" alt=\"image1\" border=\"0\"><br/>
26
+ Some text<br/>
27
+ This is inline image 2.<br/>
28
+ <img src=\"{myinlineimage2.jpg}\" alt=\"image2\" border=\"0\"><br/>
29
+ Some more text<br/>
30
+ Re-used inline image 1.<br/>
31
+ <img src=\"{myinlineimage1.png}\" alt=\"image3\" border=\"0\">",
32
+ "attachment" => array(),
33
+ "headers" => array("Content-Type"=> "text/html; charset=iso-8859-1","X-param1"=> "value1", "X-param2"=> "value2","X-Mailin-custom"=>"my custom value", "X-Mailin-IP"=> "102.102.1.2", "X-Mailin-Tag" => "My tag"),
34
+ "inline_image" => array('myinlineimage1.png' => "your_png_files_base64_encoded_chunk_data",'myinlineimage2.jpg' => "your_jpg_files_base64_encoded_chunk_data")
35
+ );
36
+
37
+ var_dump($mailin->send_email($data));
38
+
39
+ ?>
vendor/mailin-api/mailin-api-php/V2.0/examples/tutorial2.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require('Mailin.php');
4
+ /*
5
+ * This will initiate the API with the endpoint and your access key.
6
+ *
7
+ */
8
+ $mailin = new Mailin('https://api.sendinblue.com/v2.0','Your access key');
9
+
10
+ /*
11
+ * This will get all your campaigns
12
+ *
13
+ */
14
+ /** Prepare variables for easy use **/
15
+
16
+ $data = array( "type"=>"classic",
17
+ "status"=>"queued",
18
+ "page"=>1,
19
+ "page_limit"=>10
20
+ );
21
+
22
+ var_dump($mailin->get_campaigns_v2($data));
23
+
24
+ ?>
vendor/mailin-api/mailin-api-php/V2.0/examples/tutorial3.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ require('Mailin.php');
4
+ /*
5
+ * This will initiate the API with the endpoint and your access key.
6
+ *
7
+ */
8
+ $mailin = new Mailin('https://api.sendinblue.com/v2.0','Your access key');
9
+
10
+ /*
11
+ * This will send a transactional SMS
12
+ *
13
+ */
14
+ /** Prepare variables for easy use **/
15
+
16
+ $data = array( "to" => "+331234567890",
17
+ "from" => "From",
18
+ "text" => "Good morning - test",
19
+ "web_url" => "http://example.com",
20
+ "tag" => "Tag1",
21
+ "type" => ""
22
+ );
23
+
24
+ var_dump($mailin->send_sms($data));
25
+
26
+ ?>
vendor/mailin-api/mailin-api-php/composer.json ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "name": "mailin-api/mailin-api-php",
3
+ "description": "Official SendinBlue provided API V2 wrapper",
4
+ "license": "MIT",
5
+ "require": {
6
+ "php": ">=5.3",
7
+ "ext-curl": "*"
8
+ },
9
+ "autoload": {
10
+ "psr-0": { "Sendinblue": "src/" }
11
+ },
12
+ "extra": {
13
+ "branch-alias": {
14
+ "dev-master": "1.0.x-dev"
15
+ }
16
+ },
17
+ "homepage": "https://github.com/mailin-api/mailin-api-php",
18
+ "authors": [
19
+ {
20
+ "name": "SendinBlue",
21
+ "homepage": "https://www.sendinblue.com/"
22
+
23
+ }
24
+ ]
25
+
26
+ }
vendor/mailin-api/mailin-api-php/src/Sendinblue/Mailin.php ADDED
@@ -0,0 +1,946 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ namespace Sendinblue;
4
+
5
+ /**
6
+ * SendinBlue REST client
7
+ */
8
+ class Mailin
9
+ {
10
+ public $api_key;
11
+ public $base_url;
12
+ public $timeout;
13
+ public $curl_opts = array();
14
+ public function __construct($base_url, $api_key, $timeout='')
15
+ {
16
+ if (!function_exists('curl_init')) {
17
+ throw new \Exception('Mailin requires CURL module');
18
+ }
19
+ $this->base_url = $base_url;
20
+ $this->api_key = $api_key;
21
+ $this->timeout = $timeout;
22
+ }
23
+ /**
24
+ * Do CURL request with authorization
25
+ */
26
+ private function do_request($resource, $method, $input)
27
+ {
28
+ $called_url = $this->base_url."/".$resource;
29
+ $ch = curl_init($called_url);
30
+ $auth_header = 'api-key:'.$this->api_key;
31
+ $content_header = "Content-Type:application/json";
32
+ $timeout = ($this->timeout!='')?($this->timeout):30000; //default timeout: 30 secs
33
+ if ($timeout!='' && ($timeout <= 0 || $timeout > 60000)) {
34
+ throw new \Exception('value not allowed for timeout');
35
+ }
36
+ if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
37
+ // Windows only over-ride
38
+ curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
39
+ }
40
+ curl_setopt($ch, CURLOPT_HTTPHEADER, array($auth_header,$content_header));
41
+ curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
42
+ curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
43
+ curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
44
+ curl_setopt($ch, CURLOPT_TIMEOUT_MS, $timeout);
45
+ curl_setopt($ch, CURLOPT_HEADER, 0);
46
+ curl_setopt($ch, CURLOPT_POSTFIELDS, $input);
47
+ $data = curl_exec($ch);
48
+ if (curl_errno($ch)) {
49
+ throw new \RuntimeException('cURL error: ' . curl_error($ch));
50
+ }
51
+ if (!is_string($data) || !strlen($data)) {
52
+ throw new \RuntimeException('Request Failed');
53
+ }
54
+ curl_close($ch);
55
+ return json_decode($data, true);
56
+ }
57
+ public function get($resource, $input)
58
+ {
59
+ return $this->do_request($resource, "GET", $input);
60
+ }
61
+ public function put($resource, $input)
62
+ {
63
+ return $this->do_request($resource, "PUT", $input);
64
+ }
65
+ public function post($resource, $input)
66
+ {
67
+ return $this->do_request($resource, "POST", $input);
68
+ }
69
+ public function delete($resource, $input)
70
+ {
71
+ return $this->do_request($resource, "DELETE", $input);
72
+ }
73
+
74
+ /*
75
+ Get Account.
76
+ No input required
77
+ */
78
+ public function get_account()
79
+ {
80
+ return $this->get("account", "");
81
+ }
82
+
83
+ /*
84
+ Get SMTP details.
85
+ No input required
86
+ */
87
+ public function get_smtp_details()
88
+ {
89
+ return $this->get("account/smtpdetail", "");
90
+ }
91
+
92
+ /*
93
+ Create Child Account.
94
+ @param {Array} data contains php array with key value pair.
95
+ @options data {String} child_email: Email address of Reseller child [Mandatory]
96
+ @options data {String} password: Password of Reseller child to login [Mandatory]
97
+ @options data {String} company_org: Name of Reseller child’s company [Mandatory]
98
+ @options data {String} first_name: First name of Reseller child [Mandatory]
99
+ @options data {String} last_name: Last name of Reseller child [Mandatory]
100
+ @options data {Array} credits: Number of email & sms credits respectively, which will be assigned to the Reseller child’s account [Optional]
101
+ - email_credit {Integer} number of email credits
102
+ - sms_credit {Integer} Number of sms credts
103
+ @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional]
104
+ */
105
+ public function create_child_account($data)
106
+ {
107
+ return $this->post("account", json_encode($data));
108
+ }
109
+
110
+ /*
111
+ Update Child Account.
112
+ @param {Array} data contains php array with key value pair.
113
+ @options data {String} auth_key: 16 character authorization key of Reseller child to be modified [Mandatory]
114
+ @options data {String} company_org: Name of Reseller child’s company [Optional]
115
+ @options data {String} first_name: First name of Reseller child [Optional]
116
+ @options data {String} last_name: Last name of Reseller child [Optional]
117
+ @options data {String} password: Password of Reseller child to login [Optional]
118
+ @options data {Array} associate_ip: Associate dedicated IPs to reseller child. You can use commas to separate multiple IPs [Optional]
119
+ @options data {Array} disassociate_ip: Disassociate dedicated IPs from reseller child. You can use commas to separate multiple IPs [Optional]
120
+ */
121
+ public function update_child_account($data)
122
+ {
123
+ return $this->put("account", json_encode($data));
124
+ }
125
+
126
+ /*
127
+ Delete Child Account.
128
+ @param {Array} data contains php array with key value pair.
129
+ @options data {String} auth_key: 16 character authorization key of Reseller child to be deleted [Mandatory]
130
+ */
131
+ public function delete_child_account($data)
132
+ {
133
+ return $this->delete("account/".$data['auth_key'], "");
134
+ }
135
+
136
+ /*
137
+ Get Reseller child Account.
138
+ @param {Array} data contains php array with key value pair.
139
+ @options data {String} auth_key: 16 character authorization key of Reseller child. Example : To get the details of more than one child account, use, {"key1":"abC01De2fGHI3jkL","key2":"mnO45Pq6rSTU7vWX"} [Mandatory]
140
+ */
141
+ public function get_reseller_child($data)
142
+ {
143
+ return $this->post("account/getchildv2", json_encode($data));
144
+ }
145
+
146
+ /*
147
+ Add/Remove Reseller child's Email/Sms credits.
148
+ @param {Array} data contains php array with key value pair.
149
+ @options data {String} auth_key: 16 character authorization key of Reseller child to modify credits [Mandatory]
150
+ @options data {Array} add_credit: Number of email & sms credits to be added. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if rmv_credit is empty]
151
+ - email_credit {Integer} number of email credits
152
+ - sms_credit {Integer} Number of sms credts
153
+ @options data {Array} rmv_credit: Number of email & sms credits to be removed. You can assign either email or sms credits, one at a time other will remain 0. [Mandatory: if add_credits is empty]
154
+ - email_credit {Integer} number of email credits
155
+ - sms_credit {Integer} Number of sms credts
156
+ */
157
+ public function add_remove_child_credits($data)
158
+ {
159
+ return $this->post("account/addrmvcredit", json_encode($data));
160
+ }
161
+
162
+ /*
163
+ Get a particular campaign detail.
164
+ @param {Array} data contains php array with key value pair.
165
+ @options data {Integer} id: Unique Id of the campaign [Mandatory]
166
+ */
167
+ public function get_campaign_v2($data)
168
+ {
169
+ return $this->get("campaign/".$data['id']."/detailsv2", "");
170
+ }
171
+
172
+ /*
173
+ Get all campaigns detail.
174
+ @param {Array} data contains php array with key value pair.
175
+ @options data {String} type: Type of campaign. Possible values – classic, trigger, sms, template ( case sensitive ) [Optional]
176
+ @options data {String} status: Status of campaign. Possible values – draft, sent, archive, queued, suspended, in_process, temp_active, temp_inactive ( case sensitive ) [Optional]
177
+ @options data {Integer} page: Maximum number of records per request is 500, if there are more than 500 campaigns then you can use this parameter to get next 500 results [Optional]
178
+ @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional]
179
+ */
180
+ public function get_campaigns_v2($data)
181
+ {
182
+ return $this->get("campaign/detailsv2", json_encode($data));
183
+ }
184
+
185
+ /*
186
+ Create and Schedule your campaigns. It returns the ID of the created campaign.
187
+ @param {Array} data contains php array with key value pair.
188
+ @options data {String} category: Tag name of the campaign [Optional]
189
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
190
+ @options data {String} name: Name of the campaign [Mandatory]
191
+ @options data {String} bat: Email address for test mail [Optional]
192
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
193
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
194
+ @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
195
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
196
+ @options data {String} subject: Subject of the campaign [Mandatory]
197
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
198
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
199
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM] To use the contact attributes here, these should already exist in SendinBlue account [Optional]
200
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
201
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
202
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
203
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
204
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
205
+
206
+ */
207
+ public function create_campaign($data)
208
+ {
209
+ return $this->post("campaign", json_encode($data));
210
+ }
211
+
212
+ /*
213
+ Update your campaign.
214
+ @param {Array} data contains php array with key value pair.
215
+ @options data {Integer} id: Id of campaign to be modified [Mandatory]
216
+ @options data {String} category: Tag name of the campaign [Optional]
217
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
218
+ @options data {String} name: Name of the campaign [Optional]
219
+ @options data {String} bat: Email address for test mail [Optional]
220
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Optional]
221
+ @options data {String} html_url: Url which content is the body of content [Optional]
222
+ @options data {Array} listid These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
223
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
224
+ @options data {String} subject: Subject of the campaign.
225
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
226
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
227
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
228
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
229
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
230
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
231
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
232
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
233
+ */
234
+ public function update_campaign($data)
235
+ {
236
+ $id = $data['id'];
237
+ unset($data['id']);
238
+ return $this->put("campaign/".$id, json_encode($data));
239
+ }
240
+
241
+ /*
242
+ Delete your campaigns.
243
+ @param {Array} data contains php array with key value pair.
244
+ @options data {Integer} id: Id of campaign to be deleted [Mandatory]
245
+ */
246
+ public function delete_campaign($data)
247
+ {
248
+ return $this->delete("campaign/".$data['id'], "");
249
+ }
250
+
251
+ /*
252
+ Send report of Sent and Archived campaign.
253
+ @param {Array} data contains php array with key value pair.
254
+ @options data {Integer} id: Id of campaign to send its report [Mandatory]
255
+ @options data {String} lang: Language of email content. Possible values – fr (default), en, es, it & pt [Optional]
256
+ @options data {String} email_subject: Message subject [Mandatory]
257
+ @options data {Array} email_to: Email address of the recipient(s). Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory]
258
+ @options data {String} email_content_type: Body of the message in text/HTML version. Possible values – text & html [Mandatory]
259
+ @options data {Array} email_bcc: Same as email_to but for Bcc [Optional]
260
+ @options data {Array} email_cc: Same as email_to but for Cc [Optional]
261
+ @options data {String} email_body: Body of the message [Mandatory]
262
+ */
263
+ public function campaign_report_email($data)
264
+ {
265
+ $id = $data['id'];
266
+ unset($data['id']);
267
+ return $this->post("campaign/".$id."/report", json_encode($data));
268
+ }
269
+
270
+ /*
271
+ Export the recipients of a specified campaign.
272
+ @param {Array} data contains php array with key value pair.
273
+ @options data {Integer} id: Id of campaign to export its recipients [Mandatory]
274
+ @options data {String} notify_url: URL that will be called once the export process is finished [Mandatory]
275
+ @options data {String} type: Type of recipients. Possible values – all, non_clicker, non_opener, clicker, opener, soft_bounces, hard_bounces & unsubscribes [Mandatory]
276
+ */
277
+ public function campaign_recipients_export($data)
278
+ {
279
+ $id = $data['id'];
280
+ unset($data['id']);
281
+ return $this->post("campaign/".$id."/recipients", json_encode($data));
282
+ }
283
+
284
+ /*
285
+ Get the Campaign name, subject and share link of the classic type campaigns only which are sent, for those which are not sent and the rest of campaign types like trigger, template & sms, will return an error message of share link not available.
286
+ @param {Array} data contains php array with key value pair.
287
+ @options data {Array} camp_ids: Id of campaign to get share link. You can use commas to separate multiple ids [Mandatory]
288
+ */
289
+
290
+ public function share_campaign($data)
291
+ {
292
+ return $this->post("campaign/sharelinkv2", json_encode($data));
293
+ }
294
+
295
+ /*
296
+ Send a Test Campaign.
297
+ @param {Array} data contains php array with key value pair.
298
+ @options data {Integer} id: Id of the campaign [Mandatory]
299
+ @options data {Array} emails: Email address of recipient(s) existing in the one of the lists & should not be blacklisted. Example: "test@example.net". You can use commas to separate multiple recipients [Mandatory]
300
+ */
301
+ public function send_bat_email($data)
302
+ {
303
+ $id = $data['id'];
304
+ unset($data['id']);
305
+ return $this->post("campaign/".$id."/test", json_encode($data));
306
+ }
307
+
308
+ /*
309
+ Update the Campaign status.
310
+ @param {Array} data contains php array with key value pair.
311
+ @options data {Integer} id: Id of campaign to update its status [Mandatory]
312
+ @options data {String} status: Types of status. Possible values – suspended, archive, darchive, sent, queued, replicate and replicate_template ( case sensitive ) [Mandatory]
313
+ */
314
+ public function update_campaign_status($data)
315
+ {
316
+ $id = $data['id'];
317
+ unset($data['id']);
318
+ return $this->put("campaign/".$id."/updatecampstatus", json_encode($data));
319
+ }
320
+
321
+ /*
322
+ Create and schedule your Trigger campaigns.
323
+ @param {Array} data contains php array with key value pair.
324
+ @options data {String} category: Tag name of the campaign [Optional]
325
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
326
+ @options data {String} trigger_name: Name of the campaign [Mandatory]
327
+ @options data {String} bat: Email address for test mail [Optional]
328
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
329
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
330
+ @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
331
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
332
+ @options data {String} subject: Subject of the campaign [Mandatory]
333
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
334
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
335
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
336
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
337
+ @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional]
338
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
339
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
340
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
341
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
342
+ */
343
+ public function create_trigger_campaign($data)
344
+ {
345
+ return $this->post("campaign", json_encode($data));
346
+ }
347
+
348
+ /*
349
+ Update and schedule your Trigger campaigns.
350
+ @param {Array} data contains php array with key value pair.
351
+ @options data {Integer} id: Id of Trigger campaign to be modified [Mandatory]
352
+ @options data {String} category: Tag name of the campaign [Optional]
353
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
354
+ @options data {String} trigger_name: Name of the campaign [Mandatory]
355
+ @options data {String} bat Email address for test mail [Optional]
356
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
357
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
358
+ @options data {Array} listid: These are the lists to which the campaign has been sent [Mandatory: if scheduled_date is not empty]
359
+ @options data {String} scheduled_date: The day on which the campaign is supposed to run[Optional]
360
+ @options data {String} subject: Subject of the campaign [Mandatory]
361
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients, please make sure that the sender details are defined here, and in case of no sender, you can add them also via API & for Shared IP clients, if sender exists]
362
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
363
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
364
+ @options data {Array} exclude_list: These are the lists which must be excluded from the campaign [Optional]
365
+ @options data {Integer} recurring: Type of trigger campaign. Possible values = 0 (default) & 1. recurring = 0 means contact can receive the same Trigger campaign only once, & recurring = 1 means contact can receive the same Trigger campaign several times [Optional]
366
+ @options data {String} attachment_url: Provide the absolute url of the attachment [Optional]
367
+ @options data {Integer} inline_image: Status of inline image. Possible values = 0 (default) & 1. inline_image = 0 means image can’t be embedded, & inline_image = 1 means image can be embedded, in the email [Optional]
368
+ @options data {Integer} mirror_active: Status of mirror links in campaign. Possible values = 0 & 1 (default). mirror_active = 0 means mirror links are deactivated, & mirror_active = 1 means mirror links are activated, in the campaign [Optional]
369
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
370
+ */
371
+ public function update_trigger_campaign($data)
372
+ {
373
+ $id = $data['id'];
374
+ unset($data['id']);
375
+ return $this->put("campaign/".$id, json_encode($data));
376
+ }
377
+
378
+ /*
379
+ Get all folders detail.
380
+ @param {Array} data contains php array with key value pair.
381
+ @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 folders then you can use this parameter to get next 50 results [Mandatory]
382
+ @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
383
+ */
384
+ public function get_folders($data)
385
+ {
386
+ return $this->get("folder", json_encode($data));
387
+ }
388
+
389
+ /*
390
+ Get a particular folder detail.
391
+ @param {Array} data contains php array with key value pair.
392
+ @options data {Integer} id: Id of folder to get details [Mandatory]
393
+ */
394
+ public function get_folder($data)
395
+ {
396
+ return $this->get("folder/".$data['id'], "");
397
+ }
398
+
399
+ /*
400
+ Create a new folder.
401
+ @param {Array} data contains php array with key value pair.
402
+ @options data {String} name: Desired name of the folder to be created [Mandatory]
403
+ */
404
+ public function create_folder($data)
405
+ {
406
+ return $this->post("folder", json_encode($data));
407
+ }
408
+
409
+ /*
410
+ Delete a specific folder information.
411
+ @param {Array} data contains php array with key value pair.
412
+ @options data {Integer} id: Id of folder to be deleted [Mandatory]
413
+ */
414
+ public function delete_folder($data)
415
+ {
416
+ return $this->delete("folder/".$data['id'], "");
417
+ }
418
+
419
+ /*
420
+ Update an existing folder.
421
+ @param {Array} data contains php array with key value pair.
422
+ @options data {Integer} id: Id of folder to be modified [Mandatory]
423
+ @options data {String} name: Desired name of the folder to be modified [Mandatory]
424
+ */
425
+ public function update_folder($data)
426
+ {
427
+ $id = $data['id'];
428
+ unset($data['id']);
429
+ return $this->put("folder/".$id, json_encode($data));
430
+ }
431
+
432
+ /*
433
+ Get all lists detail.
434
+ @param {Array} data contains php array with key value pair.
435
+ @options data {Integer} list_parent: This is the existing folder id & can be used to get all lists belonging to it [Optional]
436
+ @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory]
437
+ @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
438
+ */
439
+ public function get_lists($data)
440
+ {
441
+ return $this->get("list", json_encode($data));
442
+ }
443
+
444
+ /*
445
+ Get a particular list detail.
446
+ @param {Array} data contains php array with key value pair.
447
+ @options data {Integer} id: Id of list to get details [Mandatory]
448
+ */
449
+ public function get_list($data)
450
+ {
451
+ return $this->get("list/".$data['id'], "");
452
+ }
453
+
454
+ /*
455
+ Create a new list.
456
+ @param {Array} data contains php array with key value pair.
457
+ @options data {String} list_name: Desired name of the list to be created [Mandatory]
458
+ @options data {Integer} list_parent: Folder ID [Mandatory]
459
+ */
460
+ public function create_list($data)
461
+ {
462
+ return $this->post("list", json_encode($data));
463
+ }
464
+
465
+ /*
466
+ Update a list.
467
+ @param {Array} data contains php array with key value pair.
468
+ @options data {Integer} id: Id of list to be modified [Mandatory]
469
+ @options data {String} list_name: Desired name of the list to be modified [Optional]
470
+ @options data {Integer} list_parent: Folder ID [Mandatory]
471
+ */
472
+ public function update_list($data)
473
+ {
474
+ $id = $data['id'];
475
+ unset($data['id']);
476
+ return $this->put("list/".$id, json_encode($data));
477
+ }
478
+
479
+ /*
480
+ Delete a specific list.
481
+ @param {Array} data contains php array with key value pair.
482
+ @options data {Integer} id: Id of list to be deleted [Mandatory]
483
+ */
484
+ public function delete_list($data)
485
+ {
486
+ return $this->delete("list/".$data['id'], "");
487
+ }
488
+
489
+ /*
490
+ Display details of all users for the given lists.
491
+ @param {Array} data contains php array with key value pair.
492
+ @options data {Array} listids: These are the list ids to get their data. The ids found will display records [Mandatory]
493
+ @options data {String} timestamp: This is date-time filter to fetch modified user records >= this time. Valid format Y-m-d H:i:s. Example: "2015-05-22 14:30:00" [Optional]
494
+ @options data {Integer} page: Maximum number of records per request is 500, if in your list there are more than 500 users then you can use this parameter to get next 500 results [Optional]
495
+ @options data {Integer} page_limit: This should be a valid number between 1-500 [Optional]
496
+ */
497
+ public function display_list_users($data)
498
+ {
499
+ return $this->post("list/display", json_encode($data));
500
+ }
501
+
502
+ /*
503
+ Add already existing users in the SendinBlue contacts to the list.
504
+ @param {Array} data contains php array with key value pair.
505
+ @options data {Integer} id: Id of list to link users in it [Mandatory]
506
+ @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts. Example: "test@example.net". You can use commas to separate multiple users [Mandatory]
507
+ */
508
+
509
+ public function add_users_list($data)
510
+ {
511
+ $id = $data['id'];
512
+ unset($data['id']);
513
+ return $this->post("list/".$id."/users", json_encode($data));
514
+ }
515
+
516
+ /*
517
+ Delete already existing users in the SendinBlue contacts from the list.
518
+ @param {Array} data contains php array with key value pair.
519
+ @options data {Integer} id: Id of list to unlink users from it [Mandatory]
520
+ @options data {Array} users: Email address of the already existing user(s) in the SendinBlue contacts to be modified. Example: "test@example.net". You can use commas to separate multiple users [Mandatory]
521
+ */
522
+ public function delete_users_list($data)
523
+ {
524
+ $id = $data['id'];
525
+ unset($data['id']);
526
+ return $this->delete("list/".$id."/delusers", json_encode($data));
527
+ }
528
+
529
+ /*
530
+ Access all the attributes information under the account.
531
+ No input required
532
+ */
533
+ public function get_attributes()
534
+ {
535
+ return $this->get("attribute", "");
536
+ }
537
+
538
+ /*
539
+ Access the specific type of attribute information.
540
+ @param {Array} data contains php array with key value pair.
541
+ @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global [Optional]
542
+ */
543
+ public function get_attribute($data)
544
+ {
545
+ return $this->get("attribute/".$data['type'], "");
546
+ }
547
+
548
+ /*
549
+ Create an Attribute.
550
+ @param {Array} data contains php array with key value pair.
551
+ @options data {String} type: Type of attribute. Possible values – normal, transactional, category, calculated & global ( case sensitive ) [Mandatory]
552
+ @options data {Array} data: The name and data type of ‘normal’ & ‘transactional’ attribute to be created in your SendinBlue account. It should be sent as an associative array. Example: array(‘ATTRIBUTE_NAME1′ => ‘DATA_TYPE1′, ‘ATTRIBUTE_NAME2’=> ‘DATA_TYPE2′).
553
+ The name and data value of ‘category’, ‘calculated’ & ‘global’, should be sent as JSON string. Example: ‘[{ "name":"ATTRIBUTE_NAME1", "value":"Attribute_value1" }, { "name":"ATTRIBUTE_NAME2", "value":"Attribute_value2" }]’. You can use commas to separate multiple attributes [Mandatory]
554
+ */
555
+ public function create_attribute($data)
556
+ {
557
+ return $this->post("attribute/", json_encode($data));
558
+ }
559
+
560
+ /*
561
+ Delete a specific type of attribute information.
562
+ @param {Array} data contains php array with key value pair.
563
+ @options data {Integer} type: Type of attribute to be deleted [Mandatory]
564
+ */
565
+ public function delete_attribute($data)
566
+ {
567
+ $type = $data['type'];
568
+ unset($data['type']);
569
+ return $this->post("attribute/".$type, json_encode($data));
570
+ }
571
+
572
+ /*
573
+ Create a new user if an email provided as input, doesn’t exists in the contact list of your SendinBlue account, otherwise it will update the existing user.
574
+ @param {Array} data contains php array with key value pair.
575
+ @options data {String} email: Email address of the user to be created in SendinBlue contacts. Already existing email address of user in the SendinBlue contacts to be modified [Mandatory]
576
+ @options data {Array} attributes: The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional]
577
+ @options data {Integer} blacklisted: This is used to blacklist/ Unblacklist a user. Possible values – 0 & 1. blacklisted = 1 means user has been blacklisted [Optional]
578
+ @options data {Array} listid: The list id(s) to be linked from user [Optional]
579
+ @options data {Array} listid_unlink: The list id(s) to be unlinked from user [Optional]
580
+ @options data {Array} blacklisted_sms: This is used to blacklist/ Unblacklist a user’s SMS number. Possible values – 0 & 1. blacklisted_sms = 1 means user’s SMS number has been blacklisted [Optional]
581
+ */
582
+ public function create_update_user($data)
583
+ {
584
+ return $this->post("user/createdituser", json_encode($data));
585
+ }
586
+
587
+ /*
588
+ Get Access a specific user Information.
589
+ @param {Array} data contains php array with key value pair.
590
+ @options data {String} email: Email address of the already existing user in the SendinBlue contacts [Mandatory]
591
+ */
592
+ public function get_user($data)
593
+ {
594
+ return $this->get("user/".$data['email'], "");
595
+ }
596
+
597
+ /*
598
+ Unlink existing user from all lists.
599
+ @param {Array} data contains php array with key value pair.
600
+ @options data {String} email: Email address of the already existing user in the SendinBlue contacts to be unlinked from all lists [Mandatory]
601
+ */
602
+ public function delete_user($data)
603
+ {
604
+ return $this->delete("user/".$data['email'], "");
605
+ }
606
+
607
+ /*
608
+ Import Users Information.
609
+ @param {Array} data contains php array with key value pair.
610
+ @options data {String} url: The URL of the file to be imported. Possible file types – .txt, .csv [Mandatory: if body is empty]
611
+ @options data {String} body: The Body with csv content to be imported. Example: ‘NAME;SURNAME;EMAIL\n"Name1";"Surname1";"example1@example.net"\n"Name2";"Surname2";"example2@example.net"‘, where \n separates each user data. You can use semicolon to separate multiple attributes [Mandatory: if url is empty]
612
+ @options data {Array} listids: These are the list ids in which the the users will be imported [Mandatory: if name is empty]
613
+ @options data {String} notify_url: URL that will be called once the import process is finished [Optional] In notify_url, we are sending the content using POST method
614
+ @options data {String} name: This is new list name which will be created first & then users will be imported in it [Mandatory: if listids is empty]
615
+ @options data {Integer} list_parent: This is the existing folder id & can be used with name parameter to make newly created list’s desired parent [Optional]
616
+ */
617
+ public function import_users($data)
618
+ {
619
+ return $this->post("user/import", json_encode($data));
620
+ }
621
+
622
+ /*
623
+ Export Users Information.
624
+ @param {Array} data contains php array with key value pair.
625
+ @options data {String} export_attrib: The name of attribute present in your SendinBlue account. You can use commas to separate multiple attributes. Example: "EMAIL,NAME,SMS" [Optional]
626
+ @options data {String} filter: Filter can be added to export users. Example: "{\"blacklisted\":1}", will export all blacklisted users [Mandatory]
627
+ @options data {String} notify_url: URL that will be called once the export process is finished [Optional]
628
+ */
629
+ public function export_users($data)
630
+ {
631
+ return $this->post("user/export", json_encode($data));
632
+ }
633
+
634
+ /*
635
+ Get all the processes information under the account.
636
+ @param {Array} data contains php array with key value pair.
637
+ @options data {Integer} page: Maximum number of records per request is 50, if there are more than 50 processes then you can use this parameter to get next 50 results [Mandatory]
638
+ @options data {Integer} page_limit: This should be a valid number between 1-50 [Mandatory]
639
+ */
640
+ public function get_processes($data)
641
+ {
642
+ return $this->get("process", json_encode($data));
643
+ }
644
+
645
+ /*
646
+ Get the process information.
647
+ @param {Array} data contains php array with key value pair.
648
+ @options data {Integer} id: Id of process to get details [Mandatory]
649
+ */
650
+ public function get_process($data)
651
+ {
652
+ return $this->get("process/".$data['id'], "");
653
+ }
654
+
655
+ /*
656
+ To retrieve details of all webhooks.
657
+ @param {Array} data contains php array with key value pair.
658
+ @options data {String} is_plat: Flag to get webhooks. Possible values – 0 & 1. Example: to get Transactional webhooks, use $is_plat=0, to get Marketing webhooks, use $is_plat=1, & to get all webhooks, use $is_plat="" [Optional]
659
+ */
660
+ public function get_webhooks($data)
661
+ {
662
+ return $this->get("webhook", json_encode($data));
663
+ }
664
+
665
+ /*
666
+ To retrieve details of any particular webhook.
667
+ @param {Array} data contains php array with key value pair.
668
+ @options data {Integer} id: Id of webhook to get details [Mandatory]
669
+ */
670
+ public function get_webhook($data)
671
+ {
672
+ return $this->get("webhook/".$data['id'], "");
673
+ }
674
+
675
+ /*
676
+ Create a Webhook.
677
+ @param {Array} data contains php array with key value pair.
678
+ @options data {String} url: URL that will be triggered by a webhook [Mandatory]
679
+ @options data {String} description: Webook description [Optional]
680
+ @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory]
681
+ @options data {Integer} is_plat: Flag to create webhook type. Possible values – 0 (default) & 1. Example: to create Transactional webhooks, use $is_plat=0, & to create Marketing webhooks, use $is_plat=1 [Optional]
682
+ */
683
+ public function create_webhook($data)
684
+ {
685
+ return $this->post("webhook", json_encode($data));
686
+ }
687
+
688
+ /*
689
+ Delete a webhook.
690
+ @param {Array} data contains php array with key value pair.
691
+ @options data {Integer} id: Id of webhook to be deleted [Mandatory]
692
+ */
693
+ public function delete_webhook($data)
694
+ {
695
+ return $this->delete("webhook/".$data['id'], "");
696
+ }
697
+
698
+ /*
699
+ Update a webhook.
700
+ @param {Array} data contains php array with key value pair.
701
+ @options data {Integer} id: Id of webhook to be modified [Mandatory]
702
+ @options data {String} url: URL that will be triggered by a webhook [Mandatory]
703
+ @options data {String} description: Webook description [Optional]
704
+ @options data {Array} events: Set of events. You can use commas to separate multiple events. Possible values for Transcational webhook – request, delivered, hard_bounce, soft_bounce, blocked, spam, invalid_email, deferred, click, & opened and Possible Values for Marketing webhook – spam, opened, click, hard_bounce, unsubscribe, soft_bounce & list_addition ( case sensitive ) [Mandatory]
705
+ */
706
+ public function update_webhook($data)
707
+ {
708
+ $id = $data['id'];
709
+ unset($data['id']);
710
+ return $this->put("webhook/".$id, json_encode($data));
711
+ }
712
+
713
+ /*
714
+ Get Access of created senders information.
715
+ @param {Array} data contains php array with key value pair.
716
+ @options data {String} option: Options to get senders. Possible options – IP-wise, & Domain-wise ( only for dedicated IP clients ). Example: to get senders with specific IP, use $option=’1.2.3.4′, to get senders with specific domain use, $option=’domain.com’, & to get all senders, use $option="" [Optional]
717
+ */
718
+ public function get_senders($data)
719
+ {
720
+ return $this->get("advanced", json_encode($data));
721
+ }
722
+
723
+ /*
724
+ Create your Senders.
725
+ @param {Array} data contains php array with key value pair.
726
+ @options data {String} name: Name of the sender [Mandatory]
727
+ @options data {String} email: Email address of the sender [Mandatory]
728
+ @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank]
729
+ */
730
+ public function create_sender($data)
731
+ {
732
+ return $this->post("advanced", json_encode($data));
733
+ }
734
+
735
+ /*
736
+ Update your Senders.
737
+ @param {Array} data contains php array with key value pair.
738
+ @options data {Integer} id: Id of sender to be modified [Mandatory]
739
+ @options data {String} name: Name of the sender [Mandatory]
740
+ @options data {Array} ip_domain: Pass pipe ( | ) separated Dedicated IP and its associated Domain. Example: "1.2.3.4|mydomain.com". You can use commas to separate multiple ip_domain’s [Mandatory: Only for Dedicated IP clients, for Shared IP clients, it should be kept blank]
741
+ */
742
+ public function update_sender($data)
743
+ {
744
+ $id = $data['id'];
745
+ unset($data['id']);
746
+ return $this->put("advanced/".$id, json_encode($data));
747
+ }
748
+
749
+ /*
750
+ Delete your Sender Information.
751
+ @param {Array} data contains php array with key value pair.
752
+ @options data {Integer} id: Id of sender to be deleted [Mandatory]
753
+ */
754
+ public function delete_sender($data)
755
+ {
756
+ return $this->delete("advanced/".$data['id'], "");
757
+ }
758
+
759
+ /*
760
+ Send Transactional Email.
761
+ @param {Array} data contains php array with key value pair.
762
+ @options data {Array} to: Email address of the recipient(s). It should be sent as an associative array. Example: array("to@example.net"=>"to whom"). You can use commas to separate multiple recipients [Mandatory]
763
+ @options data {String} subject: Message subject [Mandatory]
764
+ @options data {Array} from Email address for From header. It should be sent as an array. Example: array("from@email.com","from email") [Mandatory]
765
+ @options data {String} html: Body of the message. (HTML version) [Mandatory]. To send inline images, use <img src="{YourFileName.Extension}" alt="image" border="0" >, the 'src' attribute value inside {} (curly braces) should be same as the filename used in 'inline_image' parameter
766
+ @options data {String} text: Body of the message. (text version) [Optional]
767
+ @options data {Array} cc: Same as to but for Cc. Example: array("cc@example.net","cc whom") [Optional]
768
+ @options data {Array} bcc: Same as to but for Bcc. Example: array("bcc@example.net","bcc whom") [Optional]
769
+ @options data {Array} replyto: Same as from but for Reply To. Example: array("from@email.com","from email") [Optional]
770
+ @options data {Array} attachment: Provide the absolute url of the attachment/s. Possible extension values = gif, png, bmp, cgm, jpg, jpeg, txt, css, shtml, html, htm, csv, zip, pdf, xml, doc, xls, ppt, tar, and ez. To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple attachments [Optional]
771
+ @options data {Array} headers: The headers will be sent along with the mail headers in original email. Example: array("Content-Type"=>"text/html; charset=iso-8859-1"). You can use commas to separate multiple headers [Optional]
772
+ @options data {Array} inline_image: Pass your inline image/s filename & its base64 encoded chunk data as an associative array. Example: array("YourFileName.Extension"=>"Base64EncodedChunkData"). You can use commas to separate multiple inline images [Optional]
773
+ */
774
+ public function send_email($data)
775
+ {
776
+ return $this->post("email", json_encode($data));
777
+ }
778
+
779
+ /*
780
+ Aggregate / date-wise report of the SendinBlue SMTP account.
781
+ @param {Array} data contains php array with key value pair.
782
+ @options data {Integer} aggregate: This is used to indicate, you are interested in all-time totals. Possible values – 0 & 1. aggregate = 0 means it will not aggregate records, and will show stats per day/date wise [Optional]
783
+ @options data {String} start_date: The start date to look up statistics. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
784
+ @options data {String} end_date: The end date to look up statistics. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
785
+ @options data {Integer} days: Number of days in the past to include statistics ( Includes today ). It must be an integer greater than 0 [Optional]
786
+ @options data {String} tag: The tag you will specify to retrieve detailed stats. It must be an existing tag that has statistics [Optional]
787
+ */
788
+ public function get_statistics($data)
789
+ {
790
+ return $this->post("statistics", json_encode($data));
791
+ }
792
+
793
+ /*
794
+ Get Email Event report.
795
+ @param {Array} data contains php array with key value pair.
796
+ @options data {Integer} limit: To limit the number of results returned. It should be an integer [Optional]
797
+ @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
798
+ @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
799
+ @options data {Integer} offset: Beginning point in the list to retrieve from. It should be an integer [Optional]
800
+ @options data {String} date: Specific date to get its report. Date must be in YYYY-MM-DD format and should be earlier than todays date [Optional]
801
+ @options data {Integer} days: Number of days in the past (includes today). If specified, must be an integer greater than 0 [Optional]
802
+ @options data {String} email: Email address to search report for [Optional]
803
+ */
804
+ public function get_report($data)
805
+ {
806
+ return $this->post("report", json_encode($data));
807
+ }
808
+
809
+ /*
810
+ Delete any hardbounce, which actually would have been blocked due to some temporary ISP failures.
811
+ @param {Array} data contains php array with key value pair.
812
+ @options data {String} start_date: The start date to get report from. Date must be in YYYY-MM-DD format and should be before the end_date [Optional]
813
+ @options data {String} end_date: The end date to get report till date. Date must be in YYYY-MM-DD format and should be after the start_date [Optional]
814
+ @options data {String} email: Email address to delete its bounces [Optional]
815
+ */
816
+ public function delete_bounces($data)
817
+ {
818
+ return $this->post("bounces", json_encode($data));
819
+ }
820
+
821
+ /*
822
+ Send templates created on SendinBlue, through SendinBlue SMTP (transactional mails).
823
+ @param {Array} data contains php array with key value pair.
824
+ @options data {Integer} id: Id of the template created on SendinBlue account [Mandatory]
825
+ @options data {String} to: Email address of the recipient(s). You can use pipe ( | ) to separate multiple recipients. Example: "to-example@example.net|to2-example@example.net" [Mandatory]
826
+ @options data {String} cc: Same as to but for Cc [Optional]
827
+ @options data {String} bcc: Same as to but for Bcc [Optional]
828
+ @options data {Array} attrv The name of attribute present in your SendinBlue account. It should be sent as an associative array. Example: array("NAME"=>"name"). You can use commas to separate multiple attributes [Optional]
829
+ @options data {String} attachment_url: Provide the absolute url of the attachment. Url not allowed from local machine. File must be hosted somewhere [Optional]
830
+ @options data {Array} attachment: To send attachment/s generated on the fly you have to pass your attachment/s filename & its base64 encoded chunk data as an associative array [Optional]
831
+ */
832
+ public function send_transactional_template($data)
833
+ {
834
+ $id = $data['id'];
835
+ unset($data['id']);
836
+ return $this->put("template/".$id, json_encode($data));
837
+ }
838
+
839
+ /*
840
+ Create a Template.
841
+ @param {Array} data contains php array with key value pair.
842
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
843
+ @options data {String} template_name: Name of the Template [Mandatory]
844
+ @options data {String} bat: Email address for test mail [Optional]
845
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
846
+ @options data {String} html_url Url: which content is the body of content [Mandatory: if html_content is empty]
847
+ @options data {String} subject: Subject of the campaign [Mandatory]
848
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
849
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
850
+ @options data {String} to_fieldv This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
851
+ @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional]
852
+ @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional]
853
+ */
854
+ public function create_template($data)
855
+ {
856
+ return $this->post("template", json_encode($data));
857
+ }
858
+
859
+ /*
860
+ Update a Template.
861
+ @param {Array} data contains php array with key value pair.
862
+ @options data {Integer} id: Id of Template to be modified [Mandatory]
863
+ @options data {String} from_name: Sender name from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
864
+ @options data {String} template_name: Name of the Template [Mandatory]
865
+ @options data {String} bat: Email address for test mail [Optional]
866
+ @options data {String} html_content: Body of the content. The HTML content field must have more than 10 characters [Mandatory: if html_url is empty]
867
+ @options data {String} html_url: Url which content is the body of content [Mandatory: if html_content is empty]
868
+ @options data {String} subject: Subject of the campaign [Mandatory]
869
+ @options data {String} from_email: Sender email from which the campaign emails are sent [Mandatory: for Dedicated IP clients & for Shared IP clients, if sender exists]
870
+ @options data {String} reply_to: The reply to email in the campaign emails [Optional]
871
+ @options data {String} to_field: This is to personalize the «To» Field. If you want to include the first name and last name of your recipient, add [PRENOM] [NOM]. To use the contact attributes here, these should already exist in SendinBlue account [Optional]
872
+ @options data {Integer} status: Status of template. Possible values = 0 (default) & 1. status = 0 means template is inactive, & status = 1 means template is active [Optional]
873
+ @options data {Integer} attachment: Status of attachment. Possible values = 0 (default) & 1. attach = 0 means an attachment can’t be sent, & attach = 1 means an attachment can be sent, in the email [Optional]
874
+ */
875
+ public function update_template($data)
876
+ {
877
+ $id = $data['id'];
878
+ unset($data['id']);
879
+ return $this->put("template/".$id, json_encode($data));
880
+ }
881
+
882
+ /*
883
+ Send a transactional SMS.
884
+ @param {Array} data contains php array with key value pair.
885
+ @options data {String} to: The mobile number to send SMS to with country code [Mandatory]
886
+ @options data {String} from: The name of the sender. The number of characters is limited to 11 (alphanumeric format) [Mandatory]
887
+ @options data {String} text: The text of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Mandatory]
888
+ @options data {String} web_url: The web URL that can be called once the message is successfully delivered [Optional]
889
+ @options data {String} tag: The tag that you can associate with the message [Optional]
890
+ @options data {String} type: Type of message. Possible values – marketing (default) & transactional. You can use marketing for sending marketing SMS, & for sending transactional SMS, use transactional type [Optional]
891
+ */
892
+ public function send_sms($data)
893
+ {
894
+ return $this->post("sms", json_encode($data));
895
+ }
896
+
897
+ /*
898
+ Create & Schedule your SMS campaigns.
899
+ @param {Array} data contains php array with key value pair.
900
+ @options data {String} name: Name of the SMS campaign [Mandatory]
901
+ @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional]
902
+ @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional]
903
+ @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional]
904
+ @options data {Array} listid: These are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty]
905
+ @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional]
906
+ @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional]
907
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
908
+ */
909
+ public function create_sms_campaign($data)
910
+ {
911
+ return $this->post("sms", json_encode($data));
912
+ }
913
+
914
+ /*
915
+ Update your SMS campaigns.
916
+ @param {Array} data contains php array with key value pair.
917
+ @options data {Integer} id: Id of the SMS campaign [Mandatory]
918
+ @options data {String} name: Name of the SMS campaign [Optional]
919
+ @options data {String} sender: This allows you to customize the SMS sender. The number of characters is limited to 11 ( alphanumeric format ) [Optional]
920
+ @options data {String} content: Content of the message. The maximum characters used per SMS is 160, if used more than that, it will be counted as more than one SMS [Optional]
921
+ @options data {String} bat: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Optional]
922
+ @options data {Array} listid: hese are the list ids to which the SMS campaign is sent [Mandatory: if scheduled_date is not empty]
923
+ @options data {Array} exclude_list: These are the list ids which will be excluded from the SMS campaign [Optional]
924
+ @options data {String} scheduled_date: The day on which the SMS campaign is supposed to run [Optional]
925
+ @options data {Integer} send_now: Flag to send campaign now. Possible values = 0 (default) & 1. send_now = 0 means campaign can’t be send now, & send_now = 1 means campaign ready to send now [Optional]
926
+ */
927
+ public function update_sms_campaign($data)
928
+ {
929
+ $id = $data['id'];
930
+ unset($data['id']);
931
+ return $this->put("sms/".$id, json_encode($data));
932
+ }
933
+
934
+ /*
935
+ Send a Test SMS.
936
+ @param {Array} data contains php array with key value pair.
937
+ @options data {Integer} id: Id of the SMS campaign [Mandatory]
938
+ @options data {String} to: Mobile number with the country code to send test SMS. The mobile number defined here should belong to one of your contacts in SendinBlue account and should not be blacklisted [Mandatory]
939
+ */
940
+ public function send_bat_sms($data)
941
+ {
942
+ $id = $data['id'];
943
+ unset($data['id']);
944
+ return $this->get("sms/".$id, json_encode($data));
945
+ }
946
+ }
vendor/mailin-api/mailin-api-php/src/Sendinblue/README.md ADDED
@@ -0,0 +1,154 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # SendinBlue Php Library
2
+
3
+ This is the SendinBlue Php library. It implements the various exposed APIs that you can read more about on https://apidocs.sendinblue.com.
4
+
5
+
6
+ ## Installation and Quickstart
7
+
8
+ * You will need to first get the Access key from [SendinBlue](https://www.sendinblue.com).
9
+
10
+ * Our library supports a timeout value, default is 30,000 MS ( 30 secs ), which you can pass as 3rd parameter in Mailin class Object.
11
+
12
+ * You can install the SendinBlue API using [Composer](https://packagist.org/packages/mailin-api/mailin-api-php). Just add the following to your composer.json:
13
+
14
+ ```{
15
+ "require": {
16
+ "mailin-api/mailin-api-php": "1.0.*"
17
+ }
18
+ }```
19
+
20
+ You will then need to:
21
+ * Run ``composer install`` to get these dependencies added to your vendor directory
22
+ * Add the autoloader to your application with this line: ``require("vendor/autoload.php")``
23
+
24
+ OR
25
+ * Simply install by running below command
26
+
27
+ ```
28
+ composer require mailin-api/mailin-api-php
29
+ ```
30
+
31
+ You can use below sample script to get started.
32
+
33
+ ```PHP
34
+ <?php
35
+ use Sendinblue\Mailin
36
+ /*
37
+ * This will initiate the API with the endpoint and your access key.
38
+ *
39
+ */
40
+ $mailin = new Mailin('https://api.sendinblue.com/v2.0','Your access key', 5000); // Optional parameter: Timeout in MS
41
+
42
+ /** Prepare variables for easy use **/
43
+
44
+ $data = array( "to" => array("to@example.net"=>"to whom!"),
45
+ "cc" => array("cc@example.net"=>"cc whom!"),
46
+ "bcc" =>array("bcc@example.net"=>"bcc whom!"),
47
+ "from" => array("from@email.com","from email!"),
48
+ "replyto" => array("replyto@email.com","reply to!"),
49
+ "subject" => "My subject",
50
+ "text" => "This is the text",
51
+ "html" => "This is the <h1>HTML</h1><br/>
52
+ This is inline image 1.<br/>
53
+ <img src=\"{myinlineimage1.png}\" alt=\"image1\" border=\"0\"><br/>
54
+ Some text<br/>
55
+ This is inline image 2.<br/>
56
+ <img src=\"{myinlineimage2.jpg}\" alt=\"image2\" border=\"0\"><br/>
57
+ Some more text<br/>
58
+ Re-used inline image 1.<br/>
59
+ <img src=\"{myinlineimage1.png}\" alt=\"image3\" border=\"0\">",
60
+ "attachment" => array(),
61
+ "headers" => array("Content-Type"=> "text/html; charset=iso-8859-1","X-param1"=> "value1", "X-param2"=> "value2",...,"X-Mailin-custom"=>"my custom value", "X-Mailin-IP"=> "102.102.1.2", "X-Mailin-Tag" => "My tag"),
62
+ "inline_image" => array('myinlineimage1.png' => "your_png_files_base64_encoded_chunk_data",'myinlineimage2.jpg' => "your_jpg_files_base64_encoded_chunk_data")
63
+ );
64
+
65
+ var_dump($mailin->send_email($data));
66
+
67
+ ?>
68
+ ```
69
+
70
+ * To explore more, you should visit the [SendinBlue API documentation](https://apidocs.sendinblue.com).
71
+
72
+ ## Available functions
73
+
74
+ List of API calls that you can make, you can click to read more about it. Please do note that the order of parameters are important.
75
+
76
+ ### Campaign calls
77
+
78
+ * [get_account](https://apidocs.sendinblue.com/account/#1)() - Get your account information
79
+ * [get_smtp_details](https://apidocs.sendinblue.com/account/#7)() - Get your SMTP account information
80
+ * [create_child_account](https://apidocs.sendinblue.com/account/#2)($data) - Create a Reseller child account
81
+ * [update_child_account](https://apidocs.sendinblue.com/account/#3)($data) - Update a Reseller child account
82
+ * [delete_child_account](https://apidocs.sendinblue.com/account/#4)($data) - Delete a Reseller child account
83
+ * [get_reseller_child](https://apidocs.sendinblue.com/account/#5)($data) - Get Reseller child accounts
84
+ * [add_remove_child_credits](https://apidocs.sendinblue.com/account/#6)($data) - Add/Remove Reseller child credits
85
+ * [get_campaigns_v2](https://apidocs.sendinblue.com/campaign/#1)($data) - Get list of all campaigns or of specific type or status or both
86
+ * [get_campaign_v2](https://apidocs.sendinblue.com/campaign/#1)($data) - Get specific campaign object
87
+ * [create_campaign](https://apidocs.sendinblue.com/campaign/#2)($data) - Create a campaign
88
+ * [delete_campaign](https://apidocs.sendinblue.com/campaign/#3)($data) - Delete a campaign
89
+ * [update_campaign](https://apidocs.sendinblue.com/campaign/#4)($data) - Update campaign information
90
+ * [campaign_report_email](https://apidocs.sendinblue.com/campaign/#5)($data) - Sending reports to specific emails
91
+ * [campaign_recipients_export](https://apidocs.sendinblue.com/campaign/#6)($data) - Export recipients of a campaign
92
+ * [send_bat_email](https://apidocs.sendinblue.com/campaign/#7)($data) - Send a test Email (bat)
93
+ * [create_trigger_campaign](https://apidocs.sendinblue.com/campaign/#8)($data) - Create a trigger campaign
94
+ * [update_trigger_campaign](https://apidocs.sendinblue.com/campaign/#9)($data) - Update trigger campaign information
95
+ * [share_campaign](https://apidocs.sendinblue.com/campaign/#10)($data) - Get campaign share link
96
+ * [update_campaign_status](https://apidocs.sendinblue.com/campaign/#11)($data) - Modify a campaign status
97
+ * [get_folders](https://apidocs.sendinblue.com/folder/#1)($data) - Get list of all the folder details.
98
+ * [get_folder](https://apidocs.sendinblue.com/folder/#2)($data) - Get all the folder details for folder with id <id>
99
+ * [create_folder](https://apidocs.sendinblue.com/folder/#3)($data) - Create a folder
100
+ * [delete_folder](https://apidocs.sendinblue.com/folder/#4)($data) - Delete folder with folder id <id>
101
+ * [update_folder](https://apidocs.sendinblue.com/folder/#5)($data) - Update folder with folder id <id>
102
+ * [get_lists](https://apidocs.sendinblue.com/list/#1)($data) - Get all the lists
103
+ * [get_list](https://apidocs.sendinblue.com/list/#2)($data) - Get information about a list
104
+ * [create_list](https://apidocs.sendinblue.com/list/#3)($data) - Create a list
105
+ * [delete_list](https://apidocs.sendinblue.com/list/#4)($data) - Delete a list
106
+ * [update_list](https://apidocs.sendinblue.com/list/#5)($data) - Updating a list
107
+ * [display_list_users](https://apidocs.sendinblue.com/list/#8)($data) - Display details of all users for the given lists
108
+ * [add_users_list](https://apidocs.sendinblue.com/list/#6)($data) - Add users to a list
109
+ * [delete_users_list](https://apidocs.sendinblue.com/list/#7)($data) - Delete users from a list
110
+ * [get_attributes](https://apidocs.sendinblue.com/attribute/#1)() - Listing all attributes
111
+ * [get_attribute](https://apidocs.sendinblue.com/attribute/#2)($data) - Listing a certain type attributes
112
+ * [create_attribute](https://apidocs.sendinblue.com/attribute/#3)($data) - Creating attributes
113
+ * [delete_attribute](https://apidocs.sendinblue.com/attribute/#4)($data) - Deleting attributes of the given type
114
+ * [get_user](https://apidocs.sendinblue.com/user/#2)($data) - Get information about a user/email
115
+ * [create_update_user](https://apidocs.sendinblue.com/user/#1)($data) - Create/Update a user information
116
+ * [delete_user](https://apidocs.sendinblue.com/user/#3)($data) - Deleting user from db is not permitted but this action will unlink him from all lists
117
+ * [import_users](https://apidocs.sendinblue.com/user/#4)($data) - Import users/emails
118
+ * [export_users](https://apidocs.sendinblue.com/user/#5)($data) - Export users/emails
119
+ * [get_processes](https://apidocs.sendinblue.com/process/#1)($data) - Get information about all background processes
120
+ * [get_process](https://apidocs.sendinblue.com/process/#2)($data) - Get information about a specific process
121
+ * [get_senders](https://apidocs.sendinblue.com/sender-management/#1)($data) - Get information about all/specific senders
122
+ * [create_sender](https://apidocs.sendinblue.com/sender-management/#2)($data) - Create a sender
123
+ * [delete_sender](https://apidocs.sendinblue.com/sender-management/#3)($data) - Delete a sender
124
+ * [update_sender](https://apidocs.sendinblue.com/sender-management/#4)($data) - Update a sender
125
+
126
+ ### SMTP calls
127
+
128
+ * [get_report](https://apidocs.sendinblue.com/report/)($data) - Retrieve information for all report events
129
+ * [get_statistics](https://apidocs.sendinblue.com/statistics/)($data) - Get aggregate statistics about emails sent
130
+ * [get_webhooks](https://apidocs.sendinblue.com/webhooks/#1)($data) - Get list of all registered webhooks or of specific type
131
+ * [get_webhook](https://apidocs.sendinblue.com/webhooks/#2)($data) - Get information about a webhook
132
+ * [create_webhook](https://apidocs.sendinblue.com/webhooks/#3)($data) - Registering a webhook
133
+ * [delete_webhook](https://apidocs.sendinblue.com/webhooks/#5)($data) - Deleting a webhook
134
+ * [update_webhook](https://apidocs.sendinblue.com/webhooks/#4)($data) - Editing a webhook
135
+ * [delete_bounces](https://apidocs.sendinblue.com/bounces/)($data) - Deleting bounces
136
+ * [send_email](https://apidocs.sendinblue.com/tutorial-sending-transactional-email/)($data) - Sending out a transactional email
137
+ * [send_transactional_template](https://apidocs.sendinblue.com/template/)($data) - Send templates created on SendinBlue, through SendinBlue smtp.
138
+ * [create_template](https://apidocs.sendinblue.com/template/#2)($data) - Create a template
139
+ * [update_template](https://apidocs.sendinblue.com/template/#3)($data) - Update template information
140
+
141
+ ### SMS call
142
+
143
+ * [send_sms](https://apidocs.sendinblue.com/mailin-sms/#1)($data) - Sending a SMS
144
+ * [create_sms_campaign](https://apidocs.sendinblue.com/mailin-sms/#2)($data) - Create a SMS campaign
145
+ * [update_sms_campaign](https://apidocs.sendinblue.com/mailin-sms/#3)($data) - Update a SMS campaign
146
+ * [send_bat_sms](https://apidocs.sendinblue.com/mailin-sms/#4)($data) - Send a test SMS campaign
147
+
148
+ ####Recommendation:
149
+
150
+ If you face any error like "Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:func(144):reason(134)\n", with our library then by adding the below line of code just before curl_exec() ( line no. 48 ) in mailin.php file, you may no longer face this issue.
151
+ ```PHP
152
+ curl_setopt($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");
153
+ ```
154
+ The content of the file is available here: http://curl.haxx.se/ca/cacert.pem
vendor/mailin-api/mailin-api-php/src/Sendinblue/examples/README.md ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Examples
2
+
3
+ * tutorial1.php - Sending a transactional email
4
+ * tutorial2.php - Get all campaigns
5
+ * tutorial3.php - Send a transactional SMS
6
+
7
+ ## Available functions
8
+
9
+ List of API calls that you can make, you can click to read more about it. Please do note that the order of parameters are important.
10
+
11
+
12
+ ### Campaign calls
13
+
14
+ * [get_account](https://apidocs.sendinblue.com/account/#1)() - Get your account information
15
+ * [get_smtp_details](https://apidocs.sendinblue.com/account/#7)() - Get your SMTP account information
16
+ * [create_child_account](https://apidocs.sendinblue.com/account/#2)($data) - Create a Reseller child account
17
+ * [update_child_account](https://apidocs.sendinblue.com/account/#3)($data) - Update a Reseller child account
18
+ * [delete_child_account](https://apidocs.sendinblue.com/account/#4)($data) - Delete a Reseller child account
19
+ * [get_reseller_child](https://apidocs.sendinblue.com/account/#5)($data) - Get Reseller child accounts
20
+ * [add_remove_child_credits](https://apidocs.sendinblue.com/account/#6)($data) - Add/Remove Reseller child credits
21
+ * [get_campaigns_v2](https://apidocs.sendinblue.com/campaign/#1)($data) - Get list of all campaigns or of specific type or status or both
22
+ * [get_campaign_v2](https://apidocs.sendinblue.com/campaign/#1)($data) - Get specific campaign object
23
+ * [create_campaign](https://apidocs.sendinblue.com/campaign/#2)($data) - Create a campaign
24
+ * [delete_campaign](https://apidocs.sendinblue.com/campaign/#3)($data) - Delete a campaign
25
+ * [update_campaign](https://apidocs.sendinblue.com/campaign/#4)($data) - Update campaign information
26
+ * [campaign_report_email](https://apidocs.sendinblue.com/campaign/#5)($data) - Sending reports to specific emails
27
+ * [campaign_recipients_export](https://apidocs.sendinblue.com/campaign/#6)($data) - Export recipients of a campaign
28
+ * [send_bat_email](https://apidocs.sendinblue.com/campaign/#7)($data) - Send a test Email (bat)
29
+ * [create_trigger_campaign](https://apidocs.sendinblue.com/campaign/#8)($data) - Create a trigger campaign
30
+ * [update_trigger_campaign](https://apidocs.sendinblue.com/campaign/#9)($data) - Update trigger campaign information
31
+ * [share_campaign](https://apidocs.sendinblue.com/campaign/#10)($data) - Get campaign share link
32
+ * [update_campaign_status](https://apidocs.sendinblue.com/campaign/#11)($data) - Modify a campaign status
33
+ * [get_folders](https://apidocs.sendinblue.com/folder/#1)($data) - Get list of all the folder details.
34
+ * [get_folder](https://apidocs.sendinblue.com/folder/#2)($data) - Get all the folder details for folder with id <id>
35
+ * [create_folder](https://apidocs.sendinblue.com/folder/#3)($data) - Create a folder
36
+ * [delete_folder](https://apidocs.sendinblue.com/folder/#4)($data) - Delete folder with folder id <id>
37
+ * [update_folder](https://apidocs.sendinblue.com/folder/#5)($data) - Update folder with folder id <id>
38
+ * [get_lists](https://apidocs.sendinblue.com/list/#1)($data) - Get all the lists
39
+ * [get_list](https://apidocs.sendinblue.com/list/#2)($data) - Get information about a list
40
+ * [create_list](https://apidocs.sendinblue.com/list/#3)($data) - Create a list
41
+ * [delete_list](https://apidocs.sendinblue.com/list/#4)($data) - Delete a list
42
+ * [update_list](https://apidocs.sendinblue.com/list/#5)($data) - Updating a list
43
+ * [display_list_users](https://apidocs.sendinblue.com/list/#8)($data) - Display details of all users for the given lists
44
+ * [add_users_list](https://apidocs.sendinblue.com/list/#6)($data) - Add users to a list
45
+ * [delete_users_list](https://apidocs.sendinblue.com/list/#7)($data) - Delete users from a list
46
+ * [get_attributes](https://apidocs.sendinblue.com/attribute/#1)() - Listing all attributes
47
+ * [get_attribute](https://apidocs.sendinblue.com/attribute/#2)($data) - Listing a certain type attributes
48
+ * [create_attribute](https://apidocs.sendinblue.com/attribute/#3)($data) - Creating attributes
49
+ * [delete_attribute](https://apidocs.sendinblue.com/attribute/#4)($data) - Deleting attributes of the given type
50
+ * [get_user](https://apidocs.sendinblue.com/user/#2)($data) - Get information about a user/email
51
+ * [create_update_user](https://apidocs.sendinblue.com/user/#1)($data) - Create/Update a user information
52
+ * [delete_user](https://apidocs.sendinblue.com/user/#3)($data) - Deleting user from db is not permitted but this action will unlink him from all lists
53
+ * [import_users](https://apidocs.sendinblue.com/user/#4)($data) - Import users/emails
54
+ * [export_users](https://apidocs.sendinblue.com/user/#5)($data) - Export users/emails
55
+ * [get_processes](https://apidocs.sendinblue.com/process/#1)($data) - Get information about all background processes
56
+ * [get_process](https://apidocs.sendinblue.com/process/#2)($data) - Get information about a specific process
57
+ * [get_senders](https://apidocs.sendinblue.com/sender-management/#1)($data) - Get information about all/specific senders
58
+ * [create_sender](https://apidocs.sendinblue.com/sender-management/#2)($data) - Create a sender
59
+ * [delete_sender](https://apidocs.sendinblue.com/sender-management/#3)($data) - Delete a sender
60
+ * [update_sender](https://apidocs.sendinblue.com/sender-management/#4)($data) - Update a sender
61
+
62
+ ### SMTP calls
63
+
64
+ * [get_report](https://apidocs.sendinblue.com/report/)($data) - Retrieve information for all report events
65
+ * [get_statistics](https://apidocs.sendinblue.com/statistics/)($data) - Get aggregate statistics about emails sent
66
+ * [get_webhooks](https://apidocs.sendinblue.com/webhooks/#1)($data) - Get list of all registered webhooks or of specific type
67
+ * [get_webhook](https://apidocs.sendinblue.com/webhooks/#2)($data) - Get information about a webhook
68
+ * [create_webhook](https://apidocs.sendinblue.com/webhooks/#3)($data) - Registering a webhook
69
+ * [delete_webhook](https://apidocs.sendinblue.com/webhooks/#5)($data) - Deleting a webhook
70
+ * [update_webhook](https://apidocs.sendinblue.com/webhooks/#4)($data) - Editing a webhook
71
+ * [delete_bounces](https://apidocs.sendinblue.com/bounces/)($data) - Deleting bounces
72
+ * [send_email](https://apidocs.sendinblue.com/tutorial-sending-transactional-email/)($data) - Sending out a transactional email
73
+ * [send_transactional_template](https://apidocs.sendinblue.com/template/)($data) - Send templates created on SendinBlue, through SendinBlue smtp.
74
+ * [create_template](https://apidocs.sendinblue.com/template/#2)($data) - Create a template
75
+ * [update_template](https://apidocs.sendinblue.com/template/#3)($data) - Update template information
76
+
77
+ ### SMS call
78
+
79
+ * [send_sms](https://apidocs.sendinblue.com/mailin-sms/#1)($data) - Sending a SMS
80
+ * [create_sms_campaign](https://apidocs.sendinblue.com/mailin-sms/#2)($data) - Create a SMS campaign
81
+ * [update_sms_campaign](https://apidocs.sendinblue.com/mailin-sms/#3)($data) - Update a SMS campaign
82
+ * [send_bat_sms](https://apidocs.sendinblue.com/mailin-sms/#4)($data) - Send a test SMS campaign
83
+
84
+ ####Recommendation:
85
+
86
+ If you face any error like "Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:func(144):reason(134)\n", with our library then by adding the below line of code just before curl_exec() ( line no. 37 ) in mailin.php file, you may no longer face this issue.
87
+ ```PHP
88
+ curl_setopt($ch, CURLOPT_CAINFO, "PATH_TO/cacert.pem");
89
+ ```
90
+ The content of the file is available here: http://curl.haxx.se/ca/cacert.pem
vendor/mailin-api/mailin-api-php/src/Sendinblue/examples/tutorial1.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use Sendinblue\Mailin;
4
+ /*
5
+ * This will initiate the API with the endpoint and your access key.
6
+ *
7
+ */
8
+ $mailin = new Mailin('https://api.sendinblue.com/v2.0','Your access key');
9
+
10
+ /*
11
+ * This will send a transactional email
12
+ *
13
+ */
14
+ /** Prepare variables for easy use **/
15
+
16
+ $data = array( "to" => array("to@example.net"=>"to whom!"),
17
+ "cc" => array("cc@example.net"=>"cc whom!"),
18
+ "bcc" =>array("bcc@example.net"=>"bcc whom!"),
19
+ "from" => array("from@email.com","from email!"),
20
+ "replyto" => array("replyto@email.com","reply to!"),
21
+ "subject" => "My subject",
22
+ "text" => "This is the text",
23
+ "html" => "This is the <h1>HTML</h1><br/>
24
+ This is inline image 1.<br/>
25
+ <img src=\"{myinlineimage1.png}\" alt=\"image1\" border=\"0\"><br/>
26
+ Some text<br/>
27
+ This is inline image 2.<br/>
28
+ <img src=\"{myinlineimage2.jpg}\" alt=\"image2\" border=\"0\"><br/>
29
+ Some more text<br/>
30
+ Re-used inline image 1.<br/>
31
+ <img src=\"{myinlineimage1.png}\" alt=\"image3\" border=\"0\">",
32
+ "attachment" => array(),
33
+ "headers" => array("Content-Type"=> "text/html; charset=iso-8859-1","X-param1"=> "value1", "X-param2"=> "value2","X-Mailin-custom"=>"my custom value", "X-Mailin-IP"=> "102.102.1.2", "X-Mailin-Tag" => "My tag"),
34
+ "inline_image" => array('myinlineimage1.png' => "your_png_files_base64_encoded_chunk_data",'myinlineimage2.jpg' => "your_jpg_files_base64_encoded_chunk_data")
35
+ );
36
+
37
+ var_dump($mailin->send_email($data));
38
+
39
+ ?>
vendor/mailin-api/mailin-api-php/src/Sendinblue/examples/tutorial2.php ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use Sendinblue\Mailin;
4
+ /*
5
+ * This will initiate the API with the endpoint and your access key.
6
+ *
7
+ */
8
+ $mailin = new Mailin('https://api.sendinblue.com/v2.0','Your access key');
9
+
10
+ /*
11
+ * This will get all your campaigns
12
+ *
13
+ */
14
+ /** Prepare variables for easy use **/
15
+
16
+ $data = array( "type"=>"classic",
17
+ "status"=>"queued",
18
+ "page"=>1,
19
+ "page_limit"=>10
20
+ );
21
+
22
+ var_dump($mailin->get_campaigns_v2($data));
23
+
24
+ ?>
vendor/mailin-api/mailin-api-php/src/Sendinblue/examples/tutorial3.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ use Sendinblue\Mailin;
4
+ /*
5
+ * This will initiate the API with the endpoint and your access key.
6
+ *
7
+ */
8
+ $mailin = new Mailin('https://api.sendinblue.com/v2.0','Your access key');
9
+
10
+ /*
11
+ * This will send a transactional SMS
12
+ *
13
+ */
14
+ /** Prepare variables for easy use **/
15
+
16
+ $data = array( "to" => "+331234567890",
17
+ "from" => "From",
18
+ "text" => "Good morning - test",
19
+ "web_url" => "http://example.com",
20
+ "tag" => "Tag1",
21
+ "type" => ""
22
+ );
23
+
24
+ var_dump($mailin->send_sms($data));
25
+
26
+ ?>