I have some custom fields on the Opportunity page layout; one captures the contact name and one is for the contact email. These are formula fields that query the contact roles related list. Once the fields are populated, I want to create a list view with Opportunities that have closed in the past 30 days and send out a mass email to them; don't want to automate this as I want to have the flexibility to deselect a few opportunities based on our discretion. How would I configure a custom button to send a mass email to those contacts at the respective contact email address and have the ability to select an email template which has fields mapped to the Opportunity record?


Here is how I would do it. Have a custom setting to store the email template ID or email template name on it. Whenever you need to change the template, you can change it.

Create a list button, and a Visualforce page. Let the controller behind the Visualforce pick the email template from the custom setting, the email address from the opportunity and fire the email.

Here is an example: https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_controller_sosc_custom_button.htm

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.