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
Uves RavatUves Ravat 

PDF Content on Actual Email



Currently i am sending emails with PDF Attachments. The problem is the user cant edit PDF file so i wanted if possible to still send the PDF file but the data inside the PDF should be also show on the actual email. is that possible?


This is my current code


			Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage(); 
			// Reference the attachment page and pass in the account ID
			PageReference pdf =  Page.attachmentProposal;
			pdf.getParameters().put('id',(String)myProjectId );
			// Take the PDF content
			Blob b = pdf.getContent();
			// Create the email attachment
			Messaging.EmailFileAttachment efa = new Messaging.EmailFileAttachment();
			// Adddress
			String [] toAddresses = new String[] {address};
			// Sets the paramaters of the email 
			email.setSubject(subject );
			email.setToAddresses( toAddresses );
			email.setPlainTextBody('refer attached PDF :');
			email.setFileAttachments(new Messaging.EmailFileAttachment[] {efa});  
			Messaging.SendEmailResult [] r =   Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});   





I can think on 2 options:

1. There are PDF editor. Users can use them to edit the PDF.
2. Show the user VF page that allowed to insert all the data that the user might need to insert to the PDF.
Then add to this page button 'Create PDF', that will generate PDF file from the data that user insert.

Uves RavatUves Ravat

Thanks for the feedback.


I actually want the data to appear on email too, so they can change the what they want and send it back to me via email





There is an option to call email template via button (I didn't try, but heard that it's working),

so the button in the page might used to open the screen for selecting template & sending the email.