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
%%[ | |
var @apikey, @url, @response | |
set @apikey = Lookup("NASAapi","apikey","id","apod") // keep your apikey in a Data Extension | |
set @apikey = "7Apb3QN7qVsXPuPDcSZBKAPf8twca03C5w4Oxuyc" // or hardcode it into your CloudPage | |
set @url = concat('https://api.nasa.gov/planetary/apod?api_key=',@apikey) | |
set @response = HTTPGET(@url,false,0,@CallStatus) | |
]%% |
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" language="javascript"> | |
Platform.Load("Core","1"); | |
//Get the @response variable from AMPscript | |
var response = Variable.GetValue("@response"); | |
//Parse JSON | |
var json = Platform.Function.ParseJSON(response); | |
//Set the @hdurl variable to be accessible in AMPscript |
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
<img style="height:100vh" src="%%=v(@hdurl)=%%"> |
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
%%[ | |
var @apikey, @url, @response | |
set @apikey = Lookup("NASAapi","apikey","id","apod") // keep your apikey in a Data Extension | |
set @apikey = "7Apb3QN7qVsXPuPDcSZBKAPf8twca03C5w4Oxuyc" // or hardcode it into your CloudPage | |
set @url = concat('https://api.nasa.gov/planetary/apod?api_key=',@apikey) | |
set @response = HTTPGET(@url,false,0,@CallStatus) | |
]%% | |
<script runat="server" language="javascript"> | |
Platform.Load("Core","1"); |
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
%%[ | |
set @email = emailaddr | |
if (@email != "") then | |
set @rows = LookupRows("LeadsDataExtension","Email", @email) | |
set @rowCount = rowcount(@rows) | |
if @rowCount > 0 then | |
set @row = Row(@rows, 1) | |
set @UID = Field(@row,"UID") | |
endif | |
endif |
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
%%[ | |
VAR @ts, @tsDef, @ts_extkey, @ts_email, @ts_sub, @ts_statusCode, @ts_statusMsg, @errorCode | |
SET @ts = CreateObject("TriggeredSend") | |
SET @tsDef = CreateObject("TriggeredSendDefinition") | |
SET @ts_extkey = "ExternalKey" | |
SET @ts_email = "email@example.com" | |
SET @ts_subkey = _subscriberkey | |
SetObjectProperty(@tsDef, "CustomerKey", @ts_extkey) | |
SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef) |
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"); | |
var subkey, jid, lue, lid, bid, lue_prop, Response; | |
var subkey = Attribute.GetValue("_subscriberkey"); | |
var jid = Attribute.GetValue("jobid"); | |
var lid = Attribute.GetValue("listid"); | |
var bid = Attribute.GetValue("_JobSubscriberBatchID"); |
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.1.1"); | |
try{ | |
</script> | |
%%[ | |
VAR @skey, @jid, @reason, @lue, @lue_prop, @lue_statusCode, @overallStatus, @requestId, @Response, @Status, @Error | |
SET @skey = _subscriberkey |
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
<soap-ENV:Body> | |
<ExecuteRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI"> | |
<Requests> | |
<Name>LogUnsubEvent</Name> | |
<Parameters> | |
<Name>SubscriberID</Name> | |
<Value>123456</Value> | |
</Parameters> | |
<Parameters> | |
<Name>SubscriberKey</Name> |
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
<input type="text" name="FirstName" | |
data-field-type="Text" value="%%=v(@firstname)=%%"> |