You need to sign in to do that
Don't have an account?
Rahul Gautam 6
How to use SELECT Query in HTML E-Mail Template
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);
}
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);
}
you create visualforce page and use as new template.