You are on page 1of 29

MST Mass Email

User Guide

Copyright © 2014 MST Solutions. All rights reserved

MST Mass Email
Table of Contents
Overview ....................................................................................................................................................... 3
Installation .................................................................................................................................................... 4
Adding Mass Email button to Contacts List View ......................................................................................... 5
Sending emails using Mass Email Button:..................................................................................................... 7
Send Mass Email UI Elements: .................................................................................................................. 8
Email Template Selection:..................................................................................................................... 8
Email Processing Options: ..................................................................................................................... 8
Adding Mass Email button to Leads List View ............................................................................................ 10
Adding Mass Email button to Related List of Contacts: .............................................................................. 12
Mass email button in Contact listing in Account Page Layout ................................................................ 12
Adding Mass Email button to Campaign Layout ......................................................................................... 15
Mass Email Button for Custom Objects ...................................................................................................... 17
Contact/Lead having Lookup relation with the Custom object .............................................................. 17
Contact/Lead object having Many to Many relation with Custom object through Junction object. ..... 18
Adding Mass Email button for Contact having Lookup relation with Custom Object ................................ 19
Adding Mass Email button for Contact and Custom object having Many to Many relation ...................... 22
Setting up the Mass Email setting for the Mass Email button................................................................ 22
Creation of the Visualforce page for Mass Email UI for Custom object ................................................. 24
Creation of Mass Email button ............................................................................................................... 25
Assigning the Mass email button to the custom object detail page layout ........................................... 26
Application Package Component information ............................................................................................ 28
Object ...................................................................................................................................................... 28
Apex Classes ............................................................................................................................................ 28
Visualforce Pages .................................................................................................................................... 29
Visualforce Component .......................................................................................................................... 29
Tab .......................................................................................................................................................... 29
Buttons .................................................................................................................................................... 29

Copyright © 2014 MST Solutions. All rights reserved

2
|P a g
e

MST Mass Email
Overview
Salesforce provides mass email functionality for sending template based emails to leads
and contacts. This feature is available in Salesforce user interface. Salesforce also exposes this
functionality as Apex API for developers to consume in their custom development. Even though
this functionality is applicable to any contact and lead listing, Salesforce UI interface exposes
this functionality only to the Contacts and Leads home tab, resulting in users performing
multiple non-intuitive steps to send mass emails. Such draw backs are easily noticeable in cases
where there is no user interface available in campaign page for users to send mass emails to
contacts and leads by one click. So, our MST Mass Email package is built to ease such
drawbacks and to increase the productivity of agents.
MST Mass email package includes “Mass Email” buttons that salesforce administrator
can easily add to contact listing, lead listing, related Lists of Contact/Lead records , and
Campaign detail page layouts. This dynamic package also provides the flexibility of creating the
“Mass Email” button for custom objects e.g. Distribution List. All the above functionalities are
available to Professional Edition and beyond.
This user guide will provide step by step instructions for administrators to configure the
application for various use cases:





Adding Mass Email button to Contacts list view
Adding Mass Email button to Leads list view
Adding Mass Email button to related list of Contacts (e.g. Account page layout)
Adding Mass Email button to related list of Leads
Adding Mass Email button to Campaign object
Adding Mass Email button to custom distribution list object.

Note: This Application is not a new implementation for the Mass Email, but it provides
necessary enhancements to UI to make the Mass email functionality easy to use. The Governor
limits enforced by Salesforce to prevent misuse of mass email still holds good as this application
internally uses Salesforce Mass Email APIs.

Copyright © 2014 MST Solutions. All rights reserved

3
|P a g
e

MST Mass Email
Installation
MST Easy Mass Email application is a free application managed and supported by
MetaSoftTech Solutions (MST Solutions), and it is hosted on the Salesforce App Exchange.
Please follow the regular means of installing the application for your organization.

Copyright © 2014 MST Solutions. All rights reserved

4
|P a g
e

MST Mass Email
Adding Mass Email button to Contacts List View
Follow these simple steps to add Mass Email button to Contact listing.
1. Navigate to Setup > Customize > Contacts > Search Layouts
2. Click Edit “Contacts List View” layout
3. In the Contact List View page under Custom Button section, move the Mass Email

button from Available Buttons to Selected Buttons.

4. Click Save

Copyright © 2014 MST Solutions. All rights reserved

