Skip to content

Latest commit

 

History

History
184 lines (139 loc) · 6.82 KB

README.md

File metadata and controls

184 lines (139 loc) · 6.82 KB

email360 logo

A sleek and powerful library for faster and easier development in Salesforce Marketing Cloud ©.

Explore the Docs · Get in touch · email360 Blog . email360 Youtube


Support

This library is open source and free to use for the community. If you find this library helpful and want to support me, please feel free to grab me a coffee for the late night grinds. Your support is greatly appreciated.

Buy Me a Coffee at ko-fi.com


Table of contents


Quick start

To install the Email360 ssjs-lib into your project create a Cloudpage and insert the following code:

%%=TreatAsContent(HTTPGet('https://raw.githubusercontent.com/email360/ssjs-lib/master/setup/setup.ssjs'))=%%

Please watch the following video for a full guide on the installation of the SSJS Library.

Instal the SSJS LIB

All steps are optional and if you experience a timeout refresh the page.

Details of the script that is run for installation can be found at https://raw.githubusercontent.com/email360/ssjs-lib/master/setup/setup.ssjs



After the installation add the following code at the top of your script to get started. Change the prefix and version as desired. Default is email360 and version 1.0.1

    Platform.Load("Core", "1");
    Platform.Function.ContentBlockByKey('[prefix]-ssjs-lib-[version]');

What's installed

After executing the installation process you'll find the following directories and files, logically grouping common assets.

Marketing Cloud/
├── Data Extensions/
│   └── [BRAND NAME]/
│       └── SSJS Lib/
│           └── [VERSION]
│                 ├── SSJS Lib - Auth Users - [VERSION]_[BRAND NAME]
│                 ├── SSJS Lib - Authentication - [VERSION]_[BRAND NAME]
│                 ├── SSJS Lib - Log Error - [VERSION]_[BRAND NAME]
│                 ├── SSJS Lib - Log Warning - [VERSION]_[BRAND NAME]
│                 ├── SSJS Lib - SFMC Api Token - [VERSION]_[BRAND NAME]
│                 └── SSJS Lib - WSProxy Cols - [VERSION]_[BRAND NAME]
│
└── Content Builder/
    └── [BRAND NAME]/
        └── SSJS Lib/
            └── [VERSION]
                  ├── CloudPages/
                  │   ├── Error/
                  │   │   └── Error Page
                  │   └── Login/
                  │       └── Login Page
                  └── Lib/
                      ├── SSJS Lib - settings
                      ├── SSJS Lib - cloudpage
                      ├── SSJS Lib - amp
                      ├── SSJS Lib - wsproxy
                      ├── SSJS Lib - core
                      ├── SSJS Lib - polyfill
                      ├── SSJS Lib - einstein
                      └── SSJS Lib - sfmcapi

Changelog

Version 1.01
  1. Introducing versions. Versions will be added to customer keys and DataExtension names. This will allow you to install newer versions of the library without any possible issues on existing code due to backward compatibility.
  2. Added JWT support. A new script has been added: var jwt = new jwt();
    • jwt.encode();
    • jwt.decode();
    • jwt.verify();
  3. Introducing log4ssjs to the SSJS library. Similar to log4js but different...
    • var log = new logger('name');
    • log.level = "DEBUG";
    • Additionally you can set appenders.
      • log.configure = {appenders:[ {type:"dataExtension",level:"INFO"}, {type:"console",level:"TRACE"}]}
    • Currently supported
      • console
      • json
      • html
      • DataExtension
      • HTTPRequest
      • TriggeredSend
  4. Removed script tags from library files for better lint support in vs-code
  5. Introduce a setup wizard to assist with installation

Documentation

Email360's SSJS Lib documentation can be found at https://docs.email360.io
For any tips and tricks please head over to the email360 youtube channel


Code

Email360's SSJS Lib can be found at https://github.com/email360/ssjs-lib


Contributing

We welcome all who want to contribute to this repository, to contribute please follow these guidelines.

  1. Fork the repo and create your branch from master. A guide on how to fork a repository can be found here.

  2. Make your changes, test where/if possible.

  3. If your changes alter the behaviour of any of the code, update the corresponding comments within the codebase. The updated comment will then be used to update the documentation found within our docs

  4. Open a pull request against the master branch at https://github.com/email360/ssjs-lib.

  5. Leave a comment on the pull request stating the reason for the change.

  6. One of the administrators of email360/ssjs-lib will review your code, merge it or ask for changes.


Thanks

This library would not have been possible without the Salesforce Marketing Cloud © community. Ohana!

Special thanks to the following people for their active contribution to the community:

Ivan Razine, Adam Spriggs, Zuzanna Jarczynska, Eliot Harper, Mateusz Dąbrowski, Gregory (Gortonington) Gifford


Copyright and licence

Code and documentation copyright 2020 the email360 SSJS Lib under the MIT License.