Email text fields

Hello Hypers!
I have created this example hype document that allows a user to enter their “thoughts” through a series of 3 scenes before allowing them to email all 3 to who they wish. Its working great except for 2 things:

  1. How can I include another unchanging email address to the email “to” field (that email won’t change but it would allow the email to go to 2 people)?
  2. The “thoughts” in the email body are not separated but just one long line of text. I have tried " \n" and “</ br>” and neither is working. How can I separate each thought on a new line?

Email ideas to oneself.zip (44.1 KB)

Any help would be much appreciated!

Technically there's not a 100% safe way to do this, but you should be able to just add a comma between email addresses (mailto:babs@example.com,jonathan@example.com?subject=...). If it is to always be the same you might instead want to use a more supported field like cc or bcc (mailto:babs@example.com?cc=jonathan@example.com&subject=...).

Use %0A for a newline:

 	win = window.location.href = "mailto:"+ mailto  + "?cc=jonathan@example.com?subject=report&body=" + "Thought 1" + x + "%0A" + "Thought 2" + y + "%0A" +  "Thought 3" + z

Thanks @Jonathan!

It basically works.
Only, now “?Subject” turns up in the cc field. I added an “&” so that it looks like this:
win = window.location.href = “mailto:”+ mailto + “?cc=babs@email.com&?subject=thoughts” + “&body=” + “Thought 1” + “%0A” + x + “%0A” + “%0A” + “Thought 2” + “%0A” + y + “%0A” + “%0A” + “Thought 3” + “%0A” + z

But now the subject line isn’t populated at all. Not a big deal - I can live without that.

You’ve got an extra question mark in there, which is the problem. When stringing together a URL, the first “argument” gets a question before it and everything else gets an ampersand.

It should be:

win = window.location.href = "mailto:"+ mailto + "?cc=babs@email.com&subject=thoughts" + "&body=" + "Thought 1" + "%0A" + x + "%0A" + "%0A" + "Thought 2" + "%0A" + y + "%0A" + "%0A" + "Thought 3" + "%0A" + z;