0

I'm new to this sales force platform.I'm facing the problem to call the email template in visual force page using iframe. my code look like this.

<apex:iframe
    id="previewFrame"
    title="HTML Preview" 
    src="https://{!sfdcBaseURL}.content.force.com/email/templaterenderer?id={!MailselectedTemplate.id}&recipient_type_id={!$User.Id}&related_to_id={!regid}&base_href=https://{!sfdcBaseURL}.salesforce.com&preview_frame=previewFrame&render_type=REPLACED_HTML_BODY&setupid=CommunicationTemplatesEmail"  
    frameborder="false"
    height="450"
    width="100%"/>

It's working in my Development org but I'm facing the problem in production org. I think it conflicts in sfdcBaseURL.

0

Instead of using the sfdcBaseURL, you can use the custom label where you store the production url and then use it in the source.

Or

You can use the URL.getSalesforceBaseUrl().getHost() function to get the host URL and set that to a variable and use the variable in the source

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.