| 开发者 | imeiie1231 |
|---|---|
| 更新时间 | 2026年10月24日 04:16 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
[hantarsms_otp_login] shortcode.hantarsms_otp_send() and hantarsms_otp_verify() in their own forms.{first_name}, {order_number}, {order_total} and {shop}.hantarsms_send_sms( $to, $text ) for developers, plus filters and actions to change messages and recipients.wp-config.php instead of the database:
define( 'HANTARSMS_API_KEY', 'sk_live_...' );Malaysian mobile numbers only (60 1X…). Numbers in other formats are skipped and shown as invalid before you send.
You pay HantarSMS per SMS segment, from RM0.20, from prepaid credit that does not expire. The plugin itself is free. One segment holds 156 characters of plain English, or 66 characters if the message contains Chinese, emoji or other special characters. The send screen shows the segment count and estimated cost before you confirm. See https://hantarsms.com/en/pricing.
No. Messages come from a shared, send-only short code (66886). That is why the plugin has an unsubscribe page, and why every message should start with your business name.
Yes. Under Malaysia's Personal Data Protection Act you need consent for direct marketing and must stop when someone asks. The plugin only sends campaigns to people who ticked the consent box (or to a list you confirm has consented), and always removes unsubscribed numbers. Order updates and OTP codes are not marketing.
Their number must be saved on their account: the "Mobile number (SMS)" field on the WordPress profile, or the WooCommerce billing phone. If two accounts share a number, SMS login is refused for that number.
Yes:
$sent = hantarsms_otp_send( $phone, 'my-form' );
$ok = hantarsms_otp_verify( $phone, $code, 'my-form' );
Both return true or a WP_Error. The purpose ('my-form') makes sure a code sent for one form cannot be used in another.
By default the plugin uses REMOTE_ADDR, because forwarded headers can be forged. If your server sees the proxy's address, return the real visitor IP with the hantarsms_client_ip filter.
The plugin log shows whether HantarSMS accepted each send. Per-number delivery results are in your HantarSMS console.