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
RockyMountainRockyMountain 

Messaging.sendEmail - setTemplateID with attachments as Documents

When trying to send an email from Apex using Messaging.sendEmail and setTemplateID....
 
If the email template has attachments that were originally loaded from the file system ('My Computer' option) they appear to be sent automatically without any additional coding.
 
If the template has attachments that are stored as a 'Document' within Salesforce, they are not sent.
 
Is there another setting that would fix this, or do the attachments have to be added manually by iterating over the documentAttachmentMap object (and is this object visible in Apex)? The documents are in a public folder and there aren't any restrictions on document visibility.
 
Thanks