Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clipboard functionality in email template

I want to send a coupon code in the email template. A Small button that will copy the content of a input element on the clipboard.

By email Template, i mean i want to send a email which will have a coupon code and there will be a button in the email template which will allow me to copy it to clipboard. Can this be done?

Any help will be appreciated.

Considering that javascript cannot be added inline to the email template, i couldnt think of any other solution.

like image 213
Rudresh Ajgaonkar Avatar asked Oct 09 '17 03:10

Rudresh Ajgaonkar


People also ask

How do I add copy to clipboard button on page?

Whether it is a sample of code or it is the User's own information, we can create a copy button to copy data to the clipboard using the navigator. clipboard. writeText() function. This function writes the data fed to it as a parameter into the clipboard.

How do I copy text to clipboard?

Copying Text to the ClipboardCTRL+C to copy. CTRL+X to cut. CTRL+V to paste.


1 Answers

Short answer is No - This feature would require Javascript.

Long answer - Yes (in a different way) - You could use unique query strings on the button URL (eg ?USER=1&COUPON_CODE=123) that way you could automatically carry the unique coupon code from the email to the landing page form field.

To do this you could assign each member in your database a unique coupon within the CSV file (or whatever you use) and set up a merge field within your ESP and use that to automatically create the strings. For example, your string would look like this when you code it href="http://www.yousite.com/?[%coupon%]" and your ESP will do the rest providing the database is set up correctly.

Hope that makes sense.

like image 52
Steve Avatar answered Sep 25 '22 18:09

Steve