You need to sign in to do that
Don't have an account?
rivereridanus
Include link or button to Mass Mail Merge on custom visualforce page
I am trying to figure out how to create a link or button on the custom visualforce pages that override the SF default home pages for Contacts, Accounts, and Leads. The visualforce home pages are just an extended list of all records in that object since my users were getting confused by the original default home page.
We just got XMM (Extended Mail Merge) enabled in our org, and the only way to get to it seems to be via the default home page- but we don't use those. I'd like to find a way to put a button or link on the visualforce home page- or at least provide some way for my users to be able to get to it. Anyone have any thoughts or know anything about this? Any comments are appreciated!
We just got XMM (Extended Mail Merge) enabled in our org, and the only way to get to it seems to be via the default home page- but we don't use those. I'd like to find a way to put a button or link on the visualforce home page- or at least provide some way for my users to be able to get to it. Anyone have any thoughts or know anything about this? Any comments are appreciated!
You could always just use the following code in the button, I do not want the contacts to know who is getting emailed so I am adding their emails to the Bcc field. In doing this Salesforce requires that you have a "to field". I am populating the additional to field with a donot reply email so that the system will take the code.
This will work for any object list view just change the object from contact to your desired object assuming it has an Email field.
Behavior is Execute JavaScript
Display Type List button
{!REQUIRESCRIPT("/soap/ajax/25.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/25.0/apex.js")}
var emailAddresses = '';
var records = {!GETRECORDIDS($ObjectType.Contact)};
if (records[0] == null) {
alert("Please select at least one record to update.");
} else {
for(var c = 0; c < records.length; c++)
{
var contactRecord = sforce.connection.query("SELECT Email FROM Contact WHERE Id ='"+ records[c]
+"'");
emailAddresses = emailAddresses + contactRecord.records.Email + ";";
}
location.replace('/email/author/emailauthor.jsp?retURL=/{!Contact.Id}&rtype=003&p24=someemail@somecompany.com&template_id=(your_template_ID)&p5='+emailAddresses);
}