Changeset 3028834
- Timestamp:
- 01/30/2024 12:36:53 PM (2 years ago)
- Location:
- elastic-email-sender
- Files:
-
- 4 edited
-
tags/v1.2.12/class/ees_admin.php (modified) (17 diffs)
-
trunk/class/ees_admin.php (modified) (8 diffs)
-
trunk/elasticemailsender.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
elastic-email-sender/tags/v1.2.12/class/ees_admin.php
r3028738 r3028834 14 14 */ 15 15 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; 19 19 public $theme_path; 20 20 … … 23 23 */ 24 24 public function __construct($pluginpath) 25 26 25 { 27 26 $this->theme_path = $pluginpath; … … 63 62 wp_register_style('eesender-css', $plugin_path . '/dist/ees_admin.min.css', '', 1.2, false); 64 63 65 wp_localize_script('eesender-send-test', 'ees_localize_data', 64 wp_localize_script( 65 'eesender-send-test', 66 'ees_localize_data', 66 67 [ 67 68 'adminUrl' => get_admin_url() … … 140 141 return; 141 142 } 142 143 143 144 public function addChannel($name) 144 145 { … … 147 148 $channelAPI = new \ElasticEmailClient\Channel(); 148 149 $error = null; 149 $channelAdd = $channelAPI->Add($name);150 $channelAdd = $channelAPI->Add($name); 150 151 } catch (ElasticEmailClient\ApiException $e) { 151 152 $error = $e->getMessage(); … … 161 162 $error = null; 162 163 $statusToSendEmail = $statusToSendEmailAPI->GetAccountAbilityToSendEmail(); 163 if (isset($statusToSendEmail['data'])) {164 if (isset($statusToSendEmail['data'])) { 164 165 update_option('elastic-email-to-send-status', $statusToSendEmail['data']); 165 166 } … … 327 328 __('From name (default empty):', 'elastic-email-sender'), 328 329 [$this, 'from_name_config_input'], 329 'ee-settings', 'setting_section_id', 330 'ee-settings', 331 'setting_section_id', 330 332 [ 331 333 'input_name' => 'ee_from_name_config', … … 338 340 __('Email FROM (default empty):', 'elastic-email-sender'), 339 341 [$this, 'from_email_config_input'], 340 'ee-settings', 'setting_section_id', 342 'ee-settings', 343 'setting_section_id', 341 344 [ 342 345 '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', 343 358 'width' => 280 344 359 ] … … 385 400 style="%s" 386 401 />', 387 (isset($arg['width']) && $arg['width'] > 0) ? 'width:' . $arg['width'] . 'px' : ''); 402 (isset($arg['width']) && $arg['width'] > 0) ? 'width:' . $arg['width'] . 'px' : '' 403 ); 388 404 } 389 405 … … 398 414 $value = $this->options[$arg['input_name']]; 399 415 } 400 401 416 echo '<div class="ee-admin-settings-radio-block"> 402 417 <div class="ee-admin-settings-radio-item"> … … 427 442 public function emailtype_input($arg) 428 443 { 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']])) { 430 445 $type = 'marketing'; 431 446 update_option('ee_send-email-type', $type); … … 434 449 update_option('ee_send-email-type', $type); 435 450 } 436 437 451 echo ' 438 452 <div class="ee-admin-settings-radio-inline"> … … 465 479 } else { 466 480 $mimetype = $this->options[$arg['input_name']]; 467 update_option('ee_mimetype', $mimetype); 468 } 469 481 update_option('ee_mimetype', $mimetype); 482 } 470 483 echo ' 471 484 <div class="ee-admin-settings-radio-inline"> … … 529 542 { 530 543 $valid = true; 544 531 545 if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) { 532 546 $config_from_email = ''; … … 543 557 $config_from_email = ''; 544 558 } 545 559 546 560 /**Adding filter to override wp_mail_from field , if the option is checked */ 547 561 if (get_option('ee_config_override_wooCommerce')) { … … 563 577 564 578 /** 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' 565 601 * Display checkbox to override WooCommerce email 'from' and 'fromName' 566 602 */ … … 577 613 <input 578 614 type="checkbox" 579 name="ee_options[' . $arg['input_name'] .']"615 name="ee_options[' . $arg['input_name'] . ']" 580 616 value="yes" ' . (($override === 1) ? 'checked' : '') . ' 581 617 /> 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> 583 619 </div>'; 584 620 } -
elastic-email-sender/trunk/class/ees_admin.php
r3028738 r3028834 349 349 350 350 add_settings_field( 351 'ee_ from_channel_name',351 'ee_channel_name', 352 352 __('Channel name:', 'elastic-email-sender'), 353 [$this, ' from_channel_name_input'],353 [$this, 'channel_name_input'], 354 354 'ee-settings', 355 355 'setting_section_id', 356 356 [ 357 'input_name' => 'ee_ from_channel_name',357 'input_name' => 'ee_channel_name', 358 358 'width' => 280 359 359 ] … … 409 409 public function enable_input($arg) 410 410 { 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']])) { 414 412 $value = 'no'; 415 413 } else { 416 $value = $ select_mailer_input;414 $value = $this->options[$arg['input_name']]; 417 415 } 418 416 echo '<div class="ee-admin-settings-radio-block"> … … 444 442 public function emailtype_input($arg) 445 443 { 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']])) { 449 445 $type = 'marketing'; 450 446 update_option('ee_send-email-type', $type); 451 447 } else { 452 $type = $ emailtype_input;448 $type = $this->options[$arg['input_name']]; 453 449 update_option('ee_send-email-type', $type); 454 450 } … … 478 474 public function mimetype_input($arg) 479 475 { 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']])) { 483 477 $mimetype = 'auto'; 484 478 update_option('ee_mimetype', $mimetype); 485 479 } else { 486 $mimetype = $ mimetype_input;480 $mimetype = $this->options[$arg['input_name']]; 487 481 update_option('ee_mimetype', $mimetype); 488 482 } … … 521 515 public function from_name_config_input($arg) 522 516 { 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']])) { 526 518 $config_from_name = ''; 527 519 update_option('ee_config_from_name', null); 528 520 } else { 529 $config_from_name = $ from_name_input;521 $config_from_name = $this->options[$arg['input_name']]; 530 522 update_option('ee_config_from_name', htmlspecialchars($config_from_name)); 531 523 … … 549 541 public function from_email_config_input($arg) 550 542 { 551 $from_email_input = $this->options[$arg['input_name']];552 543 $valid = true; 553 544 554 if (!isset($ from_email_input) || empty($from_email_input)) {545 if (!isset($this->options[$arg['input_name']]) || empty($this->options[$arg['input_name']])) { 555 546 $config_from_email = ''; 556 547 update_option('ee_config_from_email', null); 557 548 558 549 } else { 559 $config_from_email = $ from_email_input;550 $config_from_email = $this->options[$arg['input_name']]; 560 551 561 552 if (filter_var($config_from_email, FILTER_VALIDATE_EMAIL)) { … … 588 579 * Displays the settings channel name: 589 580 */ 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']])) { 595 584 $channel_name = 'Elastic Email Sender'; 596 585 update_option('ee_channel_name', 'Elastic Email Sender'); 597 586 } else { 598 $channel_name = $ channel_name_input;587 $channel_name = $this->options[$arg['input_name']]; 599 588 update_option('ee_channel_name', htmlspecialchars($channel_name)); 600 589 } … … 614 603 public function override_wooCommerce_input($arg) 615 604 { 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']])) { 618 606 update_option('ee_config_override_wooCommerce', 0); 619 607 $override = 0; -
elastic-email-sender/trunk/elasticemailsender.php
r3028738 r3028834 22 22 /* 23 23 * Plugin Name: Elastic Email Sender 24 * Version: 1.2.1 324 * Version: 1.2.14 25 25 * Plugin URI: https://wordpress.org/plugins/elastic-email-sender/ 26 26 * 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 90 90 91 91 = 1.2.14 = 92 * Bug fixes and improved application performance 93 94 = 1.2.13 = 92 95 * Added custom channel name field 93 96
Note: See TracChangeset
for help on using the changeset viewer.