Hello
I know how to make a global selection, and send sms to checked records, but I would like to put a free field in the body of the SMS, a text that can change, so a text that is not necessarily saved.
Ideally:
I tick my records
I click on SEND SMS
A POP UP window opens with the text to enter and presto we send..
I dream...
Send a SMS with text
Re: Send a SMS with text
Hi,
if you have your function ready to send the sms on a selected record, you can just add a popup with requesting the data you need to be entered. Once the users entered that data, pass it to the "SEND SMS" PHP in the url. Now you can use the data to fill the SMS.
something like:
if you have your function ready to send the sms on a selected record, you can just add a popup with requesting the data you need to be entered. Once the users entered that data, pass it to the "SEND SMS" PHP in the url. Now you can use the data to fill the SMS.
something like:
Code: Select all
function send_sms (table_name, id){
var url = 'send_sms.php?table=' + table_name;
var input = windowPrompt(message);
url = encodeURI(id) + '=' + encodeURIComponent(input);
window.open(url);
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: Send a SMS with text
hello
no work...
no work...
Code: Select all
function envoyer_sms(GES_SMS, ids){
/* in GES_SMS-tv.js
we'll open the mail labels page in a new window
that page is a server-side PHP script named mail-labels.php
but first, let's prepare the parameters to send to that script
*/
var url = 'envoyer_sms.php?table=' + GES_SMS;
var input = windowPrompt(message);
url = encodeURI(id) + '=' + encodeURIComponent(input);
window.open(url);
for(var i = 0; i < ids.length; i++){
url = url + '&'
+ encodeURI('ids[]') + '='
+ encodeURIComponent(ids[i]);
}
window.open(url);
}
Re: Send a SMS with text
Hi,
there is an error in the script:
This is just a sample. It will send one message for all selected id's. If you want to send per selected id a message, you need to amend the code an loop through the selected id's and create your url accordingly.
there is an error in the script:
Code: Select all
function envoyer_sms(GES_SMS, ids){
const message="Please enter data";
var text=window.prompt(message);
var url = envoyer_sms.php?table=' + GES_SMS + "&id="+encodeURI(ids)+"&text="+encodeURI(text);
window.open(url);
}
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.