Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
MohammadChamanpara committed Apr 11, 2017
1 parent 49332de commit 8a49aaf
Show file tree
Hide file tree
Showing 7 changed files with 213 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/Sitecore.Support.74832.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{50386F73-EA20-45DD-AE42-F36B466FE7C0}") = "Sitecore.Support.74832", "Sitecore.Support.74832\Sitecore.Support.74832.csproj", "{8A53E879-47DA-4273-B305-DD3C5574AEB3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8A53E879-47DA-4273-B305-DD3C5574AEB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8A53E879-47DA-4273-B305-DD3C5574AEB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8A53E879-47DA-4273-B305-DD3C5574AEB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8A53E879-47DA-4273-B305-DD3C5574AEB3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:set="http://www.sitecore.net/xmlconfig/set/">
<sitecore>
<pipelines>
<group groupName="exm.messageEvents">
<pipelines>
<redirectUrl>
<processor patch:instead="*[@type='Sitecore.Modules.EmailCampaign.Core.Pipelines.RedirectUrl.IdentifyContact, Sitecore.EmailCampaign']" type="Sitecore.Support.Modules.EmailCampaign.Core.Pipelines.RedirectUrl.IdentifyContact, Sitecore.Support.74832">
</processor>
</redirectUrl>
</pipelines>
</group>
</pipelines>
</sitecore>
</configuration>
59 changes: 59 additions & 0 deletions src/Sitecore.Support.74832/IdentifyContact.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using Sitecore.Analytics;
using Sitecore.Analytics.Model;
using Sitecore.Diagnostics;
using Sitecore.Modules.EmailCampaign.Core.Pipelines.RedirectUrl;
using Sitecore.Modules.EmailCampaign.Recipients;
using Sitecore.Modules.EmailCampaign.Xdb;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Sitecore.Support.Modules.EmailCampaign.Core.Pipelines.RedirectUrl
{
public class IdentifyContact
{
public void Process(RedirectUrlPipelineArgs args)
{
Assert.ArgumentNotNull(args, "args");
if (!Tracker.IsActive)
{
try
{
Tracker.StartTracking();
}
catch
{
return;
}
}
if ((Tracker.Current != null) && (Tracker.Current.Session != null))
{
try
{
if (args.RecipientId != null)
{
Type[] requestedPropertyTypes = new Type[] { typeof(XdbRelation) };
Recipient recipientSpecific = RecipientRepository.GetDefaultInstance().GetRecipientSpecific(args.RecipientId, requestedPropertyTypes);
if (recipientSpecific != null)
{
XdbRelation defaultProperty = recipientSpecific.GetProperties<XdbRelation>().DefaultProperty;
if (((defaultProperty != null) && !string.IsNullOrEmpty(defaultProperty.Identifier)) && ((Tracker.Current.Contact == null) || (Tracker.Current.Contact.Identifiers.Identifier != defaultProperty.Identifier)))
{
Tracker.Current.Session.Identify(defaultProperty.Identifier);
}
}
}
if (Tracker.Current.Contact != null)
{
Tracker.Current.Contact.Identifiers.IdentificationLevel = ContactIdentificationLevel.Known;
Tracker.Current.Contact.ContactSaveMode = ContactSaveMode.AlwaysSave;
}
}
catch
{
}
}
}
}
}
6 changes: 6 additions & 0 deletions src/Sitecore.Support.74832/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
using System.Reflection;
using System.Runtime.InteropServices;

[assembly: AssemblyTitle("Sitecore.Support.74832")]
[assembly: AssemblyProduct("Sitecore.Support.74832")]
[assembly: ComVisible(false)]
101 changes: 101 additions & 0 deletions src/Sitecore.Support.74832/Sitecore.Support.74832.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>
</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{8A53E879-47DA-4273-B305-DD3C5574AEB3}</ProjectGuid>
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sitecore.Support</RootNamespace>
<AssemblyName>Sitecore.Support.74832</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<UseIISExpress>true</UseIISExpress>
<IISExpressSSLPort />
<IISExpressAnonymousAuthentication />
<IISExpressWindowsAuthentication />
<IISExpressUseClassicPipelineMode />
<UseGlobalApplicationHostFile />
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Sitecore.Analytics, Version=8.0.5193.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SC.Sitecore.Analytics.8.0.4\lib\Sitecore.Analytics.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.Analytics.Model, Version=8.0.5193.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SC.Sitecore.Analytics.Model.8.0.4\lib\Sitecore.Analytics.Model.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.Kernel">
<HintPath>..\packages\SC.Sitecore.Kernel.8.0.4\lib\Sitecore.Kernel.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Sitecore.EmailCampaign">
<HintPath>..\packages\EXM.Sitecore.EmailCampaign.3.1.1\lib\Sitecore.EmailCampaign.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Drawing" />
<Reference Include="System.Web" />
<Reference Include="System.Xml" />
<Reference Include="System.Configuration" />
</ItemGroup>
<ItemGroup>
<Compile Include="IdentifyContact.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<Content Include="App_Config\Include\zzz\Sitecore.Support.74832.config" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="web.config" />
</ItemGroup>
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>True</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:12049/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>
</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>
7 changes: 7 additions & 0 deletions src/Sitecore.Support.74832/packages.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="EXM.Sitecore.EmailCampaign" version="3.1.1" targetFramework="net45" />
<package id="SC.Sitecore.Analytics" version="8.0.4" targetFramework="net45" />
<package id="SC.Sitecore.Analytics.Model" version="8.0.4" targetFramework="net45" />
<package id="SC.Sitecore.Kernel" version="8.0.4" targetFramework="net45" />
</packages>
4 changes: 4 additions & 0 deletions src/Sitecore.Support.74832/web.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- Do not change this file - it must be empty, see https://github.com/SitecoreSupport/PatchCreator/issues/13 -->
</configuration>

0 comments on commit 8a49aaf

Please sign in to comment.