Skip to content

gliptak/ampscript-core

 
 

Repository files navigation

AMPscript Core

AMPscript Core is an open source implementation of the Marketing Cloud AMPscript language.

It is cross platform and works on Windows, macOS and Linux.

Subscriber Attributes

Subscriber attributes %%Foo%%/[Foo] are supported through a JSON file named subscriber.json in the working directory.

Supported within the JSON file is a key/value pair of the attribute name and value.

Example:

{
    "FirstName": "Logan"
}

The attribute values can be referenced via:

%%[
    SET @FIRSTNAME = [FirstName]
]%%

Hello %%=V(@FIRSTNAME)=%%
or
Hello %%FirstName%%

Referencing Content

Content functions can reference content local on disk. The files must exist in a Content subdirectory of the working directory.

Example, if you have a file at Content\EmbeddedContent.ampscript, then you can reference it via:

%%=CONTENTBLOCKBYNAME("EmbeddedContent")=%%

Data Extensions

Data Extension support is provided through CSV files on disk. The files must exist in a DataExtensions subdirectory of the working directory. The CSV file must contain headers which represent the columns.

Example, if you have a file at DataExtensions\Loyalty.csv, then it will use this CSV file as the data extension.

DataExtensions\Loyalty.csv

EmailAddress,SubscriberKey,FirstName,LastName,LoyaltyLevel
donnie@northerntrailoutfitters.com,1,Donnie,Stanton,Silver

Index.ampscript

Hello %%=LOOKUP("Loyalty", "FirstName", "emailAddress", "donnie@northerntrailoutfitters.com")=%%

Outputs:

Hello Donnie

Marketing Cloud Supported Languages

Language Summary
AMPscript ⚠️ Partial support
SSJS ⛔ Not supported
GTL ⛔ Not Supported

⚠️ AMPscript Support

Feature Summary
Ampscript Blocks %%[]%% ✔️
Variables ✔️
For for ✔️
If if ✔️
Logic Operators ==, !=, &&, etc ✔️
Inline Ampscript %%= =%% ✔️
Personalization Strings [Foo] or %%Foo%% ✔️
Tag Syntax <script language="ampscript"> ⛔ Not Supported
System Strings xtmonth, jobid, subscriberkey, etc ⛔ Not Supported

Supported Functions

If the function isn't listed here, then it's not supported.

Function Area Supported / Notes
Marketing Cloud API ⛔ Not Supported
Contact Model ⛔ Not Supported
Content ⚠️ Partial support
Data Extensions ⚠️ Partial Support
Date and Time ⚠️ Partial Support
Einstein ⛔ Not Supported
Encryption ⛔ Not Supported
HTTP ⛔ Not Supported
Math ✔️
Microsoft Dynamics ⛔ Not Supported
Sales and Service Cloud ⛔ Not Supported
Site ⛔ Not Supported
Social ⛔ Not Supported
String ⚠️ Partial Support
Utility ⚠️ Partial Support
Content Syndication ⛔ Not Supported

Roadmap

  • Increase supported feature
  • SSJS & GTL
  • Static code analysis tools to identify and remediate performance or security issues

Docs

About

AMPscript Core is an open source implementation of the Marketing Cloud AMPscript language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 86.0%
  • HTML 9.7%
  • TypeScript 2.9%
  • ANTLR 1.4%