While you can switch to Classis Salesforce and use the Mail Merge functionality from there, you can easily add a custom button to the Account or Contact object layout to open within Lightning.
First navigate to the Object Manager and choose the object you will add the button on. For this example we will use the Account Object because our templates are populated with fields from here.
- Select Buttons, Links, and Action from the list on the left and click the New Button or Link
- Label the button ‘Mail Merge’ and choose Detail Page Button.
- Select Display in new window as the Behavior and URL for Content Source.
- Copy the following into the text box:
https://<YOUR-ORG-NAME> .my.salesforce.com/mail/mmchoose.jsp?id={!Account.Id}&1={!Account.Name}&retURL=https://<YOUR-ORG-NAME> .lightning.force.com/lightning/r/Account/{!CASESAFEID(Account.Id)}/view?0.source=alohaHeader
NOTE: Replace <YOUR_ORG_NAME> with the name of your organization when logged into Salesforce Classic and Lightning. Remove any spaces from the hyperlink after copying
- Click Save.
Navigate to the object’s layout(s) to add the button to the page.
- Select Mobile & Lightning Actions from the list on the left and drag the Mail Merge button to the Salesforce Mobile and Lightning Experience Actions
- Click Save and test your button. When you click on the Mail Merge button from the Account Page the Classic Mail Merge page will open. Choose the desired template to merge and perform as usual.