Plugin Directory

Changeset 3028834


Ignore:
Timestamp:
01/30/2024 12:36:53 PM (2 years ago)
Author:
elasticemail
Message:

Update

Location:
elastic-email-sender
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • elastic-email-sender/tags/v1.2.12/class/ees_admin.php

    r3028738 r3028834  
    1414     */
    1515    private $defaultOptions = ['ee_enable' => 'no', 'ee_apikey' => null, 'ee_emailtype' => 'marketing'],
    16         $options,
    17         $initAPI = false,
    18         $subscribe_status = false;
     16    $options,
     17    $initAPI = false,
     18    $subscribe_status = false;
    1919    public $theme_path;
    2020
     
    2323     */
    2424    public function __construct($pluginpath)
    25 
    2625    {
    2726        $this->theme_path = $pluginpath;
     
    6362            wp_register_style('eesender-css', $plugin_path . '/dist/ees_admin.min.css', '', 1.2, false);
    6463
    65             wp_localize_script('eesender-send-test', 'ees_localize_data',
     64            wp_localize_script(
     65                'eesender-send-test',
     66                'ees_localize_data',
    6667                [
    6768                    'adminUrl' => get_admin_url()
     
    140141        return;
    141142    }
    142    
     143
    143144    public function addChannel($name)
    144145    {
     
    147148            $channelAPI = new \ElasticEmailClient\Channel();
    148149            $error = null;
    149             $channelAdd= $channelAPI->Add($name);
     150            $channelAdd = $channelAPI->Add($name);
    150151        } catch (ElasticEmailClient\ApiException $e) {
    151152            $error = $e->getMessage();
     
    161162            $error = null;
    162163            $statusToSendEmail = $statusToSendEmailAPI->GetAccountAbilityToSendEmail();
    163             if(isset($statusToSendEmail['data'])) {
     164            if (isset($statusToSendEmail['data'])) {
    164165                update_option('elastic-email-to-send-status', $statusToSendEmail['data']);
    165166            }
     
    327328            __('From name (default empty):', 'elastic-email-sender'),
    328329            [$this, 'from_name_config_input'],
    329             'ee-settings', 'setting_section_id',
     330            'ee-settings',
     331            'setting_section_id',
    330332            [
    331333                'input_name' => 'ee_from_name_config',
     
    338340            __('Email FROM (default empty):', 'elastic-email-sender'),
    339341            [$this, 'from_email_config_input'],
    340             'ee-settings', 'setting_section_id',
     342            'ee-settings',
     343            'setting_section_id',
    341344            [
    342345                'input_name' => 'ee_from_email_config',
     346                'width' => 280
     347            ]
     348        );
     349
     350        add_settings_field(
     351            'ee_channel_name',
     352            __('Channel name:', 'elastic-email-sender'),
     353            [$this, 'channel_name_input'],
     354            'ee-settings',
     355            'setting_section_id',
     356            [
     357                'input_name' => 'ee_channel_name',
    343358                'width' => 280
    344359            ]
     
    385400            style="%s"
    386401        />',
    387             (isset($arg['width']) && $arg['width'] > 0) ? 'width:' . $arg['width'] . 'px' : '');
     402            (isset($arg['width']) && $arg['width'] > 0) ? 'width:' . $arg['width'] . 'px' : ''
     403        );
    388404    }
    389405
     
    398414            $value = $this->options[$arg['input_name']];
    399415        }
    400 
    401416        echo '<div class="ee-admin-settings-radio-block">
    402417               <div class="ee-admin-settings-radio-item">
     
    427442    public function emailtype_input($arg)
    428443    {
    429         if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
     444           if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
    430445            $type = 'marketing';
    431446            update_option('ee_send-email-type', $type);
     
    434449            update_option('ee_send-email-type', $type);
    435450        }
    436 
    437451        echo '
    438452                <div class="ee-admin-settings-radio-inline">
     
    465479        } else {
    466480            $mimetype = $this->options[$arg['input_name']];
    467             update_option('ee_mimetype',  $mimetype);
    468         }
    469 
     481            update_option('ee_mimetype', $mimetype);
     482        }
    470483        echo '
    471484                <div class="ee-admin-settings-radio-inline">
     
    529542    {
    530543        $valid = true;
     544
    531545        if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
    532546            $config_from_email = '';
     
    543557                $config_from_email = '';
    544558            }
    545            
     559
    546560            /**Adding filter  to override wp_mail_from field , if the option is checked */
    547561            if (get_option('ee_config_override_wooCommerce')) {
     
    563577
    564578    /**
     579     * Displays the settings channel name:
     580     */
     581    public function channel_name_input($arg)
     582    {
     583        if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
     584            $channel_name = 'Elastic Email Sender';
     585            update_option('ee_channel_name', 'Elastic Email Sender');
     586        } else {
     587            $channel_name = $this->options[$arg['input_name']];
     588            update_option('ee_channel_name', htmlspecialchars($channel_name));
     589        }
     590        echo '<input
     591                type="text"
     592                name="ee_options[' . $arg['input_name'] . ']"
     593                placeholder="' . __('Channel name', 'elastic-email-sender') . '"
     594                value="' . htmlspecialchars($channel_name) . '"
     595                style="width:' . $arg['width'] . 'px"
     596              />';
     597    }
     598
     599    /**
     600     * Display checkbox to  override WooCommerce email 'from' and 'fromName'
    565601     * Display checkbox to  override WooCommerce email 'from' and 'fromName'
    566602     */
     
    577613                <input
    578614                    type="checkbox"
    579                     name="ee_options['. $arg['input_name'] .']"
     615                    name="ee_options[' . $arg['input_name'] . ']"
    580616                    value="yes" ' . (($override === 1) ? 'checked' : '') . '
    581617                />
    582                 <span>'. __('WooCommerce fields "Email from" and " From name"', 'elastic-email-sender') .'</span>
     618                <span>' . __('WooCommerce fields "Email from" and " From name"', 'elastic-email-sender') . '</span>
    583619              </div>';
    584620    }
  • elastic-email-sender/trunk/class/ees_admin.php

    r3028738 r3028834  
    349349
    350350        add_settings_field(
    351             'ee_from_channel_name',
     351            'ee_channel_name',
    352352            __('Channel name:', 'elastic-email-sender'),
    353             [$this, 'from_channel_name_input'],
     353            [$this, 'channel_name_input'],
    354354            'ee-settings',
    355355            'setting_section_id',
    356356            [
    357                 'input_name' => 'ee_from_channel_name',
     357                'input_name' => 'ee_channel_name',
    358358                'width' => 280
    359359            ]
     
    409409    public function enable_input($arg)
    410410    {
    411         $select_mailer_input = $this->options[$arg['input_name']];
    412 
    413         if (!isset($select_mailer_input) || empty($select_mailer_input)) {
     411        if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
    414412            $value = 'no';
    415413        } else {
    416             $value = $select_mailer_input;
     414            $value = $this->options[$arg['input_name']];
    417415        }
    418416        echo '<div class="ee-admin-settings-radio-block">
     
    444442    public function emailtype_input($arg)
    445443    {
    446         $emailtype_input = $this->options[$arg['input_name']];
    447 
    448         if (!isset($emailtype_input) || empty($emailtype_input)) {
     444           if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
    449445            $type = 'marketing';
    450446            update_option('ee_send-email-type', $type);
    451447        } else {
    452             $type = $emailtype_input;
     448            $type = $this->options[$arg['input_name']];
    453449            update_option('ee_send-email-type', $type);
    454450        }
     
    478474    public function mimetype_input($arg)
    479475    {
    480         $mimetype_input = $this->options[$arg['input_name']];
    481 
    482         if (!isset($mimetype_input) || empty($mimetype_input)) {
     476        if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
    483477            $mimetype = 'auto';
    484478            update_option('ee_mimetype', $mimetype);
    485479        } else {
    486             $mimetype = $mimetype_input;
     480            $mimetype = $this->options[$arg['input_name']];
    487481            update_option('ee_mimetype', $mimetype);
    488482        }
     
    521515    public function from_name_config_input($arg)
    522516    {
    523         $from_name_input = $this->options[$arg['input_name']];
    524 
    525         if (!isset($from_name_input) || empty($from_name_input)) {
     517        if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
    526518            $config_from_name = '';
    527519            update_option('ee_config_from_name', null);
    528520        } else {
    529             $config_from_name = $from_name_input;
     521            $config_from_name = $this->options[$arg['input_name']];
    530522            update_option('ee_config_from_name', htmlspecialchars($config_from_name));
    531523
     
    549541    public function from_email_config_input($arg)
    550542    {
    551         $from_email_input = $this->options[$arg['input_name']];
    552543        $valid = true;
    553544
    554         if (!isset($from_email_input) || empty($from_email_input)) {
     545        if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
    555546            $config_from_email = '';
    556547            update_option('ee_config_from_email', null);
    557548
    558549        } else {
    559             $config_from_email = $from_email_input;
     550            $config_from_email = $this->options[$arg['input_name']];
    560551
    561552            if (filter_var($config_from_email, FILTER_VALIDATE_EMAIL)) {
     
    588579     * Displays the settings channel name:
    589580     */
    590     public function from_channel_name_input($arg)
    591     {
    592         $channel_name_input = $this->options[$arg['input_name']];
    593 
    594         if (!isset($channel_name_input) || empty($channel_name_input)) {
     581    public function channel_name_input($arg)
     582    {
     583        if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
    595584            $channel_name = 'Elastic Email Sender';
    596585            update_option('ee_channel_name', 'Elastic Email Sender');
    597586        } else {
    598             $channel_name = $channel_name_input;
     587            $channel_name = $this->options[$arg['input_name']];
    599588            update_option('ee_channel_name', htmlspecialchars($channel_name));
    600589        }
     
    614603    public function override_wooCommerce_input($arg)
    615604    {
    616         $override_woo_commerce_input = $this->options[$arg['input_name']];
    617         if (!isset($override_woo_commerce_input) || empty($override_woo_commerce_input)) {
     605        if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) {
    618606            update_option('ee_config_override_wooCommerce', 0);
    619607            $override = 0;
  • elastic-email-sender/trunk/elasticemailsender.php

    r3028738 r3028834  
    2222    /*
    2323     * Plugin Name: Elastic Email Sender
    24      * Version: 1.2.13
     24     * Version: 1.2.14
    2525     * Plugin URI: https://wordpress.org/plugins/elastic-email-sender/
    2626     * Description: This plugin reconfigures the <code>wp_mail()</code> function to send email using API (via Elastic Email) instead of SMTP and creates an options page that allows you to specify various options.
  • elastic-email-sender/trunk/readme.txt

    r3028738 r3028834  
    9090
    9191= 1.2.14 =
     92* Bug fixes and improved application performance
     93
     94= 1.2.13 =
    9295* Added custom channel name field
    9396
Note: See TracChangeset for help on using the changeset viewer.