Skip to content

Instantly share code, notes, and snippets.

@agehlot
agehlot / boxever-guest-search-box
Created September 4, 2021 04:54
Few sample queries that can be used for searching an entity on Guests section.
@agehlot
agehlot / batchUpload.py
Created August 19, 2021 14:29
This python script can be used to upload the orders into boxever CDP via batch API.
# https://developer.boxever.com/reference/overview_batch
# https://developer.boxever.com/reference/importing-the-batch-file
# order data model: https://doc.sitecore.com/cdp/en/developers/sitecore-customer-data-platform--data-model-2-1/sitecore-cdp-order-data-model-for-batch-api.html
# Script takes a file, client key and api secret.Name your JSON file outputFile.json, and compress into outputFile.json.gz
# one JSON record per line, see docs for full details on fomatting
import csv
import json
import uuid
import codecs
@agehlot
agehlot / content-hub-graphql-assets.json
Last active August 13, 2021 09:02
These are some sample Sitecore Content Hub sample GraphQL queries
{
allM_Asset(where: { title_eq: "Group selfie with drinks" }) {
total
results {
fileName
fileSize
isDraft
}
}
}
@agehlot
agehlot / boxever-test-Index.html
Created July 11, 2021 15:28
This is the sample html test page to verify how new user is being created in the Boxever? how new event can be trigger in the Boxever. Initially my event were not getting reflected there in Boxever user event section but later, when commented out pos value, it started working.
<html>
<head>
<script type="text/javascript">
// Define the Boxever queue
var _boxeverq = _boxeverq || [];
// Define the Boxever settings
var _boxever_settings = {
client_key: '<Replace your Clint_Key>', // Replace with your client key
target: 'https://api.boxever.com/v1.2', // Replace with your API target endpoint specific to your data center region
@agehlot
agehlot / CustomCache.cs
Created March 14, 2021 04:22
Sitecore custom cache class
using Sitecore.Caching;
using Sitecore.Data.Items;
using Sitecore.Diagnostics;
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
namespace Core.Foundation.Caching.CustomCaching
{
/// <summary>
@agehlot
agehlot / MemoryCache.cs
Last active March 14, 2021 04:21
Helper methods for managing cache using MemoryCache
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Caching;
using System.Threading;
using System.Web;
namespace Core.Foundation.Caching.CustomCaching
{
public static class MemoryCache
@agehlot
agehlot / MarketingActivityHelper.cs
Created March 14, 2021 00:45
Triggering a Sitecore goal programmatically
namespace Core.Foundation.SitecoreExtensions.Helpers
{
/// <summary>
/// Class MarketingActivityHelper.
/// </summary>
public class MarketingActivityHelper
{
/// <summary>
/// Triggers the goal.
/// </summary>
@agehlot
agehlot / TrackingFieldHelper.cs
Created March 14, 2021 00:43
Collection of helper methods for Sitecore Tracking field
using Sitecore.Analytics.Data;
using Sitecore.Analytics.Data.Items;
using Sitecore.Configuration;
using Sitecore.Data;
using Sitecore.Data.Items;
using Sitecore.SecurityModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
@agehlot
agehlot / HashHelper.cs
Created March 13, 2021 18:35
Helper class to generate one way hash value of given parameter
// ***********************************************************************
// Assembly : Core.Foundation.SitecoreExtensions
// Author : agehlot
// Created : 10-24-2020
//
// Last Modified By : agehlot
// Last Modified On : 10-24-2020
// ***********************************************************************
// <copyright file="HashHelper.cs" company="">
// Copyright © 2019
@agehlot
agehlot / PushNotificationService.cs
Created March 13, 2021 18:33
Firebase push notification service
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
using System.Web.Script.Serialization;
namespace Core.Foundation.Notification.Services
{
[Service(typeof(IPushNotificationService))]