PatronManager Help

How to Create a Mail Merge Button in Lightning

Updated on

Use this link to share with your colleagues:

How to Create a Mail Merge Button in Lightning: https://help.pm.leapevent.tech/a/1064856

Mail merges allow you to automate your donation acknowledgment process. Salesforce hasn't brought the mail merge feature to Lightning yet, but don't worry - we've got you covered.

In this article, we'll show you how to create a one-click button that runs the mail merge process straight from the donation record you're on. There are two major steps to this process:

  1. Create the button
  2. Add the button to the page layouts

Setting up this button should take about 15 minutes. Let's get going!

Learn more about setting up mail merge templates to use within PatronManager here.

1. First, you'll need to create the button

The code behind the button populates the letter with information from the specific record automatically.

Time to create

1.2. Search for and click on the Donations object

1.4. Match these settings

  1. Label: Mail Merge
  2. Description: Creates a Mail Merge from the Donation record.
  3. Display Type: Select "Detail Page Button"
  4. Behavior: Select "Display in existing window without sidebar or header"
  5. Content Source: Select "URL"
  6. URL: Paste the following text:
    https://<CLASSIC DOMAIN>.salesforce.com/mail/mmchoose.jsp?id={!Opportunity.Id}&1={!Opportunity.Name}&retURL=https://<LIGHTNING DOMAIN>.lightning.force.com/lightning/r/Opportunity/{!CASESAFEID(Opportunity.Id)}/view?0.source=alohaHeader

Don't click Save yet! We've still got work to do on this screen.

1.5. Update the Classic Domain in the URL with your organization's information

Click here if your URL includes a word, like so: "https://wonderfuled.lightning.force.com/"

You'll replace CLASSIC DOMAIN with OrgName.My.

For example, if your URL looked like this...

https://wonderfuled.lightning.force.com/lightning/setup/ObjectManager/Opportunity/ButtonsLinksActions/newButtonOrLink

You'd replace CLASSIC DOMAIN with WonderfulEd.My

Click here if your URL includes a letter and number combination, like so: "https://na54.lightning.force.com/"

You'll replace CLASSIC DOMAIN with the same letter and number combination.

For example, if your URL looked like this...

https://na54.lightning.force.com/setup/ObjectManager/Opportunity/ButtonsLinksActions/newButtonOrLink

You'd replace CLASSIC DOMAIN with na54.

1.6. Update the Lightning Domain in the URL with your organization's information

Replace <LIGHTNING DOMAIN> with everything after https:// and before .lightning.force.com in the web address of this webpage. The text in red below is what we need:

https://wonderfuled.lightning.force.com/lightning/setup/ObjectManager/Opportunity/ButtonsLinksActions/newButtonOrLink

or

https://na54.lightning.force.com/setup/ObjectManager/Opportunity/ButtonsLinksActions/newButtonOrLink

1.7. Double check your updated URL and click "Save"

Your URL should now look something like this:

https://WonderfulEd.my.salesforce.com/mail/mmchoose.jsp?id={!Opportunity.Id}&1={!Opportunity.Name}&retURL=https://WonderfulEd.lightning.force.com/lightning/r/Opportunity/{!CASESAFEID(Opportunity.Id)}/view?0.source=alohaHeader

Or this:

https://na54.salesforce.com/mail/mmchoose.jsp?id={!Opportunity.Id}&1={!Opportunity.Name}&retURL=https://na54.lightning.force.com/lightning/r/Opportunity/{!CASESAFEID(Opportunity.Id)}/view?0.source=alohaHeader

2. Then, add the button to your page layouts

You can't use the button if you can't see it on each record!

If you're unfamiliar with page layouts, you can learn more about them here.

Update those page layouts

2.1. Click on the Page Layouts option on the left sidebar

2.2. Use the dropdown arrow to click "Edit" on the first page layout where you'd like to see this button

2.3. Click "Mobile & Lightning Actions" on the page layout palette

2.4. Drag Mail Merge onto the Mobile and Lightning Experience Actions bar, then click "Quick Save"

2.5. Scroll to the top and select the next page layout you'd like to add the button to

We recommend adding the mail merge button to any page layout used for donations given by an individual. For example, we recommend adding the button to:

  • Donation Layout
  • Major Gift Layout
  • Matching Donation Layout
  • PatronTicket Donation
  • Pledge Layout
  • Pledge Payment Layout

2.6. Repeat these steps as needed for each page layout; when you're done, click "Save"

2.7. Great! You'll now see the mail merge button on your page layouts

I've added the button to my page layouts, but it's not working!

If you receive a message that reads "Unsupported Browser For Mail Merge This feature requires Internet Explorer for Windows 6.0 or higher on Microsoft Windows 2000 or Windows XP," you'll need to adjust a setting for your Mail Merge button to work.

Let's fix it!

2. Go to User Interface

For what we're doing, you'll want to go to User Interface towards the bottom of the list.

3. Under Advanced, make sure that Enable Extended Mail Merge is checked

4. Click Save

Previous Article Installing the Declarative Lookup Rollup Summary Tool
Next Article The Very Best of Lightning's New Features
Still Need Help? Continue to the Client Community