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
Ken FernandesKen Fernandes 

Simple mail-merge in Salesforce

Hi all,

I already have a button on the Contract page layout that extracts a file (uploaded to Salesforce) with a certain name and allows the user to download or preview said file. 

My requirement is pretty straight-forward. I need to retrieve values from current Contract object and merge them at various locations in the extracted file. I am already able to retrieve these values, but am unable to get the mail-merge to work. I explored various options online and found a plethora of apps like DocuSign, Adobe Sign, S-Docs, etc. available for this purpose, but was hoping to use something native to Salesforce itself if possible since I am not doing any major formatting etc. with the data but simply inserting it into my file before displaying or emailing the final output to users.

Note: I already found 2 options in Salesforce for this purpose viz. single file mail-merge but this has been retired effective Feb '19 and extended mass mail-merge (which is an overkill for me anyway), but this is available only for account, contact and lead objects for some reason.

Any help here would be highly appreciated.

Best,
~Ken
PriyaPriya (Salesforce Developers) 

The developer community recommends providing any attempts/code you've started, any errors you're getting, or where exactly you're struggling in achieving this while posting a question.