Forum Discussion
Java Script for an e-mail
Hello everyone,
I am looking for a Java Script block for a ready-made e-mail with a subject and a text. So the learner clicks on a button in Storyline and then a prepared e-mail should open, so that one only have to send the e-mail without writing a text.
Does anyone have such a block and can help me with this?
Thanks a lot in advance!
Greetings, Hanna.
- DaanGroenCommunity Member
Does this work? (i'm also new to Javascript)
var subject = "Your email subject here";
var body = "Your email body text here";var mailtoLink = "mailto:?subject=" + encodeURIComponent(subject) + "&body=" + encodeURIComponent(body);
window.location.href = mailtoLink;
- HannaGebertCommunity Member
Hello Daan,
thank you so much for the script, it works!
- SBP_IncCommunity Member
Nice answer Daan.
One point worth noting for future readers - this code requires the learner's system to have an email application installed, so the code does require some testing