Secure Email

How to Setup Bulk Secure Email Functionality from List View

This document explains how to configure and use the Bulk Secure Email functionality directly from a Salesforce List View. It provides step-by-step instructions on enabling the feature, selecting records, and sending messages to multiple recipients at once.

1. Introduction

The goal is to help users streamline outbound communication by leveraging list-based targeting—allowing teams to reach a broader audience efficiently without sending emails one at a time. This guide also covers configuration requirements, permissions, and best-practice recommendations to ensure Bulk Secure Email campaigns are accurate, compliant, and aligned with business communication needs.

2. Code Snippets to send Bulk Secure Emailure Email from List view

Below Code Snippets are for the Contact object. In order to configure on SObject please change the reference of Contact object with the relevant SObject.

2.1 Apex Controller

Click here to view the code
/**
* Copyright (C) Cloud Maven, Inc - All Rights Reserved
* Unauthorized copying of this file, via any medium, distribution and packaging is strictly prohibited
* Proprietary and confidential
* Written by Cloud Maven <support@cloudmaveninc.com>, December 2019
*/
global with sharing class SendBulkEmailActionController {
    public List<Contact> getIDs;
    public String contactIds{get;set;}    
    public Boolean showLoading {get;set;}
    
    
    public SendBulkSMSActionController(ApexPages.StandardSetController controller){
        showLoading = true;
        getIDs = controller.getSelected();
        contactIds = '';  
        for(Contact oContact : getIDs){
            contactIds += oContact.Id + ','; 
        }
        contactIds = contactIds.removeEnd(','); 
    }
    
    public void getLoadingValue()
    { 
       showLoading = false;
    }
}

2.2 Aura Application

Click here to view the code

Name: SendBulkActionListView

<aura:application access="GLOBAL" extends="ltng:outApp" >
    <aura:dependency resource="sendBulkSecureEmail"/>
</aura:application>

2.3 Visual Force Page

Click here to view the code

Name: SendSecureBulkEmails

<apex:page standardController="Contact" recordSetVar="cons" extensions="SendBulkEmailActionController">
    
    
    <apex:includeLightning /> 
    <div id="LightningComponentid" />
    <div id="sampleContainer">
        <style type="text/css">
            .redAlert {
            font-weight: bold;
            color: #FF0000;
            font-size : 22px;
            text-decoration: none;
            text-align : center;
            }
            
        </style>
        
         <apex:form >
             <apex:outputPanel id="tstpopup">
                 <apex:outputPanel rendered="{!showLoading}" >          
                     <center>
                         <apex:outputText styleClass="redAlert" value="LOADING..."/><br/>
                     </center>
                 </apex:outputPanel>
             </apex:outputPanel>
            
            <apex:actionFunction name="getLoading" action="{!getLoadingValue}" reRender="tstpopup"></apex:actionFunction>
        </apex:form>
        
        <script>
        var vfRetURLInSFX = '{!JSENCODE($CurrentPage.parameters.vfRetURLInSFX)}';
        console.log('vfRetURLInSFX' + vfRetURLInSFX);
        $Lightning.use("cmsecureemail:SendBulkActionListView", function() {
            $Lightning.createComponent("cmsecureemail:sendBulkSecureEmail",
                                       {
                                           //pass parameter values to lwc js controller
                                           listObjectIds : '{!JSENCODE(contactIds)}',
                                           messageType : 'Email',
                                           listViewURL: vfRetURLInSFX
                                       },
                                       "LightningComponentid",
                                       function(cmp) {
                                           getLoading();
	                                       console.log('LWC Componenet added in VF page');
                                       });
            
            });
        
        </script>
        
       
    </div>
</apex:page>

3. Create a ‘Send Bulk Secure Email’ button

  1. Click on the Gear (⚙️ ) icon and Go to Setup → Object manager

  2. Go to the Source Object → Button, Links and Actions

  3. Click on ‘New’ button or Link

  4. Enter the details as shown in below snapshot and Select the VF Page you have created

image-20251106-144423.png
  1. Click Save.


4. Add it to the List View Page Layout

  1. Click on the Gear (⚙️ ) icon and Go to Setup → Object manager

  2. Go to the Source Object → List View Button Layout

  3. Click on Edit of List View Edit

Screenshot 2025-11-06 at 11.11.50 AM.png
  1. Select Send Bulk Secure Email button from Available Buttons and add it to Selected Buttons.

  2. Click Save.

image-20251106-144738.png
  1. Navigate to the List View of the Source Object. You will see the ‘Send Bulk Secure Email’ button on the right hand side.

image-20251106-144902.png

5. Update Custom Metadata

  1. Click on the Gear (⚙️ ) icon and Go to Setup → Object manager → Search for Custom Metadata

  2. Click Manage against Email Configuration

  3. Select the entry with the Label that matches with the Source Object name.

  4. If there is no entry then create one:

  1. Enter the value for Bulk First Name and Bulk Last Name field. This is required at the time of validating if the Email field selected for sending Bulk Email has value or not. The UI will show separate list of Contact with valid and non valid Email addresses.

    1. Bulk First Name: This field stores the field on the Source Object that will give us the First name of the Customer.

    2. Bulk Last Name: This field stores the field on the Source Object that will give us the Last name of the Customer.

  2. Click Save.

In case we have list of records where email do not exists, the system will still allow you to send out Emails on the remaining Records.

Currently there is no fallback email field which could be used for sending the Secure Emails.


6. User Guide: How to Send Bulk Secure Emails from List View

How to Send Bulk Secure Email from List View