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
rohit.mehtarohit.mehta 

Use Letterhead in send mail

Hi,
 
Is there a way to programatically use the letterhead in sendmail api.
I cannot use the template as the email contains references to  multiple objects and have to create the email in my apex code.
 
I still need to retrieve the letterhead specified in an email template and use that programatically to send the mail.
 
 
 
thanks,
Rohit
Rasmus MenckeRasmus Mencke
If you send emails via the API and are using a template it will automatically include the letterhead.
rohit.mehtarohit.mehta
I am not using templates. I just need to get the letterhead and apply it to the email I am creating in my apex code.
 
Thanks,
Rohit
Rasmus MenckeRasmus Mencke
that is not possible in the API today, don't think this is something we are planning on exposing.
Kaushik_SupportKaushik_Support
Hey rasmus, Are the APIs to access letterhead available yet.? Actually i want to take a HTML template and make some changes in the body.and then send it using Messaging.singleEmailmessage class.but i am not sure about how to include the letterhead and also how to display the letterhead along with html email template in my VF page. Any pointers in this regard will be highly useful. Thanks, Ray
nickwick76nickwick76

Any news on this?

 

// Niklas

anil gattamanenianil gattamaneni
Hello Guys,

I have a same requirement where I am accessing the existing template body and subject in Apex code. Unfortunately I am not getting an option to get the template letter head some how.

Do we have any other way?
Yasar ShaikhYasar Shaikh
Try to user setTemplateId attribute.
 
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        EmailTemplate et=[SELECT id,name, subject,HtmlValue FROM EmailTemplate where name='xyz'];
        mail.setTemplateId(et.id);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });


Ivaylo DimovIvaylo Dimov
I have tried using the settemplateId, but it is still not bringing the letterhead. Has anyone worked on this solution?