Share content by email, from a link

Here’s an up-to-date code that will allow you to share content from a website, by email.

Installing jQuery

Go to site settings > custom code > Head code and past the following :

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js" integrity="sha512-aVKKRRi/Q/YV+4mjoKBsE4x3H+BkegoM/em46NNlCqNTmUYADjBbeNefNxYV7giUp0VxICtqdrbqU7iVaeZNXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>

Save & publish

Adding required id’s

Add share-mail id to the element you want to click on

Adding the code into the page body

<script>
	$( document ).ready(function() {
		$("#share-mail").on("click", function(){
			location.href = 'mailto:[METTRE_TON_EMAIL]?subject=[METTRE_TON_SUJET]&body=[METTRE_TON_SLUG_ICI_AVEC_TON_TEXTE]';
		});
  });
</script>

The followin site is also useful to generate everything for the mailto.

https://mailtolinkgenerator.com/