5
|P a g
e

MST Mass Email
Once the search layout is updated, all users using this layout will have access to the Mass email
button.

Repeat the same steps for “Search Results” view: Setup > Customize > Contacts > Search
Layouts > Edit “Search Results” layout to add the Mass Email button to the search results

Copyright © 2014 MST Solutions. All rights reserved

6
|P a g
e

MST Mass Email
Sending emails using Mass Email Button:
While various Mass Email buttons can be added to different views like Contact listing,
Campaign, Leads listing etc, but still a consistent UI is presented to users to gather the
information for sending the mass email. Upon clicking the Mass Email button, user is prompted
to select the template for sending the email as well to select values for some of the optional
settings that govern the mass email limits.
Note: When the mass email button is presented over list view or related list view, the user has to first
select the contacts/leads they wish to send the email by checking the checkbox next to the contact/lead
listing, before clicking the Mass email button.

Copyright © 2014 MST Solutions. All rights reserved

7
|P a g
e

MST Mass Email
Send Mass Email UI Elements:
The UI is designed to blend with the tabs and makes use of the theme associated with
the tab. e.g. mass emailing for campaign will use the Campaign tab theme. Information such as
the listing object name and number of recipients selected for mass email are presented at the
top of the UI to provide user enough information that were carried from the previous page.
Apart from those information, rest of the UI focuses on the information collected for sending
email.
Information collection part of the UI consists of two sections; first the email template
selection and the next the email processing Options.

Email Template Selection:

In Salesforce, email templates are stored under folders. To ease the email template
selection and to make sure the organization of email is followed consistently, the user has to
select the folder first and then select the email template available within that folder. The UI will
take care of presenting only the active template available.

Email Processing Options:

Options provided by Salesforce mass email APIs are presented in UI as various options:
1. BCC me on the message: Used for users to receive a BCC of email as received by the
email recipient.
2. Store an activity for each message: Used to create activities for the contacts or leads
mass emailed.
3. Use my signature: Used to append the user’s signature at the end of the email.
4. Mass email name: Name used to track the processing mass email job.

Detailed information for these options is available at
https://www.salesforce.com/us/developer/docs/apexcode/Content/apex_classes_email_outbo
und_base.htm#apex_classes_email_outbound_base

Copyright © 2014 MST Solutions. All rights reserved

8
|P a g
e

MST Mass Email

Copyright © 2014 MST Solutions. All rights reserved

9
|P a g
e

MST Mass Email
Adding Mass Email button to Leads List View
Adding Mass Email button for Lead listing is similar to adding button for Contact Listing.
1. Navigate to Setup > Customize > Leads > Search Layouts
2. Click Edit of “Leads List View”
3. Move the Mass Email button from Available Buttons to Selected Buttons.

4. Click Save

Copyright © 2014 MST Solutions. All rights reserved

10
|P a g
e

MST Mass Email
Once search layout is updated, all the users using the layout will have the access to Mass email
button.

Repeat the same for “Search Results” view: Setup > Customize > Leads > Search Layouts > Edit
the Search Results layout to add the Mass Email button.

Copyright © 2014 MST Solutions. All rights reserved

11
|P a g
e

MST Mass Email
Adding Mass Email button to Related List of Contacts:
Apart from the contact/lead listing pages, contact and lead lists are provided as related list
based on the relation the contact and lead objects have with other objects, example for such
scenario is contact listing in account detail page. The application provides an easier way for
adding Mass Email button to contact/lead related lists. The solution will work whether the
related object to contact/lead is a standard object or custom object. Following section provides
a step by step instruction for adding mass email button to contact listing in account page
layout. Same procedure applies for the lead listing and for custom related object.

Mass email button in Contact listing in Account Page Layout
1. Select the Account page layout used by the users for edit
a. Navigate to Setup > Customize > Accounts > Page Layouts
2. Click the Related Lists on the top left panel, move the Contacts from top right panel to
the layout, if it is not available in the layout, then hover over Related Lists – Contacts ,
and click Settings

Copyright © 2014 MST Solutions. All rights reserved

12
|P a g
e

MST Mass Email
3. In the Related list setting panel, expand accordion panel for Buttons
4. Move the Mass Email button from Available Buttons to Selected Buttons.

5. Click OK to close the related list settings
6. Click Save in Page Layout.

