Functional

Add a “Share by email” link in Webflow

tools :
Illustration croce

Table of contents

Introduction

Adding a “Share by email” button on a website offers several advantages:

  1. 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.
  2. 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.).

Webflow Tutoriel Email

2. Add the “email” id to it

Webflow Email ID Tutoriel

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>

4. Publish and test the result

Exemple tutoriel Webflow
Photo de l'auteur
Sandro D.
Published on
30/5/2024
Updated on
30/5/2024
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.)
Home
>
Gemeos Academy
>
Add a “Share by email” link in Webflow
These tutorials might interest you

Our tutorials in the same category

See all our tutorials
Illustration traits
We use the best tools

Your site is developed using the best tools and best practices

Gemeos doesn't just offer you a website, but expertise in the best tools to guarantee you the best possible return on your investment.

Figma

To design your custom website and optimize its conversion rate

Webflow

For pixel-perfect, optimized integration of your website

Client-first

Organizing your project to perfection

Wized

To add advanced features to your project

Make

Automate your workflows and save maximum time