Create a mailto: button that opens customers email account with a pre-populated email draft

Solved
Trevor-sami
Visitor
2 0 0

I want to have a button on our website that, when clicked, opens the customer's email client and has a pre-populated email draft that includes a PDF attachment. Not sure if this is possible but hoping 

Accepted Solution (1)
PaulNewton
Shopify Partner
5931 537 1241

This is an accepted solution.

Hi @Trevor-sami You cannot attach files to a mailto link that would be a major security no no on the internet.

But you can put a plain-text urls in mailto links , no html links  however.

https://stackoverflow.com/questions/247245/is-it-possible-to-add-an-html-link-in-the-body-of-a-mailt...

Though plain-text urls may not turn into a link depending on the users mail-client or preferences which you cannot control. Be sure to use "https://" for all such plain-text urls

 

To make a mailto link tons of generators online findable by research.

 

If you need the mailto link  to be dynamic such as changing email subject body, etc contents based on contexts such as the current product etc. there may be a few forum posts on the subject worth researching.

 

If you need a dynamic behaving mailto button built as a customization then contact me by mail for services.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Contact info in signature.

 

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


View solution in original post

Replies 2 (2)
PaulNewton
Shopify Partner
5931 537 1241

This is an accepted solution.

Hi @Trevor-sami You cannot attach files to a mailto link that would be a major security no no on the internet.

But you can put a plain-text urls in mailto links , no html links  however.

https://stackoverflow.com/questions/247245/is-it-possible-to-add-an-html-link-in-the-body-of-a-mailt...

Though plain-text urls may not turn into a link depending on the users mail-client or preferences which you cannot control. Be sure to use "https://" for all such plain-text urls

 

To make a mailto link tons of generators online findable by research.

 

If you need the mailto link  to be dynamic such as changing email subject body, etc contents based on contexts such as the current product etc. there may be a few forum posts on the subject worth researching.

 

If you need a dynamic behaving mailto button built as a customization then contact me by mail for services.
ALWAYS please provide context, examples: store url, theme name, post url(s) , or any further detail in ALL correspondence.
Contact info in signature.

 

Save time & money ,Ask Questions The Smart Way


Confused? Busy? Get the solution you need paull.newton+shopifyforum@gmail.com


Problem Solved? ✔Accept and Like solutions to help future merchants

Answers powered by coffee Buy Paul a Coffee for more answers or donate to eff.org


Trevor-sami
Visitor
2 0 0

Beautiful - I appreciate the information! I will look in to this further.