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
Noor FazliNoor Fazli 

Best approach to send email with attachment containing merge fields via Trigger

Hello Experts,

I'm rigorously trying to achieve some basic functinality which is when the value in a field is added,that why it needs to be sent via trigger  that we want to send the email with attachment of visualforce page pertaining to a particular id. Using getcontent is not a good idea so I opted for creating a site that send the attachment for the trigger, but to my surprise i'm getting no data and only static values are getting displayed in the attachment.

Any help would be appreciated.
Ajay K DubediAjay K Dubedi
Hi Noor,
Create a document. Document is an object type in salesforce.It will be creaed in a Folder. You can query folder id and then insert document to that folder using its id. The body of the document can be set as per the need, and this can be attached to the email.