1

in here issue details:

Context: In our system we are sending Welcome Emails using the method System.resetPasswordWithEmailTemplate to customers in our Experience Cloud (community). When we tried to use relatedTo.Id or recipient.Id in the VF EmailTemplate, we cannot access to any of this fields, like the email has no context.

Expected: We can access to relatedTo.Id or recipient.Id merge fields.

Result: We cannot access to relatedTo nor recipient merge fields.

Template

<messaging:emailTemplate subject="{!$Label.AccountEMailWelcomeSubject}"
recipientType="User" relatedToType="Network" language="{!recipient.LanguageLocaleKey}">

<messaging:htmlEmailBody >
<c:EmailTemplate emailHeaderUrl="{!$Label.EmailHeaderImageWelcomeEmail}">
<c:EmailSalutation user="{!recipient.Id}"></c:EmailSalutation>
<c:EmailBody >
   <apex:outputText value="{!SUBSTITUTE($Label.AccountEMailWelcomeBody,'%CONFIRMATIONLINK%',$Network.NetworkUrlForUserEmails)+$Label.EmailRegards}" escape="false"></apex:outputText>
</c:EmailBody>
</c:EmailTemplate>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

We also tried changing the recipientType to Contact and the relatedToType to Contact and also both to User and Both to Contact. No success, even in some cases email was not triggered: https://trailblazer.salesforce.com/issues_view?id=a1p3A000001YpaxQAC&title=resetting-a-person-account-password-using-resetpasswordwithemailtemplate-and-visualforce-template-does-not-send-email-correctly

We have PersonAccount enabled in our system.

Thanks a lot for your time, any help is appreciated.

Your Answer

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

Browse other questions tagged or ask your own question.