Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<body>
<h2>Sign Up Form</h2>
<form action="%%=RequestParameter('PAGEURL')=%%" method="POST">
<label for="fname">First name:</label><br>
<input type="text" id="fname" name="firstname" value=""><br><br>
<label for="lname">Last name:</label><br>
<input type="text" id="lname" name="lastname" value=""><br><br>
<label for="lname">Email:</label><br>
<!DOCTYPE html>
<html>
<body>
%%[
IF RequestParameter("submitted") == "submitted" Then
]%%
<script runat="server">
Platform.Load("Core", "1");
try {
POST URL - https://xxxxxx.auth.marketingcloudapis.com/v2/token
Header :
Key - Content-Type
Value - application/json
Body:
{
"grant_type": "client_credentials",
"client_id": "Your Client Id",
<div itemscope="" itemtype="http://schema.org/RentalCarReservation">
<meta itemprop="reservationNumber" content="53894589">
<link itemprop="reservationStatus" href="http://schema.org/Confirmed">
<div itemprop="underName" itemscope="" itemtype="http://schema.org/Person">
<meta itemprop="name" content="Naveen Vm">
</div>
<div itemprop="reservationFor" itemscope="" itemtype="http://schema.org/RentalCar">
<meta itemprop="name" content="CCAR">
<meta itemprop="model" content="Civic">
<div itemprop="brand" itemscope="" itemtype="http://schema.org/Brand">
%%[
SET @reservation_number = AttributeValue("reservation_number")
SET @handover_date = Format(AttributeValue("handover_date"),"yyyy-MM-ddTHH:mm:ss")
SET @return_date = Format(AttributeValue("return_date"),"yyyy-MM-ddTHH:mm:ss")
SET @vehicle_group = AttributeValue("vehicle_group")
SET @first_name = ProperCase(AttributeValue("first_name"))
SET @last_name = ProperCase(AttributeValue("last_name"))
Set @full_name = concat(@first_name,' ',@last_name)
Set @PickupAddressName = AttributeValue("PickupAddressName")
Set @PickupAddressName2 = AttributeValue("PickupAddressName2")
<!--Declaring Ampscript variable -->
%%[
var @Page1,@CookieID,@Page2
]%%
<!--Progressive Profile Logic Starts-->
<script runat=server>
Platform.Load("Core", "1.1.1");
var cookie = Platform.Request.GetCookieValue("SFMCCookie"); //Get the cookie value if its present
Variable.SetValue("@CookieID",cookie); //Set the cookie value
var CheckCookie = DataExtension.Init("Progressive Profiling");
<script runat="server">
Platform.Load("Core","1");
try{
var jsonpost = Platform.Request.GetPostData(0);
var json = Platform.Function.ParseJSON(jsonpost);
var Message = "Call back";
var insertResponse = Platform.Function.InsertData("Transactional_Event_Notification_CallBack_Verification",["Message","Body"],[Message,jsonpost]);
} catch (e) {
Write("<br>" + Stringify(e))
}
<script runat="server">
Platform.Load("Core","1");
try{
var jsonpost = Platform.Request.GetPostData(0);
var json = Platform.Function.ParseJSON(jsonpost);
var messageKey = json[0].eventCategoryType;
if (messageKey == "TransactionalSendEvents.EmailSent") {
var MessageType = json[0].eventCategoryType;
var jobId = json[0].composite.jobId;
<div style="text-align: center;">
First Name - {{FirstName}}
</div>
[{
"Product_Name": "Crimson Camelback Pack",
"SKU": "104176",
"Thumbnail_URL": "http://something.com/image2/",
"Product_Category": "Gear",
"Product_Ratings": {
"Last_Review_Text": "Thank you so much for sending this express...",
"Number_of_Ratings": "14",
"Average_Rating": "3.21"
}