Skip to content

Instantly share code, notes, and snippets.

View gillissm's full-sized avatar

Scott Gillis gillissm

View GitHub Profile
@gillissm
gillissm / ContactFacetDialog.xaml.xml
Created February 10, 2016 21:14
Basic Sitecore Sheer Dialog XML
<?xml version="1.0" encoding="utf-8" ?>
<xamlControls
xmlns:x="http://www.sitecore.net/xaml"
xmlns:ajax="http://www.sitecore.net/ajax"
xmlns:asp="http://www.sitecore.net/microsoft/webcontrols"
xmlns:html="http://www.sitecore.net/microsoft/htmlcontrols">
<ContactFacetDialog x:inherits="TheCodeAttic.SharedSource.WFFM.PopulateFieldAction.Sheer.ContactFacetDialog,TheCodeAttic.SharedSource.WFFM.PopulateFieldAction">
<Sitecore.Controls.DialogPage runat="server" >
@gillissm
gillissm / GetContactFacetValue.cs
Last active February 10, 2016 21:19
Custom Web Forms for Marketers Action Setup
//Step 1:Using Statements
using Sitecore.Analytics;
using Sitecore.Analytics.Model.Entities;
using Sitecore.Diagnostics;
using Sitecore.Forms.Core.Rules;
using System.Linq;
//Step 2: Basic Code Structure
namespace TheCodeAttic.SharedSource.WFFM.PopulateFieldAction
{
@gillissm
gillissm / TrackerAssertCommands.cs
Created February 10, 2016 21:08
Step 3: Tracker assert commands
Assert.IsNotNull((object)Tracker.Current, "Tracker.Current");
Assert.IsNotNull((object)Tracker.Current.Contact, "Tracker.Current.Contact");
@gillissm
gillissm / ContactFacetSwitch.cs
Created February 10, 2016 21:08
Step 4: Retrieving from the Contact Facet
switch (this.Name.ToLower())
{
case "first name":
retValue = Tracker.Current.Contact.GetFacet<IContactPersonalInfo>("Personal").FirstName;
break;
case "last name":
retValue = Tracker.Current.Contact.GetFacet<IContactPersonalInfo>("Personal").Surname;
break;
case "email":
IContactEmailAddresses ea = Tracker.Current.Contact.GetFacet<IContactEmailAddresses>("Emails");
@gillissm
gillissm / ActionTemplate.cs
Created February 10, 2016 20:58
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>.
@gillissm
gillissm / TheCodeAttic.UseLocalMTA.Patch.xml
Last active April 9, 2017 20:28
Sitecore Email Experience Manager Configuration Patch File for Local MTA configuration
<!--NOTE: Before use be sure to rename to '.config' Using the XML extension to provide better visual formatting.-->
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/">
<sitecore>
<settings>
<!-- Set it to "true" if you want use the SMTP settings below.
You should purchase the right of using the "UseLocalMTA" setting first. -->
<setting name="UseLocalMTA">
<patch:attribute name="value">true</patch:attribute>
</setting>