mailto body parameters

Mailto links are used to redirect to an email address instead of a web page URL.

“mailto” typically can take any or all of these parameters:

  • subject - for the subject line

  • cc - for sending a carbon copy

  • bcc - for sending a blind carbon copy

  • body - for the message’s body text

However, I’ve begun to notice any “mailto” links out of a Wix site is only processing the subject parameter correctly. Is it a known limitation of Wix that setting a link URL via code to be limited to the email address and the subject parameters?

If I set any of the parameters other than the subject, it does not seem to encode the URL correctly. Resulting in any of the other parameters being ignored by the email client.

For example, this is a valid “mailto” string structure (I know because if I drop it into the browser’s address bar it works as expected), but if I set a button’s link property to this string, the body parameter will not pass to the email client properly.

linkURL = "mailto:?subject=Check this out!&body=You can see us here www.google.com";

$w("#myButton").link = linkURL;

My use case:
I’m building a “share” link on my site to allow visitors to share the page’s URL to various platforms (Social Media & Email). When sharing via email, the user should click the Share via Email button, be redirected to their email client, and the email’s subject and body be prefilled. With Wix, it will only allow me to prefill the subject and nothing more.

(1) Has anyone found a workaround to this?
(2) Wix - why does this limitation exist?

2 Likes

Try to use a text element and set a tag using the html property

YES - I found a workaround - Select ‘Add Element’ then select ‘Embed Code’ then ‘Embed HTML’

In the custom HTML field, I added my Mail Link (mailto) and ‘custom code’ that I got ChatGPT to write, just by asking it what I wanted.

How?

MAILTO Link: I created my custom mailto email link using a site called ‘mailtolinkgenerator’ which allowed me to add To, BCC, CC, Title, Body

THEN CUSTOM CODE from CHATGPT: Then I pasted the Mailto link into ChatGPT and asked it to code/design a link with link text, underlined, a button, with a specific colour, with round edges, and shadow to the button (so it looks more like a button) etc etc you get the idea. Design what you want in chatgpt and copy n paste the whole thing into Wix Embed Code .