| 开发者 | imeiie1231 |
|---|---|
| 更新时间 | 2026年11月17日 19: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. Numbers verified at sign-up are saved automatically. If two accounts share a number, SMS login is refused for that number.
Yes. Turn on "Create an account automatically when a new number logs in with an SMS code". The customer types their number and the code, and is logged in to a new account (role: customer with WooCommerce, otherwise your default role, never an admin role). They can add an email address later in their account.
The number check is added to the standard WordPress registration form and the WooCommerce My Account registration form. Plugins that show the standard WordPress form (for example custom login page plugins) get it too. Plugins with their own form builders do not; for those, put the [hantarsms_otp_login] shortcode on your sign-up page with one-step sign-up turned on, or call hantarsms_otp_send() / hantarsms_otp_verify() from your form.
No. This is a WordPress plugin. Shopify stores can send SMS through the HantarSMS API.
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.