Scenario- When user registers through website(built with Django), his/her name, email address and activation link are temporarily stored in a custom object. The activation link is populated by Django and we are storing the same in a URL type field (Activation_Field__c) in Salesforce. An activation email should be sent to the user along with the activation link. I created a custom email template with HTML body. Issue: I tried with href="{!Custom_Object_Name__c.Activation_Field__c}" in button tag still the button is not clickable![enter image description here]1

How can I insert the merge field to be clickable link for button tag in email template?

P.S. I'm using Custom Email Template (without letterhead). So I don't have option of "insert link".

Edit- I want the functionality of anchor tag with look and feel of button tag. How do I achieve this?

  • 1
    Can you share the line of code that you have written. Something like this, i.e. link within <a> tag works for me: <a href="{!Custom_Object_Name__c.Activation_Field__c}"><img alt="Click Here to Confirm" src="yourImageLink" /></a> Oct 11 '17 at 5:52
  • @HemantJain here is the code straight from email template- <td align="center"><button type="button" href="{!Custom_Object_Name__c.Activation_Field__c}" style="padding: 13px 30px;background: #6f1cfa;color: #ffffff !important;border: none;font-size: 13px;border-radius: 2px;margin: 0 0 24px 0;letter-spacing: .06em;cursor: pointer;">CLICK TO CONFIRM</button></td> Oct 11 '17 at 6:12
  • 1
    Did you try using the anchor tag instead of button? Oct 11 '17 at 6:25
  • 1
    Please edit your post with any clarifications. That is not what comments are for, and code posted therein is not really readable.
    – Adrian Larson
    Oct 11 '17 at 6:28
  • @HemantJain Yes, I tried with <a> anchor tag and it works as intended. But i want the look and feel of a button. Oct 11 '17 at 6:30

Firstly, thanks all for the inputs.

I implemented the HTML anchor tag and styled it with some CSS to look like a button. Though, the underline of anchor link still appears!

I'm still welcome for suggestions to implement the merge field as clickable button in button tag to be used in email template :)

  • You can remove the underline in anchor link by <a href= 'given any reference link' style='text-decoration:none';/>.Removes your underline. Apr 24 '19 at 5:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.