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 | |
/* check if lead already exists */ | |
SET @subscriberRows = RetrieveSalesforceObjects( | |
"Lead", | |
"Id,Email", | |
"Email", "=", RequestParameter("email") | |
) | |
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"); | |
var authEndpoint = 'https://mcxxxxxxxxxxxxxxxxxxxxxxxxx.auth.marketingcloudapis.com'; | |
var payload = { | |
clientId: "insert Client Id", | |
clientSecret: "insert Client Secret" | |
}; | |
var url = authEndpoint + '/v1/requestToken'; | |
var contentType = 'application/json'; |
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"); | |
var authEndpoint = 'https://mcxxxxxxxxxxxxxxxxxxxxxxxxx.auth.marketingcloudapis.com'; | |
var payload = { | |
client_id: "insert Client Id", | |
client_secret: "insert Client Secret", | |
grant_type: "client_credentials" | |
}; | |
var url = authEndpoint + '/v2/token'; |
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
<table style="padding: 20px;"><tr><td> | |
<h2>Please fill in the form:</h2> | |
<form action="%%=RequestParameter('PAGEURL')=%%" method="post"> | |
<label>First name: </label><input type="text" name="firstname" required=""><br> | |
<label>Last name: </label><input type="text" name="lastname" required=""><br> | |
<label>Company: </label><input type="text" name="company" required=""><br> | |
<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 | |
/* create a new lead */ | |
SET @leadId = CreateSalesforceObject( | |
"Lead", 4, | |
"FirstName", RequestParameter("firstname"), | |
"LastName", RequestParameter("lastname"), | |
"Company", RequestParameter("company"), | |
"Email", RequestParameter("email") |
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 | |
/* check if lead already exists */ | |
SET @subscriberRows = RetrieveSalesforceObjects( | |
"Lead", | |
"Id,Email", | |
"Email", "=", RequestParameter("email") | |
) |
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 | |
/* check if lead already exists */ | |
SET @subscriberRows = RetrieveSalesforceObjects( | |
"Lead", | |
"Id,Email", | |
"Email", "=", RequestParameter("email") | |
) | |
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" | |
SetObjectProperty(@tsDef, "CustomerKey", @ts_extkey) | |
SetObjectProperty(@ts, "TriggeredSendDefinition", @tsDef) | |
SET @ts_sub = CreateObject("Subscriber") |
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 DISTINCT | |
s.SubscriberKey, | |
j.EmailName | |
FROM _Sent s | |
LEFT JOIN _Job j | |
ON s.JobID = j.JobID | |
LEFT JOIN _Open o | |
ON s.JobID = o.JobID AND s.ListID = o.ListID AND s.BatchID = o.BatchID AND s.SubscriberID = o.SubscriberID AND o.IsUnique = 1 | |
LEFT JOIN _Click c | |
ON s.JobID = c.JobID AND s.ListID = c.ListID AND s.BatchID = c.BatchID AND s.SubscriberID = c.SubscriberID AND c.IsUnique = 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
SELECT | |
s.SubscriberKey, | |
j.EmailName, | |
s.EventDate as SentDate, | |
o.EventDate as OpenDate, | |
c.EventDate as ClickDate, | |
b.EventDate as BounceDate, | |
b.BounceCategory, | |
u.EventDate as UnsubscribeDate | |
FROM _Sent s LEFT JOIN _Job as j ON s.JobID = j.JobID |
OlderNewer