1

Background

I would like to display the Community Url within a visualforce email template.

Standard templates use:

{!Community_Url}

But I cannot find an equivalent field for visualforce email templates.

Here is a simplified version of the email template:

<messaging:emailTemplate subject="Forgot Password"
    recipientType="User" relatedToType="Community">
    <messaging:htmlemailbody >

            <p>
                Dear {!recipient.Firstname },
            </p>

            <p>
            Your password has been reset for {!relatedTo.Name}. 
            </p>

            <p>
            Go to: {!$Network.NetworkUrlForUserEmails}
            </p>

    </messaging:htmlemailbody>
</messaging:emailTemplate>

Question

  1. What merge field can I use to create a link to the community?
2

I was working on a similar requirement some time back, where we had to send the reset password url for a community user.

If the Visualforce Email template you want to use, is defined under the Community Settings-->Adminstration, then using just {!$Network.NetworkUrlForUserEmails} should be good enough. If this doesn't helps you, then elaborate more on how exactly do you plan to use this template and what results do you see on using {!$Network.NetworkUrlForUserEmails}

<messaging:emailTemplate subject="forgotNew" 
    recipientType="Contact" 
    relatedToType="User"
    language="{!recipient.LanguageLocaleUser__c}"
    >
<messaging:htmlEmailBody >

<html>
<body>

    <a href = "{!$Network.NetworkUrlForUserEmails}" > Hereeee </a>

</body>
</html>



</messaging:htmlEmailBody>
</messaging:emailTemplate>

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.