• Rahul Gautam 6
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
hi
I have a Email Template. I have edited the HTML version of templet and addedd a SELECT Query. This Query will fetch Data from a Custom Object. Custome Object has a Lookup Field on Contact.
When io run the Email Teplate, the SELECT code is diplay as it is. it is not Run.

Do i Need to writ the SELECT Quiery in some brackets? Can someone tell me the syntax for writing SELECT Query in HTML Email Template.

Dear Investors {!Contact.Name} .
<br>

{
Contact cnt =[Select ID From pba__Property__c where Title = 'Test Sale'];
if (cnt.size() > 0 && cnt.get(0).Body != null)
             {             
                 body = cnt.get(0).Body;
                 body = body.replace('#FieldAPIName#', recordValue);
                }
email.setPlainTextBody(body);
}
 
hi
I have a Email Template. I have edited the HTML version of templet and addedd a SELECT Query. This Query will fetch Data from a Custom Object. Custome Object has a Lookup Field on Contact.
When io run the Email Teplate, the SELECT code is diplay as it is. it is not Run.

Do i Need to writ the SELECT Quiery in some brackets? Can someone tell me the syntax for writing SELECT Query in HTML Email Template.

Dear Investors {!Contact.Name} .
<br>

{
Contact cnt =[Select ID From pba__Property__c where Title = 'Test Sale'];
if (cnt.size() > 0 && cnt.get(0).Body != null)
             {             
                 body = cnt.get(0).Body;
                 body = body.replace('#FieldAPIName#', recordValue);
                }
email.setPlainTextBody(body);
}