2

I thought this would be an easy one but its not working as expected.

I have a custom campaign type that has a "Meeting Time field" and i want to include that meeting time in an automatic email that goes to new leads added to that campaign.

I tried simply refering to the campaign in a text based email template as well as using a related to object in a visualforce email template both with no luck

I even tried using an workflow based email alert on new campaign members but that didnt work either?

New leads are added via a simple web to lead form.

whats the easiest way to achieve this?

This is an example of the visualforce email

<messaging:emailTemplate subject="Thanks for your interest" recipientType="Lead" relatedToType="CampaignMember">
<messaging:plainTextEmailBody >
Dear {!recipient.FirstName}, 

Thank you for you for signing up for a Virtual Presentation on {!relatedTo.Campaign.Meeting_Time__c} Eastern! 

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

1 Answer 1

2

I've extracted the following from the Salesforce Objects Data Model:

Campaign-CampaignMember-Lead relationship

Note that these is no direct relationship from Lead to Campaign. Instead CampaignMember provides a mapping between the two records.

So when you are sending the auto response email from the Lead there is no way (out of the box) to know which campaign to pull the merge field from.

The knowledge article Can I trigger workflow off in campaign member status on leads? indicates you were on the right track with a CampaignMember workflow rule. In what way did this not work whey you tried it?


I just ran though the following test with a new Visualforce email template:

<messaging:emailTemplate subject="Thanks for your interest" recipientType="Lead" relatedToType="CampaignMember">
<messaging:plainTextEmailBody >
First Name:
{!recipient.FirstName}, 

Campaign Id:
{!relatedTo.Campaign.Id}

Meeting Time:
{!relatedTo.Campaign.Meeting_Time__c}

</messaging:plainTextEmailBody>
</messaging:emailTemplate>

I then used the Send Test and Verify Merge Fields button, entered a valid Lead Id and the associated Campaign Member Id. It merged my testing Meeting Time field as expected:

enter image description here

Does the send test work for you?

2
  • I used the visualforce email included above. It was triggered from a workflow rule on created campaign members, the name was filled out but the meeting time was blank? Commented Sep 30, 2013 at 2:32
  • Maybe add some checks to your Campaign Member Email Template such as {!relatedTo.Campaign.Id} to confirm it has picked up the correct Campaign Member record. Commented Sep 30, 2013 at 8:16

You must log in to answer this question.

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