0

I am trying to create a custom send email button on a custom object called Disease__c. I have patients linked to the disease, where disease is the Master in the master-detail relationship.

Disease__c (Master) ..... Patient__c (Detail) .... Contact (Lookup)

The email button should go on the Disease__c page and when I click the button, I want to send an email (a predefined template) to all patients linked to the disease. I will not need to edit this template.

I have looked at this: https://success.salesforce.com/answers?id=90630000000goIfAAI and it seems to be what I am looking for, however I cannot get it to work, probably because I need to get the correct value for rtype= .

I will also need to populate the email with all my patients linked to the disease.

Any ideas on how to go about this? Tia.

3 Answers 3

1

@USER8737

try this once by using this template will automatically popuplate, and customer name also automatically populate

 location.replace('/_ui/core/email/author/EmailAuthor?p3_lkid={!sobjecApi__c.Id}&retURL=%2F{!sobjecApi__c.Id}&p2_lkid={!sobjecApi__c.ContactId__c}&template_id=1213244335&new_template=1');
1
  • Unfortunately this doesn't work as I cannot access the email addresses of my patients in this way.
    – user8737
    Commented Jun 24, 2014 at 9:34
1

I found one useful link that explains how EmailAuthor.jsp works.

Please read through and see if you can use p4 ( CC) & p5 (BCC) parameters to send email to many Patients.

http://salesforcewizard.wordpress.com/2014/01/08/great-url-hack-meet-the-chatter-publisher-action/

0

I have now created a button which calls a webservice class using JavaScript. In my webservice class I will set up the email template and then send the email to all my patients. This works very well.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .