function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
KruviKruvi 

Site fields in Email Template

Hello

 

I've been trying to figure this out for a while but with no luck.

 

I'm trying to add my SF Site URL to an email template.

When I select the available Site merge fields and use them in the email, the actual email I receive comes with empty/blank text e.g.. the Site's fields are not merged into the email.

 

Does anyone know how to include the Site's URL in an email template?

 

Many thanks

 

 

PaqsPaqs

Use HTML Tags with <a href="<youraddress>" notations. That should work for you.

 

Cheers,

KruviKruvi

Thanks

 

I'm not sure I have it right.

This is what I am using now in my email template and is not working

 

{!Site.UrlPathPrefix}/ChangeAccountPassword?id={!Account.Id}&ref={!Account.Reset_Token__c}

 How would use suggest I change it?

 

Many thanks

 

Oded

PaqsPaqs

Got it, sorry, i misread your question. What you want is to get the <youraddress> from my previous response.

 

In that case, that's a problem, you would have to go ahead and implement a custom outbound email controller class which allows you to have full cross-object access and the global variables like $Site.CurrentUrl and so on.

 

I already submitted an idea request for adding support for cross objects in email templates as well as access to global variables. It seems that SF did not put as much flexibility in their email templates as they did in other areas..

 

Refer to this to create your outbound email service class, with which you will be able to use those url fields as you do in any VF pages or Classes.

 

Hope this helps

KruviKruvi

Thanks a lot :-)

I hope your  idea will be accepted