Giter Site home page Giter Site logo

rahman123 / einstein-email-bot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sfdc-assets/einstein-email-bot

0.0 2.0 0.0 1.2 MB

A basic design pattern with code to create an email bot in Salesforce

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

Apex 100.00%

einstein-email-bot's Introduction

Email Bot in Salesforce

This project includes everything you need to deliver Email-To-Flow functionality for Salesforce. This functionality makes it easy to build email response automation with no code in a Salesforce org.

In the source provided, Apex will first recieve an incoming email, convert that email into an Apex Object, and then determine all of the intent, sentiment, and NER using Einstein Platform Services before kick-starting a Flow with the email and Einstein insight in tow.

This allows admins to manage logic around inbound emails. For this specific example, an admin wanted to send an auto-reply email with order information when a customer asks about order status.

Email Bot Design Diagram

Flow Variables

  • Create_Case - Boolean - defaults to true. If you do not want a case created from the email, set this to false. There is some apex written (EmailToCaseUtility) to save binary attachments and email information to the case that is created.
  • New_Case - Case - fields filled out in this Case record will be used to create a case in EmailToCaseUtility
  • Received_Email - EmailBotObject - holds all of the email information (from address, to addresses, text body, subject... etc) as well as results from Einstein Intent and Sentiment.

Custom Metadata Type

When you create a new instance of the custom metadata, the code is looking for one called "Email Bot".

  • Case Origin - When case is created, this value will populate to the Case Origin field.
  • Case Status - When case is created, this value will be populated to the Case Status field.
  • Intent Model ID - ID for Einstein Intent model.
  • NER Model ID - Entity Recognition isn't included in this version, but the infrastructure is there. This defaults to NER7.
  • Sentiment Model ID - ID for Einstein Sentiment model. This defaults to the CommunitySentiment model. Support Queue ID

Installation Instructions

Install has dependency on these Managed Packages

  1. Unofficial SF - Flow Base Components
  2. Unofficial SF - Send Better Email Flow Action
  3. Einstein Playground App

Installation

  1. Install the Unofficial SF - Flow Base Components and Unofficial SF - Send Better Email Flow Action unmanaged packages. This will give the bot the ability to send emails using email templates from a Flow. While installing both of these unmanaged packages, there's an advanced settings tab in the package installation prompt for each one, make sure you select "Compile Only Apex in the Package".
  2. Install Einstein Playground App
  3. Install code and configuration from this GitHub repo using DX or this install button Deploy to Salesforce
  4. Intent: build an intent model or use one that already exists in your org. Add Model ID to Custom Metadata, add the model ID to the Email Bot Setting custom metadata.
  5. Sentiment: build a sentiment model, use one that already exists in your org, or use the CommunitySentiment model. Add the model ID to the Email Bot Setting custom metadata.
  6. Entity Recognition: for testing purposes I used NER7.
  7. For testing, create a custom email service that uses the inbound email handler.
  8. Ship it โš“๏ธ

License

BSD-3-Clause License

einstein-email-bot's People

Contributors

iiretepii avatar frankcaron avatar svc-scm avatar

Watchers

James Cloos 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.