public ListsModule(OmniRecordManager omniRecordManager) : base("/unsubscribe") { Get["/{data}"] = call => { string objectString = call.data; var data = UrlBuilder.DecodeBase64(objectString); var creativeId = data.BuildRavenId("creatives", 0); var contactId = data.BuildRavenId("contacts", 1); omniRecordManager.UpdateOrInsert(new UnsubscribeRequest { ContactId = contactId, CreativeId = creativeId, Date = DateTime.UtcNow }); return Response.AsText("You are now unsubscribed, have a nice day"); }; }
public DealsModule(OmniRecordManager omniRecordManager,DroneSettings droneSettings) : base("/deals") { Get["/{data}"] = call => { string objectString = call.data; var data = UrlBuilder.DecodeBase64(objectString); var creativeId = data.BuildRavenId("creatives", 0); var contactId = data.BuildRavenId("contacts", 1); var creativeToDealMap = omniRecordManager.Load<CreativeToDealMap>(creativeId); omniRecordManager.UpdateOrInsert(new ClickAction { ContactId = contactId, CreativeId = creativeId, Date = DateTime.UtcNow, Domain = droneSettings.Domain }); return new RedirectResponse(creativeToDealMap.DealUrl, RedirectResponse.RedirectType.Permanent); }; }