Adding a “Share by email” button on a website offers several advantages:
Facilitates sharing : The “Share by email” button allows users to easily share site content with friends, family, or colleagues via their inbox. This can be useful for disseminating important or interesting information.
Extend the reach : Email remains a very widespread means of communication, even in the age of social networks. By adding this sharing option, you are allowing your content to reach a wider audience that may not be active on social media.
Here's how to do it!
1. Add a trigger to your page
You can use any element (Div, Link, etc.).
2. Add the “email” id to it
3. Add this custom code
You can add it before <body>in your page or add an embed directly into your element.
<script>
// Fonction pour ouvrir un nouveau mail avec le lien de la page actuelle
function ouvrirNouveauMail() {
// Récupérer l'URL de la page actuelle
var url = window.location.href;`
`// Encodage de l'URL pour le corps du texte du mail
var encodedUrl = encodeURIComponent(url);`
`// Création du lien mailto avec le corps du texte
var mailtoLink = "mailto:?body=" + encodedUrl;`
`// Ouvrir un nouvel onglet avec le lien mailto
window.open(mailtoLink);
}`
`// Ajouter un écouteur d'événement au clic sur la div avec l'id "mail"
var mailDiv = document.getElementById("mail");
mailDiv.addEventListener("click", ouvrirNouveauMail);
</script>
Growth Marketer, Webflow expert and a jack of all trades. I take care of commercial operations, ensure the smooth running of projects and take care of issues related to marketing (SEO, Tracking, Copywriting, etc.)