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
CaitlinGMCaitlinGM 

Button to open email edit page

I'm currently using Javascript buttons with custom URLs to send emails based on templates. While I know this is unsupported and not recommended, it's great because it allows the user to access the edit page of the email to add any additional recipients on the fly and make changes to the content. 

 

It's not great because in order to work for templates using merge fields from standard objects, "Modify All Data" must be checked for the profile, which is becoming a security issue. 

 

So, I need to replace each Javascript button with an Apex class/VF button (and maybe another VF page?). I know how to write a class and button to just send an email to a set list of recipients, but that's not it, exactly. The problem is, I want to it do exactly what the Javascript does--open the send an email edit/preview page, allow the user to make changes, and *then* send the email, not just do it all behind the scenes. 

 

How can I accomplish this? Does it require some kind of custom Visualforce page replacing the standard email edit page? Or can I somehow get the standard page to open using Apex without encountering the system permissions issue I do with Javascript? Thanks.