Giter Site home page Giter Site logo

movableink / blocksdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from salesforce-marketingcloud/blocksdk

0.0 6.0 0.0 4 KB

Public SDK for the Salesforce Marketing Cloud Content Builder Editor

License: BSD 3-Clause "New" or "Revised" License

JavaScript 100.00%

blocksdk's Introduction

Salesforce Marketing Cloud Content Builder Editor Block SDK

Introduction

This SDK is intended to simplify 3rd party block development for the Salesforce Marketing Cloud Content Builder Editor. It provides domain validation and simple method calls wrapping around the cross-document messaging the editor uses to communicate with 3rd party blocks.

Installation

The SDK can be used as a simple script tag, or pulled in as a node module.

Tag:

<html>
  <head></head>
  <body>
    <script src="path/to/blocksdk.js"></script>
    <script>
      var sdk = new window.sfdc.BlockSDK();
      // do something with the sdk
    </script>
  </body>
</html>

Module:

var SDK = require('blocksdk');
var sdk = new SDK();
// do something with the sdk

Usage

Once you have an instantiated SDK, the following methods are available to you:

  • getContent(callback) - callback gets passed a content string
  • setContent(contentString, callback) - callback gets passed a confirmation content string
  • getData(callback) - callback gets passed an object with custom block metadata
  • setData(dataObject, callback) - callback gets passed a confirmation object
  • setSupercontent(contentString, callback) - callback gets passed a confirmation superContent string

Example:

var sdk = new window.sfdc.BlockSDK();
sdk.getContent(function (content) {
  content += '.';
  sdk.setContent(content, function (setContent) {
    // block content is now its original content + '.'
  });
});

blocksdk's People

Contributors

tbesluau avatar jvvlee avatar

Watchers

Lee Bankewitz avatar Michael Nutt avatar James Cloos avatar Matt Chesler avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.