0

I have lead, member and agreement objects, member has look-up to lead and agreement has Master-Detail(Partner) field.

I created visualforce email template to display fields information from agreement into it and send it to the partner.

Partner has email field with type email, how can I send the agreement email to partner email?

I created email template with VF

<messaging:emailTemplate subject="Agreement" 
                         recipientType="Lead" 
                         relatedToType="Agreement__c">
  <messaging:htmlEmailBody >
        <p>Dear {!recipient.lastname},</p>
        <p>Agreement Content:</p>
        <c:pTasks_Component agrId="{!relatedTo.Id}" />

    </messaging:htmlEmailBody>
</messaging:emailTemplate>

I created workflow rule on Agreement object Evaluated when a record is created with workflow action, but I can't choose partner email as a recipient.

3
  • If you already know to where send an email -- create field on agreement and populate it via trigger etc
    – kurunve
    Feb 7, 2016 at 15:52
  • Is this the only way to do that? @kurunve Feb 7, 2016 at 15:53
  • Unfortunately, I have no more ideas, @user3003810
    – kurunve
    Feb 7, 2016 at 17:00

1 Answer 1

0

When you create a WF rule on some SObject S, only the email fields on S are available to set as the recipient. You will need to either

  1. change the WF to trigger off a DML event on Partner__c or
  2. to force via trigger or process builder, the value of the child partner's email into a new custom field on Agreement__c: sendToEmail__c of type Email.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.