Copyright © 2014 MST Solutions. All rights reserved

13
|P a g
e

MST Mass Email
Once saved, all the users assigned to this page layout will see the Mass Email button in the
contacts related list on the account detail page.

Copyright © 2014 MST Solutions. All rights reserved

14
|P a g
e

MST Mass Email
Adding Mass Email button to Campaign Layout
The application comes pre-packaged with Mass Email button that can be added to the
Campaign detail view.
Follow these steps to add Mass Email button to the Campaign object.
1.
2.
3.
4.

Navigate to Setup > Customize > Campaigns > Page Layout
Edit the page layout
Click the Buttons on the top left panel.
You should see the Mass Email in the buttons list; now, drag and drop the Mass Email
button to the Custom Buttons section as shown below.

5. Save the page layout

Copyright © 2014 MST Solutions. All rights reserved

15
|P a g
e

MST Mass Email
All the users using the Campaign Page Layout will have access to the Mass Email button on the
campaign detail view. Upon clicking the Mass Email button, the application will select all the
members of the Campaign to send mass email and take the users to the UI defined in Sending
Mass Email section of this document.

Copyright © 2014 MST Solutions. All rights reserved

16
|P a g
e

MST Mass Email

Mass Email Button for Custom Objects
Custom object can have a list of contact or leads based on the relationship established between
contact/lead and custom object. There are two possible relationships:

Contact/Lead having Lookup relation with the Custom object
o One-to-many relationship: i.e. one custom object record is associated with many
contact/lead object
o E.g. Contact object having lookup relation with a custom object Team.

Copyright © 2014 MST Solutions. All rights reserved

17
|P a g
e

MST Mass Email
Contact/Lead object having Many to Many relation with Custom object through Junction
object.
o Many-to-many relationship: i.e. one custom object record is associated with
many contact/lead objects and vice versa.
o E.g. Distribution List Member has a master-detail relationship with contact
object and distribution object. In this case, the distribution list can have many
contacts and each contact can be part of many distribution lists.

Copyright © 2014 MST Solutions. All rights reserved

18
|P a g
e

MST Mass Email

Adding Mass Email button for Contact having Lookup relation with
Custom Object
The procedure for adding Mass email button to Contact related list in custom object page
layout is similar to adding Mass email button in Contact listing in Account Page Layout
1. Select the Account page layout used by the users for edit
a. Navigate to Setup > Create > Objects
b. Select the custom object
c. Go to Page Layouts sections and edit the page layout
2. Select Related Lists from the top left panel, hover over to Related Lists – Contacts , and
click Settings

Copyright © 2014 MST Solutions. All rights reserved

19
|P a g
e

MST Mass Email
3. In the Related list setting panel, expand accordion panel for Buttons
4. Move the Mass Email button from Available Buttons to Selected Buttons.

5. Click OK to close the Related List settings
6. Click Save in Page Layout.

Copyright © 2014 MST Solutions. All rights reserved

20
|P a g
e

MST Mass Email
Once saved, all the users assigned to this page layout will see the Mass Email button in the
Contacts Related list on the Account detail page.

Copyright © 2014 MST Solutions. All rights reserved

21
|P a g
e

MST Mass Email

Adding Mass Email button for Contact and Custom object having Many
to Many relation
Setting up the Mass email button in this scenario is similar to adding the mass email for the
campaign object. Since the object involved is a custom object, set up involves creation of the
Mass Email button for the custom object using the framework provided within the application
and then assigning the button to the layout.
Following admin steps are involved:
1.
2.
3.
4.

Setting up the Mass Email setting for the Mass Email button
Creation of the Visualforce page for Mass Email UI for Custom object
Creation of Mass Email Button
Assigning the Mass email button to the custom object detail page layout

The above steps were illustrated using the Junction object relationhip, as defined in previous
section.

Setting up the Mass Email setting for the Mass Email button
1. Click tab MST Mass Email Settings
2. In the “Settings Update” section, enter the following:
Provide a setting name e.g. DistributionListSettings
Object name – Select the junction object name (e.g. Distribution_List_Memeber__C)
Enable search filter
Search field- Choose your custom object (Master object) field (e.g. Distribution_List__c)
Contact/Lead Field - choose your Contact/Lead object (Master object) field (e.g.
Contact__c)

Copyright © 2014 MST Solutions. All rights reserved

22
|P a g
e

