function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
SamirSamir 

Email alert not generated for new campaign members thru code...

Hi,
 
When we create a new lead manually, the email alert that has been setup gets triggered and sends out emails. But this does not happen when a new lead is created and assigned to the campaign thru code.
 
Has anyone come across this ?
 
Thanks,
Samir.
DevAngelDevAngel
Make sure you are using the assignmentRule header.  See the docs for details.
SuperfellSuperfell
Currently the API will never trigger application emails.
SamirSamir
Hi Dave,
 
Thanks for your response. Here are more details:
 
I am already using a "AssignmentRuleHeader" object to set a assign leads to respective owners. This rule is defined in "App Setup->Customize->Leads->Assignment Rules" section. This is working fine.
 
But, after creating a new lead thru code, I need to create a "CampaignMember" record to map this lead to a campaign. When this happens, we need to trigger a "workflow rule" (is this also called "assignment rule"?) defined in "App Setup->Customize->Workflow->Workflow Rules" to send out email alert.
 
Can this also be done using "AssignmentRuleHeader" class ? (because the documentation for this class specifies its use with a new "Lead", "Case" or "Account" object - not a "CampaignMember")
 
Thanks,
Samir.
SamirSamir

Hello Simon,

Thanks for your help. I am not sure I understand what you mean by "application emails". We have a "workflow" rule defined that checks the name field for newly arrived lead and triggers an email. This is working fine.

In addition, we have another "workflow" rule defined for newly arrived lead that checks the "campaign" field and is supposed to trigger another email alert. This is not working.

What I dont understand is that if the first rule gets trigerred, why shouldnt the second ?

Thanks,

Samir.

SuperfellSuperfell
Why are you expecting Lead workflow to fire on a campaignMember insert ?
SamirSamir

Simon,

The objective is to send out alert that some one has responded to a particular campaign.

Reading your post I now realise if this may be possible at all ?? Because the way I see it now,

Step 1=Lead record enters the system, and

Step 2=Campaign Member record enters the system.

The lead rule in question gets triggered immediately after Step#1 (but before Step#2) when there is no campaign linked to the lead. Hence no alerts !

If this is so, how does the provision of selecting "Campaign" field in rule criteria for a LEAD rule help? Also, there is no option of creating a rule for new Campaign Member.

Can you help ?

Regards,

Samir.