GithubHelp home page GithubHelp logo

salesforce-mc-sample-app's Introduction

Sample App Custom Data Transfer service (Salesforce CMS to Marketing cloud content )

*This code is sample app to achieve the integration between Salesforce CMS and Marketing cloud. Please don't consider it as an official tool

This is a node js server with worker does following things.

  1. Pull data from CMS via OAuth and CMS API
  2. Copy and Push content to Marketing cloud Content builder
  3. Cron job that keeps both the content in Sync

Salesforce CMS credentials

In Salesforce, Create a connected app and enter the crendentials in .env file as below

create ".env" file with following values updated.

CMS_HOST=https://login.salesforce.com/
CMS_TOKEN_ENDPOINT=/services/oauth2/token
CREATE_CONTENTTYPE_ENDPOUNT = /services/data/v49.0/tooling/sobjects/ManagedContentType/
CMS_CLIENTID=
CMS_CLIENTSECRETID=
CMS_USERNAME=
CMS_PASS=<passwd+token>
CMS_API_DOMAINPATH=
CMS_API_BASEPATH=/services/data/v49.0/connect/communities/
CMS_ASSET_BASEPATH=<community url with out /s/>
COMMUNITY_ID=
CONTENT_ID=\

#Channel API CMS_DELIVERY_API_BASEPATH=/services/data/v49.0/connect/cms/delivery/channels/
CHANNEL_ID=
CMS_API_CHANNEL_END_POINT=/contents/query
CMS_API_ASSET_PATH=/services/data/v49.0/connect
CONTENT_TYPE=

Marketing Cloud Credentails

Create an app in marketing cloud and then enable API integration.

MC_TOKEN_ENDPOINT=
MC_HOST=
MC_CLIENTID=
MC_CLIENTSECRET=
MC_ASSETS_API_PATH=
MC_ASSET_TYPE_IMAGE_ID=<Asset Type ID, available in the Marketing cloud api reference>
https://developer.salesforce.com/docs/atlas.en-us.noversion.mc-apis.meta/mc-apis/base-asset-types.htm?search_text=img
MC_ASSET_FOLDER_ID=

Use the secure .env npm module and encrypt the .env file and delete it Reference: https://www.npmjs.com/package/secure-env

Installing Local Dependencies

$ brew install redis
$ brew services start redis

Getting Started

  1. npm install
  2. npm start
  3. http://localhost:5000

Deploying

$ git clone [email protected]:heroku-examples/node-workers-example.git
$ cd node-workers-example

$ heroku create
$ heroku addons:create heroku-redis
$ git push heroku master
$ heroku ps:scale worker=1
$ heroku open

Application Overview

The application is comprised of two process:

  • web - An Express server that serves the frontend assets, accepts new background jobs, and reports on the status us existing jobs
  • worker - A small node process that listens for and executes incoming jobs

Because these are separate processes, they can be scaled independently based on specific application needs. Read the Process Model article for a more in-depth understanding of Heroku’s process model.

The web process serves the index.html and client.js files which implement a simplified example of a frontend interface that kicks off new jobs and checks in on them.

salesforce-mc-sample-app's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  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.