Plugin Directory

Changeset 3126570


Ignore:
Timestamp:
07/27/2024 02:46:50 PM (8 months ago)
Author:
omykhailenko
Message:

Updating trunk

Location:
mailgun/trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • mailgun/trunk/CHANGELOG.md

    r3120706 r3126570  
    11Changelog
    22=========
     3
     42.1.0 (2024-07-27)
     5 - Added ability to suppress Track Clicks when we send Reset Password email (it was an issue with domain url in the email)
     6 - Added field to setup Reply-to(header) email for the emails.
     7 - When constants MAILGUN_TRACK_CLICKS, MAILGUN_TRACK_OPENS are used, we disable field on the UI as we do for other fields
    38
    492.0.1 (2024-07-17)
  • mailgun/trunk/includes/admin.php

    r3050593 r3126570  
    416416        $secure = (defined('MAILGUN_SECURE') && MAILGUN_SECURE) ? MAILGUN_SECURE : $this->get_option('secure');
    417417        $sectype = (defined('MAILGUN_SECTYPE') && MAILGUN_SECTYPE) ? MAILGUN_SECTYPE : $this->get_option('sectype');
     418        $replyTo = (defined('MAILGUN_REPLY_TO_ADDRESS') && MAILGUN_REPLY_TO_ADDRESS) ? MAILGUN_REPLY_TO_ADDRESS : $this->get_option('reply_to');
    418419
    419420        if (!$getRegion) {
     
    449450
    450451        try {
     452            $headers = [
     453                'Content-Type: text/plain',
     454                'Reply-To: ' . $replyTo,
     455            ];
     456
    451457            $result = wp_mail(
    452458                $admin_email,
     
    454460                sprintf(__("This is a test email generated by the Mailgun WordPress plugin.\n\nIf you have received this message, the requested test has succeeded.\n\nThe sending region is set to %s.\n\nThe method used to send this email was: %s.",
    455461                    'mailgun'), $region, $method),
    456                 ['Content-Type: text/plain']
     462                $headers
    457463            );
    458464        } catch (Throwable $throwable) {
  • mailgun/trunk/includes/options-page.php

    r3040805 r3126570  
    4646$mailgun_from_address = $mailgun_from_address_const ?: $this->get_option('from-address');
    4747
     48$mailgunReplyToAddressConst = ((defined('MAILGUN_REPLY_TO_ADDRESS') && MAILGUN_REPLY_TO_ADDRESS) ? MAILGUN_REPLY_TO_ADDRESS : null);
     49$mailgunReplyTo = $mailgunReplyToAddressConst ?: $this->get_option('reply_to');
     50
    4851$mailgun_secure_const = (defined('MAILGUN_SECURE') ? MAILGUN_SECURE : null);
    4952$mailgun_secure = !is_null($mailgun_secure_const) ? ((string)(1 * $mailgun_secure_const)) : $this->get_option('secure');
     
    5255$mailgun_use_api = !is_null($mailgun_use_api_const) ? ((string)(1 * $mailgun_use_api_const)) : $this->get_option('useAPI');
    5356$icon = $mailgun->getAssetsPath() . 'icon-128x128.png';
     57
     58$trackClicks = (defined('MAILGUN_TRACK_CLICKS') ? MAILGUN_TRACK_CLICKS : null);
     59$trackOpens = (defined('MAILGUN_TRACK_OPENS') ? MAILGUN_TRACK_OPENS : null);
     60
     61$suppressClicks = $this->get_option('suppress_clicks') ?: 'no';
    5462
    5563?>
     
    258266                </th>
    259267                <td>
    260                     <select name="mailgun[track-clicks]">
     268                    <select name="mailgun[track-clicks]" <?php echo $trackClicks ? 'disabled="disabled"' : '' ?>>
    261269                        <option value="htmlonly"<?php selected('htmlonly', $this->get_option('track-clicks')); ?>><?php _e('HTML Only', 'mailgun'); ?></option>
    262270                        <option value="yes"<?php selected('yes', $this->get_option('track-clicks')); ?>><?php _e('Yes', 'mailgun'); ?></option>
     
    281289                </th>
    282290                <td>
    283                     <select name="mailgun[track-opens]">
     291                    <select name="mailgun[track-opens]" <?php echo $trackOpens ? 'disabled="disabled"' : '' ?>>
    284292                        <option value="1"<?php selected('1', $this->get_option('track-opens')); ?>><?php _e('Yes', 'mailgun'); ?></option>
    285293                        <option value="0"<?php selected('0', $this->get_option('track-opens')); ?>><?php _e('No', 'mailgun'); ?></option>
     
    319327                </td>
    320328            </tr>
     329            <tr>
     330                <th scope="row">
     331                    <?php _e('Reply To Address', 'mailgun'); ?>
     332                </th>
     333                <td>
     334                    <input type="text"
     335                           class="regular-text"
     336                           name="mailgun[reply_to]"
     337                           value="<?php esc_attr_e($mailgunReplyTo); ?>"
     338                           placeholder="[email protected]"
     339                    />
     340                    <p class="description">
     341                        <?php
     342                        _e('Reply-to address', 'mailgun');
     343                        ?>
     344                    </p>
     345                </td>
     346            </tr>
    321347            <tr valign="top">
    322348                <th scope="row">
     
    377403                        );
    378404                        ?>
     405                    </p>
     406                </td>
     407            </tr>
     408            <tr valign="top">
     409                <th scope="row">
     410                    <?php _e('Suppress Click Track for password reset email', 'mailgun'); ?> <br>
     411                </th>
     412                <td>
     413                    <select
     414                            name="mailgun[suppress_clicks]">
     415                        <option value="yes"<?php selected('yes', $suppressClicks); ?>><?php _e('Yes', 'mailgun'); ?></option>
     416                        <option value="no"<?php selected('no', $suppressClicks); ?>><?php _e('No', 'mailgun'); ?></option>
     417                    </select>
     418                    <p class="description">
     419                        <span><?php _e('Experimental function', 'mailgun'); ?></span>
    379420                    </p>
    380421                </td>
  • mailgun/trunk/includes/wp-mail-api.php

    r3040805 r3126570  
    257257        ];
    258258
    259 
    260259        $rcpt_data = apply_filters('mg_mutate_to_rcpt_vars', $to);
    261260        if (!is_null($rcpt_data['rcpt_vars'])) {
     
    274273            $trackOpens = empty($mailgun['track-opens']) ? 'no' : 'yes';
    275274        }
     275
     276        if (isset($mailgun['suppress_clicks']) && $mailgun['suppress_clicks'] === 'yes') {
     277            $passwordResetSubject = __('Password Reset Request', 'mailgun') ?: __( 'Password Reset Request', 'woocommerce' );
     278            if (!empty($passwordResetSubject) && stripos($subject, $passwordResetSubject) !== false) {
     279                $trackClicks = 'no';
     280            }
     281        }
     282
    276283        $body['o:tracking-clicks'] = $trackClicks;
    277284        $body['o:tracking-opens'] = $trackOpens;
     
    397404        }
    398405
     406        $replyTo = (defined('MAILGUN_REPLY_TO_ADDRESS') && MAILGUN_REPLY_TO_ADDRESS) ? MAILGUN_REPLY_TO_ADDRESS : get_option('reply_to');
     407        if (!empty($replyTo)) {
     408            $headers['Reply-To'] = $replyTo;
     409        }
     410
    399411        // Set custom headers
    400412        if (!empty($headers)) {
  • mailgun/trunk/languages/mailgun-de_DE.po

    r1919013 r3126570  
    205205msgid "Save Changes"
    206206msgstr "Änderungen speichern"
     207
     208msgid "Reply-to address"
     209msgstr "Antwortadresse"
     210
     211msgid "Suppress Click Track for password reset email"
     212msgstr "Klick-Tracking für Passwort-Reset-Email unterdrücken"
  • mailgun/trunk/languages/mailgun-es_ES.po

    r1919013 r3126570  
    206206msgid "Save Changes"
    207207msgstr "Guardar cambios"
     208
     209msgid "Reply-to address"
     210msgstr "dirección de respuesta"
     211
     212msgid "Suppress Click Track for password reset email"
     213msgstr "Suprimir seguimiento de clics para el email de restablecimiento de contraseña"
  • mailgun/trunk/languages/mailgun-pt_BR.po

    r1919013 r3126570  
    364364msgid "http://www.mailgun.com/"
    365365msgstr ""
     366
     367msgid "Reply-to address"
     368msgstr ""
     369
     370msgid "Suppress Click Track for password reset email"
     371msgstr ""
  • mailgun/trunk/mailgun.php

    r3120706 r3126570  
    44 * Plugin URI:   http://wordpress.org/extend/plugins/mailgun/
    55 * Description:  Mailgun integration for WordPress
    6  * Version:      2.0.1
     6 * Version:      2.1.0
    77 * Requires PHP: 7.4
    88 * Requires at least: 4.4
  • mailgun/trunk/readme.md

    r3120706 r3126570  
    44Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller
    55Tags: mailgun, smtp, http, api, mail, email
    6 Tested up to: 6.5.5
    7 Stable tag: 2.0.1
     6Tested up to: 6.6.1
     7Stable tag: 2.1.0
    88License: GPLv2 or later
    99
     
    6767MAILGUN_TRACK_CLICKS Type: string Choices: 'yes' or 'no'
    6868MAILGUN_TRACK_OPENS  Type: string Choices: 'yes' or 'no'
     69MAILGUN_REPLY_TO_ADDRESS Type: string
    6970```
    7071
     
    131132
    132133== Changelog ==
     134
     135= 2.1.0 (2024-07-27): =
     136- Added ability to suppress Track Clicks when we send Reset Password email (it was an issue with domain url in the email)
     137- Added field to setup Reply-to(header) email for the emails.
     138- When constants MAILGUN_TRACK_CLICKS, MAILGUN_TRACK_OPENS are used, we disable field on the UI as we do for other fields
    133139
    134140= 2.0.1 (2024-07-17): =
  • mailgun/trunk/readme.txt

    r3120706 r3126570  
    44Contributors: mailgun, sivel, lookahead.io, m35dev, alanfuller
    55Tags: mailgun, smtp, http, api, mail, email
    6 Tested up to: 6.5.5
    7 Stable tag: 2.0.1
     6Tested up to: 6.6.1
     7Stable tag: 2.1.0
    88License: GPLv2 or later
    99
     
    130130== Changelog ==
    131131
     132= 2.1.0 (2024-07-27): =
     133- Added ability to suppress Track Clicks when we send Reset Password email (it was an issue with domain url in the email)
     134- Added field to setup Reply-to(header) email for the emails.
     135- When constants MAILGUN_TRACK_CLICKS, MAILGUN_TRACK_OPENS are used, we disable field on the UI as we do for other fields
     136
    132137= 2.0.1 (2024-07-17): =
    133138- Updated changelog
Note: See TracChangeset for help on using the changeset viewer.