Hi @midowpgm,
Sorry for the late reply.
I guess the parameter name is incorrect.
Since the custom parameter is “mail”, you have to use “mail” but you have used “mails”
[sc name="form" mail="${mailto1},${mailto2},${mailto3}"]
Please correct me if I have misunderstood.
Thanks,
Aakash
Thank you very much for your reply help
I have tried [sc name=”form” mail=”${mailto1},${mailto2},${mailto3}”]
But not the way i need
For example var mail=[“${mailto1}”,”${mailto2}”,”${mailto3}”]
The result of “mail.length” will be 3
If using [“${mailto1},${mailto2},${mailto3}”]
The result of “mail.length” will be 1
I need to apply the results obtained to the count to match the order in which the next mail is sent
Hi @midowpgm,
I guess you are expecting some kind of program execution, but shortcoder is not expected to do them.
If your shortcode content is “javascript” then you can perform such operations on the client/browser side.
In your case to use javascript you have to wrap the code by <script> tags like below and set it as shortcode content.
<script>
var mail=["${mailto1}","${mailto2}","${mailto3}"];
alert(mail.length);
</script>
Thanks,
Aakash
Thank you for your quick reply, this is the way I originally used
var c=url.searchParams.get(“count”);
c++;
document.getElementById(“count”).value = c;
var mailarray=[“${mail1}”,”${mail2}”,”${mail3}”,”${mail4}”,”${mail5}”];
var newarray=[];
newarray=mailarray.filter(d=>d);
if(newarray[c]){
document.getElementById(“nextmail”).value = newarray[c];
}
I hope to change to use
var c=url.searchParams.get(“count”);
c++;
document.getElementById(“count”).value = c;
var mailarray=[“%%mail%%”];
var newarray=[];
newarray=mailarray.filter(d=>d);
if(newarray[c]){
document.getElementById(“nextmail”).value = newarray[c];
}
Shortcode usage
[sc name=”next” mails=”${mail1}”,”${mail2}”,”${mail3}”,”${mail4}”,”${mail5}”]
Of course, my usage is wrong, I want to ask for your help, is it possible to use it in the shortcode
The number of ${mail1} is variable, maybe “${mail1}”,”${mail2}”,”${mail3}”,”${mail4}” maybe “${mail1}”,”${mail2}”
Hi @midowpgm,
The issue is the double quotes here.
Please wrap the ${mail} list with single quote like below.
[sc name=”next” mails=' ”${mail1}”,”${mail2}”,”${mail3}”,”${mail4}”,”${mail5}” ' ]
Thanks,
Aakash
Wow! So happy, I follow your instructions
[sc name=”next” mails=’ “${mail1}”,”${mail2}”,”${mail3}”,”${mail4}”,”${mail5}” ‘]
And also modified
var mailarray=[” %%mail%% “]; Change to var mailarray=[%%mail%%];
Solved my problem, thank you very much, this is really a great plugin, now I can use the shortcode more conveniently
Hi @midowpgm,
Happy that it helped you.
Please do rate the plugin. It will be really helpful !
Thanks,
Aakash
Of course, good plugins have been rated and recommended
-
This reply was modified 5 years, 4 months ago by
midowpgm.