Converts plain text to Base64-encoded binary data.
Availability
<table> <tr> <td>Marketing Cloud Engagement</td> <td>✅ Yes</td> </tr> <tr> <td>Marketing Cloud Next</td> <td>✅ Yes</td> </tr> </table>Syntax
Base64Encode(stringToEncode, characterEncoding)
The Base64Encode() function has two parameters:
stringToEncode(string): Required. The string to encode to Base64.characterEncoding(string): The character encoding type to use when encoding the string. Accepted values areASCII,UTF-7,UTF-8,UTF-16, andUTF-32.
Usage
To use the function, pass it the string that you want to encode. Optionally, specify the type of character encoding to use.
%%[
Var @couponCode, @couponCodeB64
Set @couponCode = "6dn28uqxocqu"
Set @couponCodeB64 = Base64Encode(@couponCode)
]%%
<p>%%=v(@couponCodeB64)=%%</p>
The example code outputs a string encoded in Base64.
NmRuMjh1cXhvY3F1