Create email link

Open to all! Ask other shopowners for help.
Post Reply
ramiroelliot
Posts: 1
Joined: Mon Feb 10, 2025 7:30 am
Phoenix Version:

Create email link

Post by ramiroelliot »

Hi everyone,

I want to create an email link to click on, how can I create it? I'm new, so the simpler the better. Thanks in advance!


Join The Code Co-op to get access to your library in the Code Co-op Forum
User avatar
mhsuffolk
Contributor
Posts: 199
Joined: Sat Oct 26, 2019 9:13 am
Phoenix Version: v1.1.0.6
Has thanked: 13 times
Been thanked: 11 times

Re: Create email link

Post by mhsuffolk »

Add mailto: to the front of the email thus
you@here.com
would be

Code: Select all

mailto:you@here.com
14Steve14
Senior Contributor
Posts: 922
Joined: Fri Oct 25, 2019 7:01 pm
Phoenix Version: v1.0.9.1
Has thanked: 17 times
Been thanked: 103 times

Re: Create email link

Post by 14Steve14 »

You can also include the subject line if you wish. Here is a link to a handy website that will explain other things that can also be added into the email links.

https://css-tricks.com/snippets/html/mailto-links/
heatherbell
Senior Contributor
Posts: 2540
Joined: Mon Oct 07, 2019 4:39 am
Phoenix Version:
Has thanked: 35 times
Been thanked: 243 times

Re: Create email link

Post by heatherbell »

ramiroelliot wrote: Tue Feb 11, 2025 2:29 am I want to create an email link to click on
Possibly better practice would be to link to contact_us.php to mitigate against bots and scrapers used for spamming.

Just sharing a quick tip here in case it becomes useful to others.

There can be times when publishing the store e-mail address in the store might be desired or required.
Using the STORE_OWNER_EMAIL_ADDRESS from the database or using just plain text to output the e-mail address can make it easy for scraper bots to collect it for bad reasons - spamming.

Instead of using:
example@domain.com
use:
example@domain.com
or
example<!-- HTML comment -->@<!-- HTML comment -->domain.com

Both of these will appear as example@domain.com to your customers but bots/scrapers will usually scrape the HTML and neither example&#64;domain&#46;com nor example<!-- HTML comment -->@<!-- HTML comment -->domain.com will reach your inbox!


Join The Code Co-op to get access to your library in the Code Co-op Forum
Post Reply