+ Start a Discussion

Visualforce - Copy standard EmailMessage Screen

Is there a way to mimic the standard EmailMessage Screen, to utilize templates, contact lookups, etc?


I'm looking for a way to create a new interface, so users can update related Cases while sending out and email, however, don't want to lose any of the existing functionality of the EmailMessage interface.

Cory CowgillCory Cowgill

I've done something similar where we overwrote the Email Message screen.


One problem your going to have is you can't easily replicate the Template Merge functionality.


For example, in the standard Email Message screen, you can select a template, and it automatically populates the email body with the merged template and records you've chosen. The user can then type in the email body some additonal text and send that to the distribution list.


If you try to recreate this in VF, you will find that there is no utility methods available to merge your records with the template data. You would have to write a utlity to merge your data manually, which is pretty crazy.


You can pass along the Template to the Email sender class, and it will merge the data then, but you love the overwrite ability. And it looks confusing to users when the preview shows things like {!contact.Name} in the body.


Thanks Cory - the template integration was one of my biggest worries, and sounds like much more work than I can invest at this time.


Thanks for your insight!