| 开发者 | sendrail |
|---|---|
| 更新时间 | 2026年12月3日 20:49 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
The plugin is free. Sending SMS is charged by Sendrail per message segment from prepaid credit; there is no monthly fee.
Sendrail refuses the messages and they are not sent. Each affected order gets a note, and the WordPress administration shows a warning with the number of unsent messages until a message is accepted again or you hide it. The plugin sends no e-mail of its own: Sendrail e-mails the account owner when the credit runs low or runs out.
Create a test key (it starts with sr_test_) in the Sendrail dashboard, paste it into "Test API key" and switch on "Test mode". Messages go through all checks and appear in the order notes, but nothing is sent and nothing is charged.
One SMS segment holds 160 characters of the basic GSM alphabet. A single character outside it (for example Czech diacritics or an emoji) switches the message to Unicode with 70 characters per segment. Keep "Remove diacritics" switched on to avoid that.
The billing phone of the order (the shipping phone when there is none). A number without an international prefix gets the prefix of the billing country.
No. Each status is sent at most once per order, even when the status is switched back and forth, and when the same request reaches Sendrail again (for example after a timeout), Sendrail recognizes its idempotency key and returns the original message instead of sending it again. The idempotency key includes a random secret created by the plugin on your site, the site address and the order key of WooCommerce, so two shops whose order numbers repeat (a staging copy, a reinstalled or restored shop, test shops) do not share keys. A copy made with the same database and the same address shares the keys of the orders it copied: when the copy sends an SMS the original already sent, Sendrail returns the original message and nothing new is sent.
The plugin checks every answer of Sendrail. When Sendrail returns a message to another phone number than the one asked for (the key was already used for another message, typically by an older version of the plugin in another shop with the same address), the order gets a note saying so, and the plugin tries once more with a new key. When that answer does not fit either, or when Sendrail returns a new message to another number, the SMS is not tried again and the order note asks you to check the message in the Sendrail dashboard. When Sendrail returns a message to the same number that is older than the first attempt of this SMS (by more than five minutes, to allow for clock differences), the plugin does not send it again, because the customer already got a message under this key, and writes a note "not sent again" with the ID and time of that message. None of these cases is reported as a sent SMS. Since November 2026 Sendrail refuses a key that was already used for a different message (another number, text or message type) instead of returning that message. When the other message went to another number, the plugin notes it and tries once more with a new key, as above. When it went to the same number with another text, an earlier attempt of this SMS was most likely accepted before the text changed (for example the answer of Sendrail was lost, and a tracking link was added or the template edited before the automatic retry): the plugin writes a note "not sent again" and records the SMS as sent, so that the customer does not get it twice. Its text is in the Sendrail dashboard.
From the order meta written by shipping plugins: _wc_shipment_tracking_items, _tracking_number, _tracking_url and a few similar keys. Developers can supply their own value with the sendrail_sms_tracking_data filter.
The SMS is not sent and the order gets a note saying which variable was empty, so that no customer receives a text ending with "Tracking number:". Nothing is marked as sent: when the status is set again after the shipping plugin stored the number, the SMS goes out.
If the SMS should go out even without the value, put the part with the variable in square brackets, for example Your order {order_number} has been shipped.[ Tracking number: {tracking_number}.]. A part in brackets is sent only when all its variables have a value, otherwise it is left out; the brackets themselves are never sent. Square brackets without a variable inside are sent as they are.
Removed: all settings of the plugin, its records of recent webhook events, and its Action Scheduler history (queued, completed, failed and cancelled sending jobs, their log entries and the sendrail-sms group). When the webhook registered on a saved API key points to this site, it is removed at Sendrail too (a key shared with another site keeps its webhook).
Kept: the order notes the plugin wrote, and these order meta keys:
_sendrail_sms_log: the messages sent for the order, each with its Sendrail message ID, sending status, phone number and time._sendrail_sms_message_id: the Sendrail message IDs of the order._sendrail_sms_sending: the idempotency key and start time of a message whose sending is not finished yet (normally empty)._sendrail_sms_consent: the customer ticked the SMS consent checkbox in the classic checkout._wc_other/sendrail-sms/consent: the same checkbox in the block checkout (stored by WooCommerce).wp_ with your table prefix; skip the first command when the table wp_wc_orders_meta does not exist, that is when HPOS has never been switched on):
wp db query "DELETE FROM wp_wc_orders_meta WHERE meta_key IN ('_sendrail_sms_log', '_sendrail_sms_message_id', '_sendrail_sms_sending', '_sendrail_sms_consent', '_wc_other/sendrail-sms/consent')"
wp db query "DELETE FROM wp_postmeta WHERE meta_key IN ('_sendrail_sms_log', '_sendrail_sms_message_id', '_sendrail_sms_sending', '_sendrail_sms_consent', '_wc_other/sendrail-sms/consent')"
wp cache flush
The two DELETE statements work in any SQL client as well. Order notes are ordinary WooCommerce order notes and stay.
Deactivating the plugin removes nothing, so that it works again as before when it is activated again; Sendrail stops retrying calls to an inactive site after a few hours.
Either tick the option "Povolit správu webhooku přes API" (Allow webhook management through the API) at the API key in the Sendrail dashboard and press the button again, or open the key in the dashboard, paste the webhook URL shown in the plugin settings, then copy the signing secret from the dashboard into the "Signing secret" field and save.
Yes, both are supported and declared.
idempotency_key_reused). When the key was used for another number, the plugin notes it and tries once more with a new key. When it was used for the same number with another text (an earlier attempt accepted before a tracking link was added or the template edited), the SMS is recorded as sent earlier with an order note and never sent twice.