How to create a custom email link that shares page title + url

Hello, @Pedro.

For create a link, which will share the content (current page) it is easier to use embed code, because it will need “onclick” attribute, which it reserved by internal Webflow code (you can’t use it in links attributes)

So just create link-block, give it class, style it. Then add embed code widget and paste this snippet.

`<a class="w-inline-block add-your-class-here" href="mailto:?subject=&amp;body=:%20" target="_blank" title="Email" onclick="window.open('mailto:?subject=' + encodeURIComponent(document.title) + '&amp;body=' +  encodeURIComponent(document.URL)); return false;">
</a>` 

Don’t forget to change “add-your-class-here” to the classname, that your link will have. When all stylings will be done you can delete Webflow link-block.

Cheers,
Anna

3 Likes