MST Mass Email

3. Click Save. The UI is updated to reflect the newly added settings.

Copyright © 2014 MST Solutions. All rights reserved

23
|P a g
e

MST Mass Email
Creation of the Visualforce page for Mass Email UI for Custom object
1.
2.
3.
4.
5.
6.

Navigate to Setup > Develop > Pages Click New
Provide Label and name for your page e.g. DistributionListMassEmailPage
Copy the code provided below
Change object name with your custom object name
Change setting name with the value your had created in previous section.
Save

<apex:page standardController="DistributionList__c" extensions="MSTMassEmail.MassEmailController">
<apex:pageMessages />
<MSTMassEmail:MassEmailComponent Setting="DistributionListSettings"/>
</apex:page>

Copyright © 2014 MST Solutions. All rights reserved

24
|P a g
e

MST Mass Email
Creation of Mass Email button
1.
2.
3.
4.
5.
6.
7.
8.
9.

Navigate to Setup > Create > Objects
Select your custom object
Go to “Buttons, Links, and Actions” Section click “New Button or Link”
Enter Mass Email as Label
Select “Detail Page Button”
In the Behavior dropdown, select “Display in existing window with sidebar”
For Content Source, select “Visualforce page”
In the Content drop down, select the Visual force page created in the previous section.
Save

Copyright © 2014 MST Solutions. All rights reserved

25
|P a g
e

MST Mass Email

Assigning the Mass email button to the custom object detail page layout
Follow these steps to add Mass Email button to the Campaign object.
1.
2.
3.
4.
5.
6.

Navigate to Setup > Create > Objects
Select your custom Object
Go to Page Layout Section
Edit the page layout
Select the Buttons from the top left panel.
You should see the Mass Email in the buttons list. Now, drag and drop the Mass Email
button to the Custom Buttons sections of the layout.

7. Save the page layout

Copyright © 2014 MST Solutions. All rights reserved

26
|P a g
e

MST Mass Email
All the users assigned with this page layout now will have access to the Mass email
button. When the user clicks the Mass Email button, the UI will be presented to send
mass email to all the contacts associated with the custom object record.

Copyright © 2014 MST Solutions. All rights reserved

27
|P a g
e

MST Mass Email

Application Package Component information
The Application package consists of following components:

Object
Name
MST Mass Email Setting

Description
This object is used to store the Mass Email
settings used by the Campaign Mass Email as
well as for Custom object having many-tomany relation with the contact/lead
As part of the package entry for campaign
object is included, that setting can be
overridden by the admin.

Apex Classes
Name
MassEmailComponentController

MassEmailController

MassEmailSettingsController
MassEmailPackagePostInstall

Description
Even though there are many Mass Email
buttons and associated Visualforce pages, in
order to have a consistent UI, all the Mass
Email logic is implemented as a Visual force
Component.
This class provides the controller for that
Visualforce component.
It is a controller extension and it doesn’t
provide any functional enhancements to the
pages. The only reason for its existence is to
pass the controller information to the
Component controller.
Controller for the custom Visual force page
for setting maintenance.
This script populates the default Mass Email
settings for campaign object upon package
installation.

Copyright © 2014 MST Solutions. All rights reserved

28
|P a g
e

MST Mass Email
MassEmailControllerTest

Test class for the above classes.

Visualforce Pages
Name
MassEmailFromListLead

MassEmailFromListContact

MassEmailInfo

MassEmailSettings

Description
It is a Visualforce page that displays upon
clicking Mass Email in Lead list view. This page
is controlled by a standard set controller for
the lead Object. This page Includes
MassEmailComponent.
It is a Visualforce page that displays upon
clicking the Mass Email in Contact list view.
This page is controlled by the standard set
controller for contact object. This page
Includes MassEmailComponent.
It is a Visualforce page that displays when
Mass Email button is clicked in Campaign
detail page. This page is controlled by the
standard controller for the campaign Object.
This page includes MassEmailComponent.
Visualforce page for settings maintenance.

Visualforce Component
Name
MassEmailComponent

Description
This is the core UI component for the Mass
Email sending UI.

Tab
MST Mass Email Settings

Buttons
Mass Email button for Lead listing
Mass Email button for Contact listing
Mass Email button for Campaign detail page

Copyright © 2014 MST Solutions. All rights reserved

29
|P a g
e