You need to sign in to do that
Don't have an account?
![Ryan McNeely 1 Ryan McNeely 1](https://dfc-org-production.my.site.com/img/userprofile/default_profile_45_v2.png)
services/data/v43.0/sobjects/Document/
I simply want my company's logo to appear at the top of my Messaging.SingleEmailMessage
I tried referring to it as a Static Resource. It seems this is not possible in Apex.
So I tried saving the logo as a document and referencing it via Document.Body
This did not work though.
Please advise :)
I tried referring to it as a Static Resource. It seems this is not possible in Apex.
So I tried saving the logo as a document and referencing it via Document.Body
This did not work though.
Please advise :)
global static String buildMessageBody(String firstname, String bugName, String caseNumber, Boolean display) { String messageBody = '<html><body>'; messageBody = '<div style="margin: -40px 0px -20px 30px;"><img src="/services/data/v43.0/sobjects/Document/0152D000000xxxxxAG/Body" alt="abc" width="178" height="27" /></div>'; messageBody += '<p>Great news! ' + bugName + ' has been fixed. This bug relates to your Support Ticket: ' + caseNumber +'.</p>'; messageBody += 'Thank you<br/>'; messageBody += '</body></html>'; return messageBody; }
Refer below sample code
Refer below links.
https://salesforce.stackexchange.com/questions/46663/how-to-add-the-logo-in-email-body
https://help.salesforce.com/articleView?id=Why-images-stored-as-static-resources-cannot-be-seen-in-emails-sent-using-VF-email-templates-1327108316482&language=en_US&type=1
Please mark it as solved if my reply was helpful, it will make it available
for others as a proper solution.
Best Regards,
Sandhya