Test AMPscript Content Locally
The AMPscript Core extension can create a web server hosted on your local computer. You can view your AMPscript content on this server using your web browser.
The extension launches a server on your computer on port 5000. You can start the server from within Visual Studio Code.
- In Visual Studio Code, go to File > Open Folder.
- Select the folder that you cloned the Git repository into.
- In the Visual Studio file explorer, open the folder
example/dd4tmp
. Click the filedd4tmp.ampscript
. - Click the Run and Debug icon (), and then click Run and Debug. The example file opens in your web browser.
If the file doesn’t automatically open in your web browser, you can view it by entering localhost:5000
in your browser's address bar.
You can modify the example content to see several of the ways in which AMPscript can personalize content for your recipients.
- Open the file
example/dd4tmp/subscriber.json
. This file represents the subscriber data that can be used to personalize the message. - Change some of the values in the file, and then reload the example page in your web browser. You can change several values to see changes in the file, including:
- To view the message in other languages, change the value of
Member_Langauge
field toES
orCN
. - To change the salutation, change the value of the
first_name
field.
- To view the message in other languages, change the value of