Skip to content

Instantly share code, notes, and snippets.

<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>
%%[
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 */
@zuzannamj
zuzannamj / jbBulkAPI.JSON
Created March 8, 2023 20:58
Journey Builder Bulk API
{
"eventDefinitionKey":"my_event_definition",
"members":[
{
"contactKey":"contact1",
"data":{
"Attribute_1":"value_1",
"Attribute_2":"value_2"
}
},
<script runat="server">
Platform.Load("core","1.1.1");
// set the value of a firstName variable
var firstName = "John";
</script>
<script>
%%[
var @emailAddress
/* get email address from the sendable data extension */
set @emailAddress = AttributeValue("email")
]%%
<script>
<script runat="server">
Platform.Load("core","1.1.1");
// set the value of a firstName variable
var firstName = "John";
// pass the value to an AMPscript @firstName variable
Variable.SetValue("@firstName", firstName);
<script runat="server">
Platform.Load("core","1.1.1");
// get the value of the emailaddr personalization string
var email = Attribute.GetValue("emailaddr");
Write("<br>email: " + email);
</script>
%%[
var @emailAddress
/* get email address from the sendable data extension */
set @emailAddress = AttributeValue("email")
]%%
<script runat="server">
https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=https://sfmarketing.cloud/
<html>
<head>
<script type="text/javascript" src="https://xxxxx/qrcode.js"></script>
</head>
<body>
%%[
set @data = 'http://sfmarketing.cloud/'