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

Autopopulating of email template



After clicking the 'create PDF' on the quote object, and then the 'save and email quote' button, I am taken to the task window where I can select an email template by clicking the 'select template' button. Is there a way to have a template pre populated automatically instead of me having to choose a template manually when i click the 'save and email quote button'.




You might need a custom button (On Quote layout) which fires off a visualforce page linked to a custom controller.  Call it "Create PDF and Email".  It will render the new PDF and save it.  Then send you to a custom visualforce page with the same email template edit screen but prepopulated with the email template contents.


You might be able to find an example like this on the web.


Other than that, you don't have any control over the "Save and Email Quote" button in the pop-up window.


You could also try a simple copy/paste of the email template body contents.  I've created a custom link before which throws information into the users clipboard.  Yours could say "Copy email template to clipboard".  It's javascript code which you define in the setup of the custom link.  Then they paste into the body and so on.  In the end it's only 1 or 2 less clicks though.


I'll get the javascript code if you think that might work.


Triggers are no good here since there are no objects to be updated/inserted until after the email is sent.


Thanks Mike.