Skip to content

Instantly share code, notes, and snippets.

@steliodibello
Created November 23, 2023 16:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save steliodibello/b4bacc3d79a14efb3a49a0cc462bec5a to your computer and use it in GitHub Desktop.
Save steliodibello/b4bacc3d79a14efb3a49a0cc462bec5a to your computer and use it in GitHub Desktop.
using Sitecore.Analytics;
using Sitecore.Analytics.XConnect.Facets;
using Sitecore.Diagnostics;
using Sitecore.Rules;
using Sitecore.Rules.Conditions;
using Sitecore.XConnect;
using Sitecore.Xdb.Configuration;
using System.Collections.Generic;
using System.Linq;
namespace XXXX.Foundation.XConnect.Rules
{
public class SalesforceCustomCampaign<T> : StringOperatorCondition<T> where T : RuleContext
{
public string CampaignValue { get; set; }
protected override bool Execute(T ruleContext)
{
Assert.ArgumentNotNull(ruleContext, "ruleContext");
Log.Info($"[SalesforceCustomCampaignRule] EvaluatingRule", this);
/*Add your custom logic to return true if the rule is satisfied and false if it is not
eg. check cookies, querystring or any other fancy code you need...
*/
return false;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment