Академический Документы
Профессиональный Документы
Культура Документы
Sachin Patil
9/01/2009
Campaign work flow
Overview
This document covers the detail flow of Campaign assignment, Campaign updating
process.
Campaign Assignment:
Campaign will be assigned by following 2 ways:
1. Lead is created/updated:
2. Campaign is inserted/updated:
When a lead is created in VPC, suppose that lead is entered with status “A” then the
campaigns which have status “A” will be assigned to that lead. Automated
campaign emails will be sending according to createddate of a lead.
If status is not exclusive the “All” status campaign are also assigned to that lead. A
record of campaign assignment to leads is maintained in crm_lead_template table
in each company’s DB.
6
Campaign work flow
Campaign is inserted:
When a campaign is inserted into VPC, suppose campaign is created with status “A”
then leads which are having status “A” will be assigned to that campaign.
Automated emails will be sending according to createddate of campaign.
Campaign is updated:
When a campaign is updated i.e. if status of a campaign is updated from status “A”
to status “B” then leads which are having status “B” will be assigned newly to
campaign. The leads with status “A” will be updated in crm_lead_template i.e. the
records with leads having status “A” and assigned campaign will be deactivated.
Automated emails will be sending according to updated date of a campaign.
6
Campaign work flow
When a lead is updated i.e. if a status of a lead is updated from status “A” to status
“B” then campaigns of status “B” will be assigned to those lead, campaigns of
status “A” will be deactivated. Automated emails will be sending according to
createddate of a lead.
We changed logic here i.e. when a lead is updated then we need to send automated
campaign emails not from createddate, we need to assign campaigns from the date
when a lead’s status will be changed.
6
Campaign work flow
For example if campaign “Campaign A” has status “A”, “Campaign B” has status
“B” and have templates scheduled as day1, day2 and day3 respectively. If “lead a”
has inserted with status “A” and gets 3 templates. When “lead a” has changed to
status “B” then it should receive day1 template of “Campaign B” on the next day
after status assignment.
ii. Why is createdate NULL, this date always needs to have a value
since it’s the baseline date
If Createddate field is containing null value then campaign sending is base on
the lead created date. When lead is updated then createddate field is set with
the lead update date value.
iv. Why is tempid NULL shouldn’t this field have the template ids
associated
Records for tempid having null values are old one new record may not have
this issue. We can remove this field and make use of templateid.
2. Days to send campaign is the trigger when to send the campaign based on
the created date of the crm_lead_template
a. Explain the following
6
Campaign work flow
CheckTemplateValidity ():
a) If template is scheduled for fixed date i.e. 83 then check the month
and date of date_set and today's date and month, if these matches
then send that template to leads which we have already within
dataset.
6
Campaign work flow
if (forall != 1)
{
strtempid = DatabaseConnection.SqlScalar ("select tempid
from crm_camp_temp where active =1 and campid=" + campid + "
and day_add=" + id1 + "", ConnectionStr);
}
if (strtempid.Trim() != "")
{
DataView dvLeads = new DataView (dsCampLeads.Tables [0]);
String todaydate = DateTime.Now.Year.ToString () +
DateTime.Now.Month.ToString () + DateTime.Now.Day.ToString ();
dvLeads.RowFilter = "leadid=" + lead_id;
SendEmails (dvLeads.ToTable ().DefaultView, campid,
Convert.ToInt32 (strtempid), companyid, ConnectionStr);
}
6
Campaign work flow
Scheduler loads all the records into the crm_queue table and base on the
lead details it sends e-mails.