This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%=TreatAsContent(HTTPGet('https://raw.githubusercontent.com/zuzannamj/data-views-app/main/index.html'))=%% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
POST https://api.openai.com/v1/chat/completions | |
Content-Type application/json | |
Authorization Bearer {{API key}} | |
{ | |
"model": "gpt-3.5-turbo", | |
"messages": [{"role": "user", "content": "here you tell ChatGPT what content to generate"}] | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script runat = "server" > | |
Platform.Load("Core", "1"); | |
try { | |
var interest = "dogs"; //add your interest | |
var contentType = 'application/json'; | |
var headerNames = ["Authorization"]; | |
var headerValues = ["Bearer xxxx"]; //add your key |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT p.SubscriberKey | |
, c.OrderIDs | |
FROM [AllOrders] p | |
CROSS APPLY ( | |
Select CAST('<x>' + REPLACE(p.OrderIDs,',','</x><x>') + '</x>' AS XML).value('/x[1]','nvarchar(max)') as OrderIDs1 | |
UNION ALL | |
Select CAST('<x>' + REPLACE(p.OrderIDs,',','</x><x>') + '</x>' AS XML).value('/x[2]','nvarchar(max)') as OrderIDs2 | |
UNION ALL | |
Select CAST('<x>' + REPLACE(p.OrderIDs,',','</x><x>') + '</x>' AS XML).value('/x[3]','nvarchar(max)') as OrderIDs3 | |
UNION ALL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select | |
orders.SubscriberKey, orders.OrderID | |
from ( | |
SELECT | |
a.SubscriberKey | |
, SUBSTRING(a.OrderIDs, 1, ISNULL(p1 - 1, LEN(a.OrderIDs))) OrderID | |
from AllOrders a | |
CROSS APPLY (select NULLIF(CHARINDEX(',', a.OrderIDs), 0)) b(p1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
ELSEIF RequestParameter("submittedOTP") == true THEN | |
SET @OTP = RequestParameter('OTP') | |
SET @email = RequestParameter("email") | |
/* check OTP against the DE */ | |
set @rows = LookupOrderedRows("OTP", 1, "SentDate desc", "EmailAddress", @email) | |
if @rowCount > 0 then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
IF RequestParameter("submitted") == true THEN | |
/* generate an OPT */ | |
set @num1 = 1000 | |
set @num2 = 9999 | |
set @OTP = random(@num1, @num2) | |
/* send a triggered email containing the opt */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form action="%%=RequestParameter('PAGEURL')=%%" method="post"> | |
<label>Email: </label><input type="text" name="email" required=""><br> | |
<input name="submitted" type="hidden" value="true"><br> | |
<input type="submit" value="Submit"> | |
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%%[ | |
IF RequestParameter("submitted") == true THEN | |
/* generate an OPT */ | |
set @num1 = 1000 | |
set @num2 = 9999 | |
set @OTP = random(@num1, @num2) | |
/* send a triggered email containing the opt */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"eventDefinitionKey":"my_event_definition", | |
"members":[ | |
{ | |
"contactKey":"contact1", | |
"data":{ | |
"Attribute_1":"value_1", | |
"Attribute_2":"value_2" | |
} | |
}, |
NewerOlder