Giter Site home page Giter Site logo

bvelitchkine / phone-parser Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 23 KB

๐Ÿ“ฑ Companies get answers to their emailing campaigns from their prospects. There often are phone numbers in those replies. This automation parses messages from a gmail mailbox to extract phone numbers and update the phone number on the corresponding contact entity in the CRM of the company.

JavaScript 100.00%

phone-parser's Introduction

Phone Parsing

Purpose

๐Ÿ“ฑ Companies often send a lot of emails to their prospects and when they get answers, there's usually a phone number somewhere in the email. It's not too crazy to think that the phone number found in an email is the phone number of the prospect.

However, people reading those replies might forget to update the phone numbers in the CRM when they find a new one.

This Google Apps Script project is an automation that automatically parses emails received in a specific mailbox to the corresponding entities in the company's CRM.

Code organization

Classes

There are three classes files: MailService.js, PhoneParser.js and SheetInteractions.js and BullHorn.js.

In each of these files, there is a single function that acts like a class. A few methods are attached to each of the classes. Methods attached to MailService, for instance, only deal with the user's mailbox (Gmail for the time being). This orginization allows for better code segmentation and clarity.

Variables files

There's a single variables files: variables.js which contains global variables required to run the project.

Main file

This file contains only two "encapsulating" functions. These are the functions to set a trigger for in Google Apps Script. They're the only function the admin should worry about. It encompasses the whole project's logic.

Installation

Pre-Requisites

  1. You have a Bullhorn CRM (the only CRM we're dealing with at the moment) and GMail mailbox.
  2. (Optional) You installed @google/clasp and know how to use it in your CLI.
  3. You're following this tutorial.

Tutorial

  1. Fork this repo on your github profile and clone it into your machine.

  2. Create a secret.js file and put your credentials in it, like so:

    function secret() {
      const authUrl = "***";
      const restUrl = "***";
      const clientId = "***";
      const username = "***";
      const password = "***";
      const apiSecret = "***";
    
      return Object.freeze({
        authUrl,
        restUrl,
        clientId,
        username,
        password,
        apiSecret,
      });
    }
  3. In variables.js change the spreadsheet id to the id of the spreadsheet you duplicated:

    return Object.freeze({
        ...
        "SPREADSHEET": {
            "spreadsheetId": "๐Ÿ‘‰ Spreadsheet Id Here ๐Ÿ‘ˆ ",
    });
  4. Still in variables.js add phone numbers to the list of stop phone numbers as well as regular expression for the domains to ignore:

     return Object.freeze({
       ...,
       "PROCESSING": {
         "phoneStopList": ["+33794875467"],
         "domainStopList": [/@company.com/g]
       }
     });
    };

    Indeed, emails sent by someone from the company (emails that have a specific domain then) ought to be ignored, we won't find phone numbers of interest inside. The same goes for phone numbers. When people from the company send emails, they usually put their phone numbers in the signature. But if someone replies to that very email, we might find the phone number sent in the first place in this reply. We're not interested in it either.

  5. Clasp push the code from your local repo to the Google Apps Script project attached to the spreadsheet you just duplicated.

Ackowledgements

Coded with grit ๐Ÿ’ช by Bastien Velitchkine.

phone-parser's People

Contributors

bvelitchkine avatar

Watchers

 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.