Skip to content

Instantly share code, notes, and snippets.

<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/'
/**
* @fileoverview
* - Using the 'QRCode for Javascript library'
* - Fixed dataset of 'QRCode for Javascript library' for support full-spec.
* - this library has no dependencies.
*
* @author davidshimjs
* @see <a href="http://www.d-project.com/" target="_blank">http://www.d-project.com/</a>
* @see <a href="http://jeromeetienne.github.com/jquery-qrcode/" target="_blank">http://jeromeetienne.github.com/jquery-qrcode/</a>
*/
%%[
set @data = 'https://sfmarketing.cloud/'
set @qrcode = concat('https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=', @data)
]%%
<img src="%%=v(@qrcode)=%%">
%%[
set @value = Lookup("Barcode Data","Barcode","SubscriberKey", _subscriberkey)
set @codabar = BarcodeURL(@value, "Codabar", 100, 50)
]%%
<img src="%%=v(@codabar)=%%">
<br>
%%=v(@value)=%%