GroupBuilderContactAmountVariable class

From Catglobe Wiki
Revision as of 11:29, 31 March 2017 by Nguyenduyan (talk | contribs)
Jump to: navigation, search

GroupBuilderContactAmountVariable



Represents a group builder variable for contact amount.

Constructors

  • () - Create new variable

Methods

  • Empty SetFixedDateLimited(DateTime fromDate "From date", DateTime toDate "To date") - Set a fixed date limitation
  • Empty SetFloatingDateLimited(int nrDaysBefore "Number of days before today to start", int nrDays "Number of days to include") - Set a floating date limitation
  • Empty SetMailType(bool isEmail "Include normal emails sent", bool isBulkmail "Include bulk emails sent") - Include normal emails sent and/or bulkmails
  • Empty SetNotDateLimited() - Remove date limitation
  • string ToString() - The string representation of the object.

Properties

  • int GroupResourceId { get; set; } - Include only mails sent sent to people in this group
  • bool IsBulkmail { get; } - Include bulk emails sent
  • bool IsEmail { get; } - Include normal emails sent
  • bool IsFixedDateLimited { get; } - Include all users within date range
  • bool IsFloatingDateLimited { get; } - Include all users within floating date range
  • bool IsNotDateLimited { get; } - Include all users date wise
  • string ObjectTypeName { get; } - The name of the type of object.
  • string Operator { get; set; } - Include those that received more, the exact or less emails than the target given
  • int Target { get; set; } - Include those that received more, the exact or less emails than the target given
  • int TargetResourceId { get; set; } - Include only mails sent directly under this resource
  • TypeInformation TypeInformation { get; } - Get information about this class.


Examples

//Create a new group
string groupName = "Test Group Builder: ContactAmountVariable";
number groupTemplateResourceId=2066;
number parentResourceId = 11088827;
array group = Group_new(groupName, groupTemplateResourceId, parentResourceId);
Group_save(group);
number groupRId = group[GROUP_RESOURCE_ID ];
 
//Create rule for the group
GroupBuilderRoot root = new GroupBuilderRoot (groupRId);
 
GroupBuilderContactAmountVariable ContactAmountVariable = new GroupBuilderContactAmountVariable ();

DateTime fromDate = new DateTime("2017/03/25");
DateTime toDate = new DateTime("2017/03/31");
ContactAmountVariable.SetFixedDateLimited(fromDate,toDate);

//number nrDaysBefore = 6;
//number nrDays=5;
//ContactAmountVariable.SetFloatingDateLimited(nrDaysBefore ,nrDays);

bool isEmail = true;
bool isBulkmail = false;
ContactAmountVariable.SetMailType(isEmail, isBulkmail);

//ContactAmountVariable.SetNotDateLimited();

ContactAmountVariable.GroupResourceId =15560179;
ContactAmountVariable.TargetResourceId =15546533;
ContactAmountVariable.Operator=">";
ContactAmountVariable.Target=1;
 
print(ContactAmountVariable.IsBulkmail );// false
print(ContactAmountVariable.IsEmail );// true
print(ContactAmountVariable.IsFixedDateLimited );// true
print(ContactAmountVariable.IsFloatingDateLimited );//false
print(ContactAmountVariable.IsNotDateLimited );// false
print(ContactAmountVariable.Operator );// >
print(ContactAmountVariable.Target );// 1
print(ContactAmountVariable.GroupResourceId );// 15560179
print(ContactAmountVariable.TargetResourceId );// 15546533
 
GroupBuilderRule rule = new GroupBuilderRule (root);
rule.Add(ContactAmountVariable);
 
GroupBuilderRuleCollection ruleColection = root.RootRules;
ruleColection.Add(rule);
 
root.Save();