top of page
Writer's pictureD.Khare

How to prepopulate To in Email Action of Activity for Opportunity and Account in Salesforce

Updated: Nov 4



In today’s fast-paced business world, time and accuracy are everything, especially regarding communication. Salesforce, a leading customer relationship management (CRM) platform, allows teams to send emails directly from records like Opportunities and Accounts. However, one common pain point is the need to manually enter email addresses in the "To" field every time an email is sent. Not only is this repetitive, but it also opens the door to errors—like sending emails to the wrong recipient.

The good news? Salesforce has a solution to simplify this process. With Quick Actions, you can prepopulate the "To" field in email actions, making sending emails faster and error-free. Let’s walk through how to set this up!


The Problem: Time-Consuming and Error-Prone Email Entries

Imagine you’re a sales representative working in Salesforce. Every day, you send numerous emails to key contacts linked to your Opportunities and Accounts. Each time, you must manually type in the email address or find the right contact in the record. It’s a small step, but it adds up—and worse, it increases the chances of accidentally sending emails to the wrong people.

This small inefficiency can make a big impact on your productivity and accuracy. So how do we make it easier?

Example Scenario

Our sales team frequently communicates with key contacts associated with Opportunities and Accounts directly from Salesforce. However, the process of manually entering email addresses in the "To" field each time an email is sent has proven to be time-consuming and prone to errors. To enhance efficiency and accuracy, we need a solution that will automatically populate the "To" field with the relevant contact’s email address when initiating an email from an Opportunity or Account record.


The Solution: Prepopulate the "To" Field with Quick Actions

Quick Actions in Salesforce are a great way to streamline repetitive tasks. With Quick Action, you can create a shortcut that automatically fills in certain fields, like the email recipient, saving you time and ensuring accuracy. Let’s take a look at how to set this up for both Opportunities and Accounts.


Step-by-Step Guide to Prepopulating the "To" Field

Here’s how you can configure Salesforce to automatically populate the "To" field when you send an email from an Opportunity or Account:

  1. Create an Email Field on the Opportunity (or Account) Object

    • The first step is to add a custom email field to the Opportunity (or Account) object. This field will store the email address you want to automatically populate in the "To" field.

    • Go to Setup > Object Manager > Opportunity (or Account) > Fields & Relationships.

    • Create a new email field, and make it required to ensure the field always contains a valid email address.

  1. Create a Quick Action for Sending Emails

    • Next, you need to create a Quick Action that will use this email field to automatically fill the "To" field in the email composer.

    • In the Object Manager, navigate to Buttons, Links, and Actions, and create a New Action.

    • Set the Action Type to Send Email and select your Target Object (either Opportunity or Account).

    • Name the action (e.g., "Send Opportunity Email").

  1. Remove the Standard Email Action

    • To ensure users are always using the new Quick Action, remove the standard Email action from the page layout.

    • Go to Page Layouts for Opportunity (or Account) and remove the default Email action.

  1. Set Predefined Values for the "To" Field

    • Now it’s time to tell Salesforce to use the email field you created earlier to prepopulate the "To" field.

    • In the Quick Action setup, go to the Predefined Field Values section.

    • Select To and set its value to the email field (e.g., {!Opportunity.Customer_Email__c}).

  1. Update the Page Layout

    • After configuring the Quick Action, go back to the Page Layouts for the Opportunity or Account.

    • Drag and drop the new Quick Action into the Salesforce Mobile and Lightning Experience Actions section.

    • Save the layout.

  1. Test the Action

    • Now, create a new Opportunity or Account record, or open an existing one. Make sure the email field you created is populated.

    • Click on your new Email Quick Action and check that the "To" field is automatically filled with the correct email address.


Bonus: Extend the Solution to Accounts

The same approach can be applied to the Account object. If you frequently send emails to contacts associated with Accounts, you can follow the same steps to create a Quick Action for Accounts that pulls email addresses from a related field.


Why This Solution?

This might seem like a small adjustment, but when you’re sending dozens of emails a day, it saves valuable time and minimizes human error. By prepopulating the "To" field in your email actions, you ensure consistency and reduce the likelihood of sending emails to the wrong recipient. Plus, it gives your sales team more time to focus on what matters most—closing deals!


Conclusion

Prepopulating the "To" field using Salesforce Quick Actions is a simple yet powerful enhancement that can make a big difference in your team’s efficiency and accuracy. And the best part? You don’t need any coding skills to set it up—just a few clicks in Salesforce’s setup menus.

So, why wait? Start implementing this today, and watch as your team’s email processes become faster and more streamlined!

If you'd like to see the code and resources used in this project, you can access the repository on GitHub. To access the AVENOIRBLOGS repository, click here. Feel free to explore the code and use it as a project reference.


Thank You! You can leave a comment to help me understand how the blog helped you. If you need further assistance, please contact us. You can click "Reach Us" on the website and share the issue with me.


Blog Credit:

D. Khare

   Salesforce Developer

   Avenoir Technologies Pvt. Ltd.

  Reach us: team@avenoir.ai

Reference

Comments


bottom of page