Plugin Directory

Changeset 2711276


Ignore:
Timestamp:
04/18/2022 10:41:14 PM (4 years ago)
Author:
emfluencekc
Message:

Plugin version 2.11

Location:
wp-emfluence/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-emfluence/trunk/admin.php

    r2225635 r2711276  
    9292function _emfluence_emailer_options_api_key_element(){
    9393  $options = get_option('emfluence_global');
     94    if(empty($options) || !is_string($options['api_key'])) $options = array('api_key' => '');
    9495  echo "<input id='api_key' name='emfluence_global[api_key]' size='36' type='text' value='{$options['api_key']}' />";
    9596}
     
    9798function _emfluence_emailer_options_blacklist_domains_element(){
    9899  $options = get_option('emfluence_global');
     100    if(!is_array($options)) $options = array();
    99101  if(!array_key_exists('blacklist_domains', $options)) $options['blacklist_domains'] = '';
    100102  echo "
  • wp-emfluence/trunk/emfluence.php

    r2549274 r2711276  
    55Description: Easily add forms to your website for contacts to add or update their details in your emfluence Marketing Platform account.
    66Author: emfluence Digital Marketing
    7 Version: 2.11
     7Version: 2.12
    88Author URI: https://www.emfluence.com
    99Text Domain: emfl_form
  • wp-emfluence/trunk/libraries/emfl_platform_api/api.class.inc

    r1919566 r2711276  
    100100    // make the call with the best request handler available
    101101    $url = self::API_URL . '/' . $endpoint;
    102     $params['accessToken'] = $this->access_token;
    103102
    104103    if( function_exists('drupal_http_request') && defined('VERSION') ) {
     
    108107            $url,
    109108            array(
    110               'headers' => array( 'Content-Type' => 'application/json' ),
     109              'headers' => array(
     110                  'Content-Type'  => 'application/json',
     111                  'Authorization' => 'Bearer ' . $this->access_token
     112              ),
    111113              'method' => 'POST',
    112114              'data' => json_encode( (object) $params),
     
    117119        $response = drupal_http_request(
    118120            $url,
    119             array( 'Content-Type' => 'application/json' ),
     121            array(
     122                'Content-Type'  => 'application/json',
     123                'Authorization' => 'Bearer ' . $this->access_token
     124            ),
    120125            'POST',
    121126            json_encode( (object) $params),
     
    131136          array(
    132137              'timeout' => $this->timeout,
    133               'headers' => array( 'Content-Type' => 'application/json' ),
     138              'headers' => array(
     139                  'Content-Type'  => 'application/json',
     140                  'Authorization' => 'Bearer ' . $this->access_token,
     141              ),
    134142              'body' => json_encode( (object) $params )
    135143          )
     
    149157      // Fall back on CURL
    150158      $curl = curl_init($url);
     159      $authorization = 'Bearer ' . $this->access_token;
     160
    151161      curl_setopt($curl, CURLOPT_HEADER, false);
    152162      curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    153       curl_setopt($curl, CURLOPT_HTTPHEADER, array("Content-type: application/json"));
     163      curl_setopt($curl, CURLOPT_HTTPHEADER, array(
     164          "Content-type: application/json",
     165          "Authorization: $authorization"
     166      ));
    154167      curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 2);
    155168      curl_setopt($curl, CURLOPT_TIMEOUT, $this->timeout);
  • wp-emfluence/trunk/readme.txt

    r2549274 r2711276  
    22Tags: email, email marketing, emailmarketing, emfluence, api, marketing automation, widget, email widget, email signup, mailing list, newsletter, form, automation
    33Requires at least: 4.0
    4 Tested up to: 5.7.2
    5 Stable tag: 2.11
     4Tested up to: 5.9.3
     5Stable tag: 2.12
    66Requires PHP: 5.6
    77Contributors: emfluencekc, mightyturtle
     
    5757
    5858== Changelog ==
     59
     60= 2.12 =
     61* Update platform authorization method
    5962
    6063= 2.11 =
Note: See TracChangeset for help on using the changeset viewer.