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
Meredith Mitchell 8Meredith Mitchell 8 

Hello, I am trying to create a VF email template using Plain Text and my logo won't work. Please help :)

Everything is working but the logo. Here is what I have

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

<apex:image id="corevFg" value="https://c.na29.content.force.com/servlet/servlet.ImageServer?id=01534000001ttHb&oid=00D300000000JaW&lastMod=1488817441000" 
height="64" width="64"/>

{!$Label.lmscons__hello} {!recipient.FirstName},

{!$Label.lmscons__you_have_been_assigned_learning} {!relatedTo.lmscons__Learning_Path__r.Name} - {!relatedTo.lmscons__Learning_Path__r.lmscons__Description__c}.
{!$Label.lmscons__due_date_email_template} <apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!relatedTo.lmscons__Due_Date__c}"/></apex:outputText>.

You can log in using your portal credentials to Core Customer Community Portal that you have previously been assigned. Click on the My Training Tab to find your courses.

Thank you,
Core Security Training Team

If you have any questions or feedback regarding this course or any other course at Core Security, please email training@coresecurity.com

Your login is your email address. If you have forgotten your password, you can search your inbox for an email with your credentials or use the "forgot your password?" link on the login page.
</messaging:plainTextEmailBody>
</messaging:emailTemplate>
 
Lokesh KumarLokesh Kumar
HI Mitchell,

Change you image code accordingly by referring the below code.
 
<apex:image url="https://tapp0.salesforce.com/servlet/servlet.ImageServer?id=01570000000jmOe&oid=XXXXXXXXXXXXXXX"/>

Thanks !  
Meredith Mitchell 8Meredith Mitchell 8
That didn't work :( 


<apex:image url="https://c.na29.content.force.com/servlet/servlet.ImageServer?id=01534000001ttHb&oid=00D300000000JaW&lastMod=1488817441000"/>

Below is what it's returning...


User-added image
Lokesh KumarLokesh Kumar
HI Meredith,

As you are using <messaging:plainTextEmailBody > so it will not attach image to use an image you have to use <messaging:htmlEmailBody >.

Kindly check the below-working code for your above code.
 
<messaging:emailTemplate subject="{!$Label.lmscons__subject_content_assigned}" recipientType="User" relatedToType="lmscons__Learning_Path_Assignment__c" language="{!recipient.LanguageLocaleKey}">
<messaging:htmlEmailBody >
<html>
<HEAD></Head>
<Body>
<img src= "https://c.na29.content.force.com/servlet/servlet.ImageServer?id=01534000001ttHb&oid=00D300000000JaW&lastMod=1488817441000" 
height="64" width="64" alt="Logo"/>

{!$Label.lmscons__hello} {!recipient.FirstName},

{!$Label.lmscons__you_have_been_assigned_learning} {!relatedTo.lmscons__Learning_Path__r.Name} - {!relatedTo.lmscons__Learning_Path__r.lmscons__Description__c}.
{!$Label.lmscons__due_date_email_template} <apex:outputText value="{0,date,MM/dd/yyyy}"><apex:param value="{!relatedTo.lmscons__Due_Date__c}"/></apex:outputText>.

</Body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

let me know if this helps you !

Thanks !