Forum Discussion
Storyline send email Javascript
Hi,
I've created a resource that generates an email after the user has selected a number of options. These options are numerous and fed into the email via separate variables. The problem is that the email is not being generated - as far as I can see there is nothing wrong with the JS code (attached). The code only works if I reduced the number of variables in the code, but then this would defeat the purpose of the resource. Any ideas?
https://360.articulate.com/review/content/2770bc88-98f8-4ff2-bb83-d9338cf20329/review
- MathNotermans-9Community Member
Try this...
Set a var for your body...
var myBody = "You selected: "+category1+..... your immense string
var mailto_link='mailto:'+useremail+'?subject='+subject+'&body='+ encodeURIComponent(myBody);
Changed it in your text file too... - JonnyCrookCommunity Member
Hi Math,
Thanks for your reply. I tried your code but unfortunately it did not generate an email.
My original code did work but only for up to 12 selections. ie. if 12 items were selected an email would be generated but if 13 items were selected no email would be generated.
Frustrating!
I'm open to further suggestions.
Thanks,
Jonny
- MathNotermans-9Community Member
Quite weird that your body string gets truncated at the 13th selection...aint there something else making it fail ? Maybe its just because its #13
As 13 is seen as bringing bad luck ;-)
Try skipping 13 and go for 14 ;-)