Skip to main content

Salesforce

Sending data to sf​

As users go through planning/preneed we send their data to mailchimp and salesforce. This is done via an agenda job because there’s no need for the user to wait for this execution. The job lives in v2/jobs/preneedUserToSFandMC.js

If the environment is production, then send data to sales force via the v2/preneed/etc/updateSalesForceLead.js. This is a long ugly mapping of data before sending it to salesforce - which is finicky, most errors are handled but every now and then it returns something different. Ultimately we want it to return a salesforce id that we store as user.sfRef .. On the salesforce side of things itself, thats Bryan Kata’s space and he can show you that.

A couple other files and things .. in the svr-models package under etc/salesforce is where core salesforce calls live .. they were always there and i never had time to move them out. We don’t (well if we do i dont know about it) have a dev salesforce environment. Notice in the svr-env package the salesforce config data under base.js and envs/prod.js .. only the prod data works.

Receiving data from sf via zapier​

Data for users (contacts - primarily funeral directors), funeral homes (locations) and companies (accounts) is kept in salesforce; yes they are called those different (names) in salesforce and by our customer service team. It would have been nice to code our models in the same business domain language but nouns around here change like the weather. We want to allow the CS team to make changes to data in salesforce and have that reflected in our everdays database so that directors can then use our dashboard accordingly; ie accounts etc are setup and managed in salesforce first. We use Zapier to handle changes in salesforce to then send those changes to our svr-api v2/crm endpoints. The data coming in can be strange. Zapier can also suddenly stop doing transactions or disconnect from an account. It all works in general at least, but something to be aware of, especially when BK says something is in Salesforce but weird in everdays. The zaps are in https://zapier.com/app/zaps .. once you login, switch your account to Everdays, and then look for evdy zaps under Shared Folders.