Plugin Directory

Changeset 3831985


Ignore:
Timestamp:
11/28/2026 06:28:09 PM (less than one hour ago)
Author:
nicunarcisbodea
Message:

SMSTunnel SMS for Contact Form 7 1.2.3: remove the 'Send SMS even if mail sending fails' option, which never changed anything; the notice links to the SMSTunnel plugin page

Location:
smstunnel-for-cf7
Files:
6 edited
1 copied

Legend:

Unmodified
Added
Removed
  • smstunnel-for-cf7/tags/1.2.3/languages/smstunnel-for-cf7.pot

    r3509574 r3831985  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: SMSTunnel for CF7 1.2.0\n"
     5"Project-Id-Version: SMSTunnel for CF7 1.2.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smstunnel-for-cf7\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-04-06T18:37:15+00:00\n"
     12"POT-Creation-Date: 2026-11-01T22:16:13+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    1717#. Plugin Name of the plugin
    1818#: smstunnel-cf7.php
    19 msgid "SMSTunnel for CF7"
     19msgid "SMSTunnel SMS for Contact Form 7"
    2020msgstr ""
    2121
    … …  
    2727#. Description of the plugin
    2828#: smstunnel-cf7.php
    29 msgid "Send SMS notifications via SMSTunnel when Contact Form 7 forms are submitted. Adds an SMS tab to CF7 editor similar to the Mail tab."
     29msgid "Send SMS notifications via SMSTunnel when Contact Form 7 forms are submitted. Adds an SMS tab to CF7 editor similar to the Mail tab. Optional end-to-end encryption."
    3030msgstr ""
    3131
    … …  
    4040msgstr ""
    4141
    42 #: smstunnel-cf7.php:112
     42#: smstunnel-cf7.php:114
    4343msgid "<strong>SMSTunnel CF7</strong> requires <strong>Contact Form 7</strong> to be installed and activated."
    4444msgstr ""
    4545
    4646#. translators: %s: URL to SMSTunnel plugin page
    47 #: smstunnel-cf7.php:124
     47#: smstunnel-cf7.php:126
    4848#, php-format
    4949msgid "<strong>SMSTunnel CF7</strong>: The SMSTunnel plugin is not active. SMS notifications will not be sent until you install and configure the <a href=\"%s\" target=\"_blank\">SMSTunnel</a> plugin."
    5050msgstr ""
    5151
    52 #: smstunnel-cf7.php:188
    53 #: smstunnel-cf7.php:217
     52#: smstunnel-cf7.php:156
     53msgid "Get it on Google Play"
     54msgstr ""
     55
     56#: smstunnel-cf7.php:167
     57msgid "You also need the SMSTunnel app on your phone."
     58msgstr ""
     59
     60#: smstunnel-cf7.php:232
     61#: smstunnel-cf7.php:261
    5462msgid "SMS"
    5563msgstr ""
    5664
    57 #: smstunnel-cf7.php:204
     65#: smstunnel-cf7.php:248
    5866msgid ""
    5967"New form submission:\n"
    … …  
    6371msgstr ""
    6472
    65 #: smstunnel-cf7.php:209
     73#: smstunnel-cf7.php:253
    6674msgid ""
    6775"Thank you for contacting us!\n"
    … …  
    7179msgstr ""
    7280
    73 #: smstunnel-cf7.php:222
     81#: smstunnel-cf7.php:266
    7482msgid "SMSTunnel plugin is not active."
    7583msgstr ""
    7684
    77 #: smstunnel-cf7.php:223
     85#: smstunnel-cf7.php:267
    7886msgid "Install and configure the SMSTunnel plugin to enable SMS notifications."
    7987msgstr ""
    8088
    81 #: smstunnel-cf7.php:232
     89#: smstunnel-cf7.php:278
    8290msgid "Send SMS notification when this form is submitted"
    8391msgstr ""
    8492
    85 #: smstunnel-cf7.php:241
     93#: smstunnel-cf7.php:287
    8694msgid "Recipient Phone Number(s)"
    8795msgstr ""
    8896
    89 #: smstunnel-cf7.php:249
     97#: smstunnel-cf7.php:295
    9098msgid "Enter phone number(s) in international format. Separate multiple numbers with commas."
    9199msgstr ""
    92100
    93 #: smstunnel-cf7.php:255
    94 #: smstunnel-cf7.php:318
     101#: smstunnel-cf7.php:301
     102#: smstunnel-cf7.php:357
    95103msgid "Message Body"
    96104msgstr ""
    97105
    98 #: smstunnel-cf7.php:261
     106#: smstunnel-cf7.php:307
    99107msgid "Use mail-tags to include form data. Maximum 1600 characters."
    100108msgstr ""
    101109
    102 #: smstunnel-cf7.php:266
    103 msgid "Additional Options"
     110#: smstunnel-cf7.php:314
     111msgid "The texts go out on every submission that passes the form's checks, even if the email fails."
    104112msgstr ""
    105113
    106 #: smstunnel-cf7.php:271
    107 msgid "Send SMS even if mail sending fails"
    108 msgstr ""
    109 
    110 #: smstunnel-cf7.php:280
     114#: smstunnel-cf7.php:319
    111115msgid "SMS (2)"
    112116msgstr ""
    113117
    114 #: smstunnel-cf7.php:283
     118#: smstunnel-cf7.php:322
    115119msgid "SMS (2) is an additional SMS template often used as an autoresponder to send a confirmation to the form submitter."
    116120msgstr ""
    117121
    118 #: smstunnel-cf7.php:290
     122#: smstunnel-cf7.php:329
    119123msgid "Use SMS (2)"
    120124msgstr ""
    121125
    122 #: smstunnel-cf7.php:299
     126#: smstunnel-cf7.php:338
    123127msgid "Recipient Phone Number"
    124128msgstr ""
    125129
    126 #: smstunnel-cf7.php:309
     130#: smstunnel-cf7.php:348
    127131msgid "Use a mail-tag like <code>[your-phone]</code> to send to the phone number from the form."
    128132msgstr ""
    129133
    130 #: smstunnel-cf7.php:324
     134#: smstunnel-cf7.php:363
    131135msgid "Confirmation message sent to the form submitter. Maximum 1600 characters."
    132136msgstr ""
    133137
    134 #: smstunnel-cf7.php:335
     138#: smstunnel-cf7.php:374
    135139msgid "Available mail-tags:"
    136140msgstr ""
    137141
    138 #: smstunnel-cf7.php:345
     142#: smstunnel-cf7.php:384
    139143msgid "Special tags:"
    140144msgstr ""
    141145
    142 #: smstunnel-cf7.php:556
     146#: smstunnel-cf7.php:587
    143147msgid "Your SMS has been sent successfully."
    144148msgstr ""
  • smstunnel-for-cf7/tags/1.2.3/readme.txt

    r3816067 r3831985  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.2.2
     7Stable tag: 1.2.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    159159== Changelog ==
    160160
     161= 1.2.3 =
     162* Removed: The "Send SMS even if mail sending fails" option. It never changed anything: the texts are sent before Contact Form 7 tries the email, so they already go out whether or not the email is sent. Nothing changes for your forms.
     163* Changed: The link in the "SMSTunnel plugin is not active" notice opens the SMSTunnel plugin page directly.
     164
    161165= 1.2.2 =
    162166* Added: The official Google Play badge for the SMSTunnel app, in the SMS tab, in the notice shown when the SMSTunnel plugin is not active, and in this plugin's row on the Plugins page.
  • smstunnel-for-cf7/tags/1.2.3/smstunnel-cf7.php

    r3776930 r3831985  
    11<?php
    22/**
    3  * Plugin Name: SMSTunnel for CF7
     3 * Plugin Name: SMSTunnel SMS for Contact Form 7
    44 * Plugin URI: https://smstunnel.io/integrations/contact-form-7
    55 * Description: Send SMS notifications via SMSTunnel when Contact Form 7 forms are submitted. Adds an SMS tab to CF7 editor similar to the Mail tab. Optional end-to-end encryption.
    6  * Version: 1.2.2
     6 * Version: 1.2.3
    77 * Author: SMSTunnel.io
    88 * Author URI: https://smstunnel.io
    … …  
    2323}
    2424
    25 define('SMSTUNNEL_CF7_VERSION', '1.2.2');
     25define('SMSTUNNEL_CF7_VERSION', '1.2.3');
    2626define('SMSTUNNEL_CF7_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2727define('SMSTUNNEL_CF7_PLUGIN_URL', plugin_dir_url(__FILE__));
    … …  
    4444
    4545    /**
    46      * Idempotency guards (per-request). CF7 fires multiple hooks
    47      * (before_send_mail, submit, mail_failed) which can each trigger a send;
    48      * these flags ensure each SMS is dispatched only once per submission.
     46     * Idempotency guards (per-request): each SMS is dispatched only once per submission.
    4947     */
    5048    private $sms_sent_for_submission = false;
    … …  
    8987        add_action('wpcf7_save_contact_form', array($this, 'save_sms_settings'), 10, 3);
    9088
    91         // Send SMS on form submission - multiple hooks for reliability
     89        // Send SMS on every valid submission. CF7 fires this before it tries the email,
     90        // so the texts go out whether or not the email is sent.
    9291        add_action('wpcf7_before_send_mail', array($this, 'send_sms_notification'));
    93         add_action('wpcf7_submit', array($this, 'send_sms_on_submit'), 10, 2);
    94 
    95         // Also hook into mail_failed for the "send on fail" option
    96         add_action('wpcf7_mail_failed', array($this, 'send_sms_on_mail_fail'));
    9792
    9893        // Override response when SMS succeeded but mail failed
    … …  
    130125                    /* translators: %s: URL to SMSTunnel plugin page */
    131126                    __('<strong>SMSTunnel CF7</strong>: The SMSTunnel plugin is not active. SMS notifications will not be sent until you install and configure the <a href="%s" target="_blank">SMSTunnel</a> plugin.', 'smstunnel-for-cf7'),
    132                     'https://smstunnel.io/wordpress'
     127                    'https://smstunnel.io/integrations/smstunnel/'
    133128                ),
    134129                array(
    … …  
    195190            'recipient' => '',
    196191            'body' => '',
    197             'send_on_fail' => false,
    198192        );
    199193
    … …  
    315309                    </td>
    316310                </tr>
    317                 <tr>
    318                     <th scope="row"><?php esc_html_e('Additional Options', 'smstunnel-for-cf7'); ?></th>
    319                     <td>
    320                         <label>
    321                             <input type="checkbox" name="smstunnel_sms_send_on_fail" value="1"
    322                                    <?php checked($sms['send_on_fail'], true); ?>>
    323                             <?php esc_html_e('Send SMS even if mail sending fails', 'smstunnel-for-cf7'); ?>
    324                         </label>
    325                     </td>
    326                 </tr>
    327311            </tbody>
    328312        </table>
     313        <p class="description">
     314            <?php esc_html_e('The texts go out on every submission that passes the form\'s checks, even if the email fails.', 'smstunnel-for-cf7'); ?>
     315        </p>
    329316
    330317        <!-- SMS (2) Section -->
    … …  
    421408        // Save SMS (1) settings
    422409        $sms = array(
    423             'active'       => isset($_POST['smstunnel_sms_active']) ? true : false,
    424             'recipient'    => isset($_POST['smstunnel_sms_recipient']) ? sanitize_textarea_field(wp_unslash($_POST['smstunnel_sms_recipient'])) : '',
    425             'body'         => isset($_POST['smstunnel_sms_body']) ? sanitize_textarea_field(wp_unslash($_POST['smstunnel_sms_body'])) : '',
    426             'send_on_fail' => isset($_POST['smstunnel_sms_send_on_fail']) ? true : false,
     410            'active'    => isset($_POST['smstunnel_sms_active']) ? true : false,
     411            'recipient' => isset($_POST['smstunnel_sms_recipient']) ? sanitize_textarea_field(wp_unslash($_POST['smstunnel_sms_recipient'])) : '',
     412            'body'      => isset($_POST['smstunnel_sms_body']) ? sanitize_textarea_field(wp_unslash($_POST['smstunnel_sms_body'])) : '',
    427413        );
    428414        update_post_meta($form_id, '_smstunnel_sms', $sms);
    … …  
    450436
    451437    /**
    452      * Send SMS on wpcf7_submit hook (backup for mail_failed with send_on_fail)
    453      */
    454     public function send_sms_on_submit($contact_form, $result) {
    455         // Skip if mail was sent (already handled by wpcf7_before_send_mail)
    456         if ($result['status'] === 'mail_sent') {
    457             return;
    458         }
    459 
    460         // Send SMS on mail failure if enabled
    461         if ($result['status'] === 'mail_failed') {
    462             $form_id = $contact_form->id();
    463             $sms = $this->get_sms_settings($form_id);
    464             if (!empty($sms['send_on_fail'])) {
    465                 $this->maybe_send_sms($contact_form);
    466                 $this->maybe_send_sms_2($contact_form);
    467             }
    468         }
    469     }
    470 
    471     /**
    472      * Send SMS notification when mail fails (if enabled)
    473      */
    474     public function send_sms_on_mail_fail($contact_form) {
    475         $form_id = $contact_form->id();
    476         $sms = $this->get_sms_settings($form_id);
    477 
    478         if (!empty($sms['send_on_fail'])) {
    479             $this->maybe_send_sms($contact_form);
    480         }
    481     }
    482 
    483     /**
    484438     * Actually send the SMS
    485439     */
    486440    private function maybe_send_sms($contact_form) {
    487         // Idempotency: CF7 fires several hooks per submission - only send once.
     441        // Idempotency: only send once per submission.
    488442        if ($this->sms_sent_for_submission) {
    489443            return;
    … …  
    524478        $recipients = array_filter(array_map('trim', explode(',', $recipient)));
    525479
    526         // Mark as handled for this submission (even if all recipients are invalid)
    527         // to preserve idempotency across CF7's multiple hooks.
     480        // Mark as handled for this submission (even if all recipients are invalid).
    528481        $this->sms_sent_for_submission = true;
    529482
  • smstunnel-for-cf7/trunk/languages/smstunnel-for-cf7.pot

    r3509574 r3831985  
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: SMSTunnel for CF7 1.2.0\n"
     5"Project-Id-Version: SMSTunnel for CF7 1.2.3\n"
    66"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/smstunnel-for-cf7\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
    … …  
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2026-04-06T18:37:15+00:00\n"
     12"POT-Creation-Date: 2026-11-01T22:16:13+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    1414"X-Generator: WP-CLI 2.12.0\n"
    … …  
    1717#. Plugin Name of the plugin
    1818#: smstunnel-cf7.php
    19 msgid "SMSTunnel for CF7"
     19msgid "SMSTunnel SMS for Contact Form 7"
    2020msgstr ""
    2121
    … …  
    2727#. Description of the plugin
    2828#: smstunnel-cf7.php
    29 msgid "Send SMS notifications via SMSTunnel when Contact Form 7 forms are submitted. Adds an SMS tab to CF7 editor similar to the Mail tab."
     29msgid "Send SMS notifications via SMSTunnel when Contact Form 7 forms are submitted. Adds an SMS tab to CF7 editor similar to the Mail tab. Optional end-to-end encryption."
    3030msgstr ""
    3131
    … …  
    4040msgstr ""
    4141
    42 #: smstunnel-cf7.php:112
     42#: smstunnel-cf7.php:114
    4343msgid "<strong>SMSTunnel CF7</strong> requires <strong>Contact Form 7</strong> to be installed and activated."
    4444msgstr ""
    4545
    4646#. translators: %s: URL to SMSTunnel plugin page
    47 #: smstunnel-cf7.php:124
     47#: smstunnel-cf7.php:126
    4848#, php-format
    4949msgid "<strong>SMSTunnel CF7</strong>: The SMSTunnel plugin is not active. SMS notifications will not be sent until you install and configure the <a href=\"%s\" target=\"_blank\">SMSTunnel</a> plugin."
    5050msgstr ""
    5151
    52 #: smstunnel-cf7.php:188
    53 #: smstunnel-cf7.php:217
     52#: smstunnel-cf7.php:156
     53msgid "Get it on Google Play"
     54msgstr ""
     55
     56#: smstunnel-cf7.php:167
     57msgid "You also need the SMSTunnel app on your phone."
     58msgstr ""
     59
     60#: smstunnel-cf7.php:232
     61#: smstunnel-cf7.php:261
    5462msgid "SMS"
    5563msgstr ""
    5664
    57 #: smstunnel-cf7.php:204
     65#: smstunnel-cf7.php:248
    5866msgid ""
    5967"New form submission:\n"
    … …  
    6371msgstr ""
    6472
    65 #: smstunnel-cf7.php:209
     73#: smstunnel-cf7.php:253
    6674msgid ""
    6775"Thank you for contacting us!\n"
    … …  
    7179msgstr ""
    7280
    73 #: smstunnel-cf7.php:222
     81#: smstunnel-cf7.php:266
    7482msgid "SMSTunnel plugin is not active."
    7583msgstr ""
    7684
    77 #: smstunnel-cf7.php:223
     85#: smstunnel-cf7.php:267
    7886msgid "Install and configure the SMSTunnel plugin to enable SMS notifications."
    7987msgstr ""
    8088
    81 #: smstunnel-cf7.php:232
     89#: smstunnel-cf7.php:278
    8290msgid "Send SMS notification when this form is submitted"
    8391msgstr ""
    8492
    85 #: smstunnel-cf7.php:241
     93#: smstunnel-cf7.php:287
    8694msgid "Recipient Phone Number(s)"
    8795msgstr ""
    8896
    89 #: smstunnel-cf7.php:249
     97#: smstunnel-cf7.php:295
    9098msgid "Enter phone number(s) in international format. Separate multiple numbers with commas."
    9199msgstr ""
    92100
    93 #: smstunnel-cf7.php:255
    94 #: smstunnel-cf7.php:318
     101#: smstunnel-cf7.php:301
     102#: smstunnel-cf7.php:357
    95103msgid "Message Body"
    96104msgstr ""
    97105
    98 #: smstunnel-cf7.php:261
     106#: smstunnel-cf7.php:307
    99107msgid "Use mail-tags to include form data. Maximum 1600 characters."
    100108msgstr ""
    101109
    102 #: smstunnel-cf7.php:266
    103 msgid "Additional Options"
     110#: smstunnel-cf7.php:314
     111msgid "The texts go out on every submission that passes the form's checks, even if the email fails."
    104112msgstr ""
    105113
    106 #: smstunnel-cf7.php:271
    107 msgid "Send SMS even if mail sending fails"
    108 msgstr ""
    109 
    110 #: smstunnel-cf7.php:280
     114#: smstunnel-cf7.php:319
    111115msgid "SMS (2)"
    112116msgstr ""
    113117
    114 #: smstunnel-cf7.php:283
     118#: smstunnel-cf7.php:322
    115119msgid "SMS (2) is an additional SMS template often used as an autoresponder to send a confirmation to the form submitter."
    116120msgstr ""
    117121
    118 #: smstunnel-cf7.php:290
     122#: smstunnel-cf7.php:329
    119123msgid "Use SMS (2)"
    120124msgstr ""
    121125
    122 #: smstunnel-cf7.php:299
     126#: smstunnel-cf7.php:338
    123127msgid "Recipient Phone Number"
    124128msgstr ""
    125129
    126 #: smstunnel-cf7.php:309
     130#: smstunnel-cf7.php:348
    127131msgid "Use a mail-tag like <code>[your-phone]</code> to send to the phone number from the form."
    128132msgstr ""
    129133
    130 #: smstunnel-cf7.php:324
     134#: smstunnel-cf7.php:363
    131135msgid "Confirmation message sent to the form submitter. Maximum 1600 characters."
    132136msgstr ""
    133137
    134 #: smstunnel-cf7.php:335
     138#: smstunnel-cf7.php:374
    135139msgid "Available mail-tags:"
    136140msgstr ""
    137141
    138 #: smstunnel-cf7.php:345
     142#: smstunnel-cf7.php:384
    139143msgid "Special tags:"
    140144msgstr ""
    141145
    142 #: smstunnel-cf7.php:556
     146#: smstunnel-cf7.php:587
    143147msgid "Your SMS has been sent successfully."
    144148msgstr ""
  • smstunnel-for-cf7/trunk/readme.txt

    r3816067 r3831985  
    55Tested up to: 7.1
    66Requires PHP: 7.4
    7 Stable tag: 1.2.2
     7Stable tag: 1.2.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    159159== Changelog ==
    160160
     161= 1.2.3 =
     162* Removed: The "Send SMS even if mail sending fails" option. It never changed anything: the texts are sent before Contact Form 7 tries the email, so they already go out whether or not the email is sent. Nothing changes for your forms.
     163* Changed: The link in the "SMSTunnel plugin is not active" notice opens the SMSTunnel plugin page directly.
     164
    161165= 1.2.2 =
    162166* Added: The official Google Play badge for the SMSTunnel app, in the SMS tab, in the notice shown when the SMSTunnel plugin is not active, and in this plugin's row on the Plugins page.
  • smstunnel-for-cf7/trunk/smstunnel-cf7.php

    r3776930 r3831985  
    11<?php
    22/**
    3  * Plugin Name: SMSTunnel for CF7
     3 * Plugin Name: SMSTunnel SMS for Contact Form 7
    44 * Plugin URI: https://smstunnel.io/integrations/contact-form-7
    55 * Description: Send SMS notifications via SMSTunnel when Contact Form 7 forms are submitted. Adds an SMS tab to CF7 editor similar to the Mail tab. Optional end-to-end encryption.
    6  * Version: 1.2.2
     6 * Version: 1.2.3
    77 * Author: SMSTunnel.io
    88 * Author URI: https://smstunnel.io
    … …  
    2323}
    2424
    25 define('SMSTUNNEL_CF7_VERSION', '1.2.2');
     25define('SMSTUNNEL_CF7_VERSION', '1.2.3');
    2626define('SMSTUNNEL_CF7_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2727define('SMSTUNNEL_CF7_PLUGIN_URL', plugin_dir_url(__FILE__));
    … …  
    4444
    4545    /**
    46      * Idempotency guards (per-request). CF7 fires multiple hooks
    47      * (before_send_mail, submit, mail_failed) which can each trigger a send;
    48      * these flags ensure each SMS is dispatched only once per submission.
     46     * Idempotency guards (per-request): each SMS is dispatched only once per submission.
    4947     */
    5048    private $sms_sent_for_submission = false;
    … …  
    8987        add_action('wpcf7_save_contact_form', array($this, 'save_sms_settings'), 10, 3);
    9088
    91         // Send SMS on form submission - multiple hooks for reliability
     89        // Send SMS on every valid submission. CF7 fires this before it tries the email,
     90        // so the texts go out whether or not the email is sent.
    9291        add_action('wpcf7_before_send_mail', array($this, 'send_sms_notification'));
    93         add_action('wpcf7_submit', array($this, 'send_sms_on_submit'), 10, 2);
    94 
    95         // Also hook into mail_failed for the "send on fail" option
    96         add_action('wpcf7_mail_failed', array($this, 'send_sms_on_mail_fail'));
    9792
    9893        // Override response when SMS succeeded but mail failed
    … …  
    130125                    /* translators: %s: URL to SMSTunnel plugin page */
    131126                    __('<strong>SMSTunnel CF7</strong>: The SMSTunnel plugin is not active. SMS notifications will not be sent until you install and configure the <a href="%s" target="_blank">SMSTunnel</a> plugin.', 'smstunnel-for-cf7'),
    132                     'https://smstunnel.io/wordpress'
     127                    'https://smstunnel.io/integrations/smstunnel/'
    133128                ),
    134129                array(
    … …  
    195190            'recipient' => '',
    196191            'body' => '',
    197             'send_on_fail' => false,
    198192        );
    199193
    … …  
    315309                    </td>
    316310                </tr>
    317                 <tr>
    318                     <th scope="row"><?php esc_html_e('Additional Options', 'smstunnel-for-cf7'); ?></th>
    319                     <td>
    320                         <label>
    321                             <input type="checkbox" name="smstunnel_sms_send_on_fail" value="1"
    322                                    <?php checked($sms['send_on_fail'], true); ?>>
    323                             <?php esc_html_e('Send SMS even if mail sending fails', 'smstunnel-for-cf7'); ?>
    324                         </label>
    325                     </td>
    326                 </tr>
    327311            </tbody>
    328312        </table>
     313        <p class="description">
     314            <?php esc_html_e('The texts go out on every submission that passes the form\'s checks, even if the email fails.', 'smstunnel-for-cf7'); ?>
     315        </p>
    329316
    330317        <!-- SMS (2) Section -->
    … …  
    421408        // Save SMS (1) settings
    422409        $sms = array(
    423             'active'       => isset($_POST['smstunnel_sms_active']) ? true : false,
    424             'recipient'    => isset($_POST['smstunnel_sms_recipient']) ? sanitize_textarea_field(wp_unslash($_POST['smstunnel_sms_recipient'])) : '',
    425             'body'         => isset($_POST['smstunnel_sms_body']) ? sanitize_textarea_field(wp_unslash($_POST['smstunnel_sms_body'])) : '',
    426             'send_on_fail' => isset($_POST['smstunnel_sms_send_on_fail']) ? true : false,
     410            'active'    => isset($_POST['smstunnel_sms_active']) ? true : false,
     411            'recipient' => isset($_POST['smstunnel_sms_recipient']) ? sanitize_textarea_field(wp_unslash($_POST['smstunnel_sms_recipient'])) : '',
     412            'body'      => isset($_POST['smstunnel_sms_body']) ? sanitize_textarea_field(wp_unslash($_POST['smstunnel_sms_body'])) : '',
    427413        );
    428414        update_post_meta($form_id, '_smstunnel_sms', $sms);
    … …  
    450436
    451437    /**
    452      * Send SMS on wpcf7_submit hook (backup for mail_failed with send_on_fail)
    453      */
    454     public function send_sms_on_submit($contact_form, $result) {
    455         // Skip if mail was sent (already handled by wpcf7_before_send_mail)
    456         if ($result['status'] === 'mail_sent') {
    457             return;
    458         }
    459 
    460         // Send SMS on mail failure if enabled
    461         if ($result['status'] === 'mail_failed') {
    462             $form_id = $contact_form->id();
    463             $sms = $this->get_sms_settings($form_id);
    464             if (!empty($sms['send_on_fail'])) {
    465                 $this->maybe_send_sms($contact_form);
    466                 $this->maybe_send_sms_2($contact_form);
    467             }
    468         }
    469     }
    470 
    471     /**
    472      * Send SMS notification when mail fails (if enabled)
    473      */
    474     public function send_sms_on_mail_fail($contact_form) {
    475         $form_id = $contact_form->id();
    476         $sms = $this->get_sms_settings($form_id);
    477 
    478         if (!empty($sms['send_on_fail'])) {
    479             $this->maybe_send_sms($contact_form);
    480         }
    481     }
    482 
    483     /**
    484438     * Actually send the SMS
    485439     */
    486440    private function maybe_send_sms($contact_form) {
    487         // Idempotency: CF7 fires several hooks per submission - only send once.
     441        // Idempotency: only send once per submission.
    488442        if ($this->sms_sent_for_submission) {
    489443            return;
    … …  
    524478        $recipients = array_filter(array_map('trim', explode(',', $recipient)));
    525479
    526         // Mark as handled for this submission (even if all recipients are invalid)
    527         // to preserve idempotency across CF7's multiple hooks.
     480        // Mark as handled for this submission (even if all recipients are invalid).
    528481        $this->sms_sent_for_submission = true;
    529482
Note: See TracChangeset for help on using the changeset viewer.