Skip to content

Instantly share code, notes, and snippets.

@gillissm
Created February 10, 2016 20:58
Show Gist options
  • Save gillissm/6c658e643760320d42d1 to your computer and use it in GitHub Desktop.
Save gillissm/6c658e643760320d42d1 to your computer and use it in GitHub Desktop.
Basic Action Template for creating a Web Forms for Marketers custom action
using Sitecore.Forms.Core.Rules;
namespace TheCodeAttic.SharedSource.WFFM.PopulateFieldAction
{
public class ActionTemplate<T> : ReadValue<T> where T : ConditionalRuleContext
{
protected override object GetValue()
{
string retVal = string.Empty;
/// This value is inherited from ReadValue<T>.
/// This is the will contain the selected/entered value to be acted on by this action
/// In some instances you may not need to use this for your action
var ValueToPeformActionLogicOn = this.Name;
///Custom action logic goes here
return (object)retVal; //return value to be assigned to the form field.
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment