পণ্যের অংশে চলে যান
LCPanelলাইসেন্স সেন্টার প্যানেল

SMS ও WhatsApp

Admin → Configuration → SMS & WhatsApp: RT Communications ও Twilio থেকে বাংলাদেশি বাল্ক সার্ভিস ও যেকোনো HTTP ঠিকানা পর্যন্ত SMS গেটওয়ে, GREEN-API থেকে Meta Cloud API পর্যন্ত WhatsApp-এর পথ, ডিফল্ট কান্ট্রি কোড, যে গোপন কী আর দেখানো হয় না, টেস্ট পাঠানো, ব্যালেন্স চেক ও লগ।

প্লাগইন হালনাগাদ ৬ নভে ২০২৬ ২০ / ৫০

BoxPuff can send text messages: a short SMS through the gateway of your choice, or a WhatsApp message. The page that sets this up is Admin → Configuration → SMS & WhatsApp (/admin/messaging-settings), with one tab for each channel and a third, Templates, for the wording. Nothing is installed; the senders are part of the script. What uses them today is the Two-factor Sign-in plugin (sign-in codes and phone verification) and Newsletters (a campaign by SMS or WhatsApp), and any plugin of your own can send through the same functions.

Who it is for

Sites whose members would rather get a code on the phone than in an inbox, and sites in countries where bulk SMS is cheap and e-mail is not trusted - Bangladesh above all, which is why the list holds the local gateways. If you do not use phone codes you can leave the page alone: it costs nothing while it is off.

The SMS tab

Switch on Send messages by SMS, pick the Gateway, fill in the fields it shows (the page hides everything the chosen gateway does not need) and press Save.

GatewayWhat you fill in
RT Communications (rtcom.xyz)Account code / SID (the "acode" on their panel), API key, Sender (the sender they approved for you), Message type (Transactional: codes, notices or Promotional; promotional needs an approved Template ID and obeys the do-not-disturb hours), API address (leave https://api.rtcom.xyz unless they give you another). Bengali goes as unicode by itself.
TwilioAccount code / SID is the Account SID, API key / auth token is the Auth Token, Sender is the number (+1...) or a Messaging Service SID (MG...) to send from.
Vonage (Nexmo)API key, API secret, Sender (a number or an approved name).
BulkSMSBD, MIM SMS, ElitBuzz, MSG91API key and Sender (the Sender ID from their panel). The address of their API is built in.
Alpha SMS (sms.net.bd)The API key only; the sender is set on their side.
GreenwebThe token from their dashboard, typed in the API key box.
Any HTTP gateway (GET)Gateway URL with the placeholders {to}, {text}, {key}, {secret} and {sender}, plus the API key, API secret and Sender it uses. Any answer from 200 to 299 counts as sent.
Any HTTP gateway (POST)The same, plus Extra POST fields, one name=value per line with the same placeholders (for example to={to}); they are posted as a form.
Test only: write to the log, send nothingNothing. Every message is written to logs/messages.log and nothing reaches a phone. A good way to try the flow before you pay for a gateway.

Some gateways answer 200 even when they refuse the message. For the HTTP ones, and for the presets above, fill in The answer must contain with the word the gateway uses for success (for example SUCCESS); a reply without it is counted as failed and its first words are shown in the log.

Common fields:

  • Default country code (880) - written in front of local numbers. With 880, 01711111111 goes out as 8801711111111; a number typed with + or 00 is left as it is. Only digits are kept.
  • Hide sign-in codes in the log (on) - a six-digit code in a logged message shows as ******.
  • Keep the log for (days) - 30 by default, 1 to 365.

Secrets are never printed back. An API key, token or secret that is saved shows Saved, ends in ****1234. Leave empty to keep it; type - to remove it. Leaving the box empty keeps it; a single dash - removes it.

The WhatsApp tab

Choose How messages are sent.

WayWhat you fill in
Click-to-chat link (the default)Nothing. The site sends nothing by itself: where a message would go, a wa.me link is made for a person to click. Sign-in codes need one of the other ways.
GREEN-APIMake a free account at green-api.com, create an instance and scan its QR code with the sending phone. Then type the Instance id (idInstance), the API token instance and the API URL shown in their console (for example https://7103.api.greenapi.com).
Twilio WhatsAppAccount SID, Auth token and the WhatsApp number to send from (the sandbox number, +14155238886, works for tests).
Meta WhatsApp Cloud APIPhone number ID and a permanent Access token from developers.facebook.com. Outside the 24-hour window Meta delivers only approved templates: put the Template name of an approved template with one body variable and the message is sent as that variable; empty sends a plain text message. Template language (en_US) and Graph API version (v20.0) are there for the day Meta changes them.
Any HTTP gatewayGateway URL with {to}, {text} and {key}, the API key, and optional Extra POST fields (with any, the request is a POST). The answer must contain works as for SMS.
Test onlyWrites to logs/messages.log, sends nothing.

The Default country code and the log retention are on this tab too. A WhatsApp number must be one that is registered on WhatsApp; a number that is not simply fails at the gateway.

The Templates tab

The words of a message are not buried in code: Templates (/admin/messaging-settings?tab=templates) lists every text the site can send by SMS or WhatsApp, each one a row of the table bp_message_templates. The list shows the Message with its code and a Built-in or Custom tag, Sent by (SMS + WhatsApp, SMS only or WhatsApp only), the first words of the Text, whether it is Sent, and the buttons Edit, Preview and Reset (built-in) or Delete (custom). A fresh site fills the nine built-in ones the first time anybody opens the tab.

CodeNameIts wordsUsed by
twofa_codeSign-in code (two-step sign-in){code} {minutes} {username}the Two-factor Sign-in plugin, at sign-in
phone_verifyConfirm a phone number{code} {minutes} {username}the same plugin, when a member saves a number
newsletterNewsletter by SMS / WhatsApp{body} {unsubscribe} {username}the frame around a newsletter sent by phone
admin_testTest message (Messaging page){way}Send a test on the SMS and WhatsApp tabs, when you type no text
welcomeWelcome, after signing up{username} {link}ready for a plugin or your own code
password_resetPassword reset{username} {link}ready for a plugin or your own code
payment_confirmedPayment received{username} {amount} {package} {link}ready for a plugin or your own code
payment_rejectedPayment not accepted{username} {amount} {package} {link}ready for a plugin or your own code
file_sharedA file was shared with you{sender} {items} {link}ready for a plugin or your own code

The script itself sends the first four by phone. The last five are wordings kept ready: the matching e-mails still go out as before from E-mail templates, and nothing sends these five by SMS until a plugin or your own code does. A plugin or your own code sends one with sms_send_template($number, 'welcome', $words) or whatsapp_send_template(...).

Editing one (click its name):

  • Sent by and Sent - Sent off means this wording is not used; a sender that has a text of its own (the Two-factor plugin has two) falls back to it.
  • Message - plain text, no HTML, up to 1,000 characters. WhatsApp keeps line breaks and shows *bold*; on SMS the stars are dropped. Every message may use {site_name}, {site_url} and {year}; the box on the right lists the words you can use for this template - click one to put it at the cursor. A word the sender does not supply is left out. The older {site}, {n} and {name} of the Two-factor settings still work.
  • Live preview - a phone-style bubble for SMS (grey) and for WhatsApp (green), drawn with sample words and redrawn as you type, saved or not. For SMS it also says N SMS part(s), the number of characters, and whether the text is Plain letters (160 a part) or Unicode (70 letters a part) - one Bengali letter makes the whole message Unicode, so keep it short.
  • Save Template, Reset to original (built-in only) and Delete template (custom only).
  • Send a test of this template - a number and SMS or WhatsApp; the saved wording goes out with the sample words through the gateway on the matching tab, even while sending is switched off (so save first). The log shows it as Template test.

Add a template (below the list) takes a Name, Sent by and a Message (empty starts you with the site name). It gets the code custom_<name>, for example custom_summer_offer (a second one with the same name becomes custom_summer_offer_2), and the page says how to send it from code. Custom templates can be renamed, edited and deleted; the built-in ones can be edited and reset but not deleted.

Testing

The Send a test card on each tab takes a Number (with or without the country code) and an optional Message. Save first, then press Send Test: the test goes out even while sending is switched off. The answer is a green Sent to +8801711111111. or a red Sending failed: with the gateway's own words. On the click-to-chat way the failure comes with the wa.me link, so you can see what a person would have clicked.

Below the button the card says Ready: codes can be sent this way. or Not ready: nothing can be sent this way yet. - the same check the Two-factor plugin makes before it offers a channel.

Two more buttons appear when they apply:

  • Check the balance - RT Communications only: connects with your account code and key and prints the balance and the credit left.
  • Check the connection - GREEN-API only: tells you whether the instance is authorized, or why not (QR code not scanned, instance blocked or suspended, the phone offline). An instance whose QR code was never scanned accepts every message and sends none, so run this first.

The log

Under the cards, Last 50 messages lists each attempt with When, To, Message, Sent by (for example 2FA sign-in or Test message), Way (the gateway), Status (sent or failed, with the error under the message) and Time in milliseconds. Clear the log empties that channel's table. Old rows are also pruned by themselves after the retention period.

Tips

  • Write phone numbers with the country code and a plus sign when your members are abroad; local numbers are completed with the default country code.
  • An SMS is 160 characters of plain letters, but only 70 when it holds any Bengali or other non-Latin character, and long texts are split into parts that each cost a message. Keep sign-in messages short.
  • Put your own name for the service in twofa_code and phone_verify once; members then know a code is really from you.
  • Keep Hide sign-in codes in the log on: the log is read by every administrator.
  • Start with Test only: write to the log, check logs/messages.log, then change the gateway.
  • If a test fails, read the red message first: wrong keys, an unapproved sender and an empty balance are the usual causes. The log table above shows the reason under every failed attempt.
এটি কি কাজে লেগেছে?
এই অধ্যায়টি শেয়ার করুন