Skip to content

Instantly share code, notes, and snippets.

View steviemcg's full-sized avatar

Steve McGill steviemcg

View GitHub Profile
@steviemcg
steviemcg / Sparkpost.Europe.config
Last active January 29, 2020 15:22
Configures Sitecore EXM to use EU Datacenters, instructions from https://kb.sitecore.net/articles/947205
<?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:x="http://www.sitecore.net/xmlconfig/" xmlns:role="http://www.sitecore.net/xmlconfig/role/" xmlns:eds="http://www.sitecore.net/xmlconfig/eds/" xmlns:exmEnabled="http://www.sitecore.net/xmlconfig/exmEnabled/">
<sitecore exmEnabled:require="yes" role:require="Standalone or ContentManagement or DedicatedDispatch" eds:require="EmailCloud">
<exm>
<eds>
<smtpSettings>
<server>sitecore-eu.smtp.e.sparkpost.com</server>
<userName>sitecore-eu</userName>
</smtpSettings>
@steviemcg
steviemcg / nuget.config
Created March 12, 2019 21:16
Put this file in the same directory as your .sln file and .Net will check this package source with Nuget
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="Sitecore" value="https://sitecore.myget.org/F/sc-packages/api/v3/index.json" />
</packageSources>
</configuration>
<%@ Page Language="C#" AutoEventWireup="true" Inherits="Sitecore.sitecore.admin.AdminPage" %>
<%@ Import Namespace="Sitecore.XConnect.Client.Configuration" %>
<%@ Import Namespace="Sitecore.XConnect.Client.Serialization" %>
<%@ Import Namespace="Sitecore.XConnect.Collection.Model" %>
<%@ Import Namespace="Sitecore.XConnect" %>
<%@ Import Namespace="Sitecore.XConnect.Client" %>
<%@ Import Namespace="Newtonsoft.Json" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<%@ Page Language="C#" AutoEventWireup="true" Inherits="Sitecore.sitecore.admin.AdminPage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Aggregation</title>
<script runat="server" language="C#">
protected void Page_Load(object sender, EventArgs e)
{
CheckSecurity(true);
}
<%@ Page Language="c#" EnableEventValidation="false" AutoEventWireup="true" EnableViewState="false" %>
<%@ Import Namespace="Sitecore.Caching" %>
<script runat="server">
void Page_Load(object sender, System.EventArgs e)
{
if (!Sitecore.Context.IsAdministrator)
{
Response.Write("Must be logged in as an administrator");
Response.End();
@steviemcg
steviemcg / UpdateXfilePicture.cs
Created April 9, 2015 16:14
Update xFile picture when logging in with Facebook
namespace YourNamespace.EventHandlers.Social
{
using System;
using System.IO;
using System.Net;
using Facebook;
using Sitecore.Analytics;
using Sitecore.Analytics.Model.Entities;
using Sitecore.Analytics.Tracking;
using Sitecore.Configuration;
@steviemcg
steviemcg / UpdateContactDetails.cs
Created April 9, 2015 16:05
Sitecore WFFM Custom "Save to Contact" save action
namespace YourNamespace.SaveActions
{
using System.Collections.Generic;
using System.Linq;
using System.Web.Script.Serialization;
using Sitecore.Analytics;
using Sitecore.Analytics.Model.Entities;
using Sitecore.Analytics.Tracking;
using Sitecore.Configuration;
using Sitecore.Data;
using System;
using Sitecore.Caching;
using Sitecore.ContentSearch;
namespace MyProject
{
public class MyContext
{
private static readonly ItemsContext _items;