0

I want to customise the functionality of the button Send An Email in the Activity History section of my Invoice object so all attached documents in the Notes and Attachments should be automatically added when EmailSending page is loaded.

I found out that the current version of Salesforce no longer allow to override /_ui/core/email/author/EmailAuthor so I have to use a different method. My solution is that I'll create a button named Send An Email with Attachment(s).

The button is linked to a page which is prosssed by a controller class. The page should have all controls that EmailAuthor have. And the controller class should function like the controller class that possessing EmailAuthor.

My question is : How can I clone the whole EmailAuthor page and its controller class so I can customise them? It looks like Salesforce hides the code of those files.

  • You are correct, the code is 'hidden'; duplicating the page's functionality will get tricky if you allow users to choose templates as rendering the template requires a hack using Savepoints and Rollback – cropredy Nov 25 '14 at 20:28
  • I'm still stuck. I would appreciate if anyone here helps me to hack or clone the code of EmailAuthor. That's the only way for me to customise the functionality in it. – php.dev.2014 Nov 26 '14 at 2:51
0

The basic outline of a solution is as follows

  1. Create a VF page with input components that match the ones you want to preserve from the OOB /EmailAuthor page. Lay it out as you wish with greater or lesser fidelity to the OOB EmailAuthor.
  2. Create a corresponding VF controller extension on Invoice__c. The controller will have properties bound to the VF page components
  3. When the user clicks 'Send', the controller will use Apex outbound email methods to send the email with the various Invoice__c attachments (these can be fetched using SOQL by the controller)

As I mentioned in the comment, if you want the user to be able to choose from different templates and have those templates previewed, consult this solution for how to do that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.