Forum Discussion
Using Javascript to trigger sending an email
That has worked a treat.
Can I ask one more question?
In the body of the email, ideally I want the question on one line , then the answer selected underneath..
How would I do that?
So say the first question in the example above is : Confirm Role.. the answer uses variable 'Role_Output'
If I can get one line done , I can duplicate it for the rest!
Thanks so much!
I confess I'm less sure for your implementation. The easy answer is that new lines can be created in strings of text using the \n "new line escape character." So if I had a variable foo and I assigned it the value '123\n456', it should print out as
123
456
I'm much less familiar with your encodeURIComponent function, but I expect your "var bodyContent =" assignment can fit in a new line escape between the two strings of text.
var bodyContent = getVar('Role_Question') + '\n' + getVar('Role_Output');
Related Content
- 1 year ago