Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

moego-onboarding

CI

Overview

Automates the client onboarding process for MoeGo-based pet service businesses. When a new appointment is created in MoeGo, this tool retrieves the client's unique agreement signing links and card-on-file link, generates a personalized token-based landing page URL, and emails it to the business owner — reducing manual link generation and delivery to a single step.

Features

  • Listens for APPOINTMENT_CREATED webhook events from MoeGo
  • Detects first-time clients via the MoeGo Appointments API — skips returning clients automatically
  • Retrieves per-client agreement sign links and card-on-file link via MoeGo API
  • Generates a unique, expiring token URL pointing to a personalized client landing page
  • Shortens the token URL via Short.io and emails it to the business owner for delivery
  • Landing page renders the client's onboarding steps — agreements, card on file, and vaccination record upload
  • Vaccination records uploaded directly to Google Drive, prefixed with the client's name
  • Graceful failure handling — partial failures email the business owner with recovery details and the customer's MoeGo ID

Tech Stack

  • Runtime: Node.js >= 20
  • Language: TypeScript
  • Testing: Vitest
  • Apps Script: Google Apps Script via Clasp
  • Linting: ESLint (Airbnb config)
  • CI/CD: GitHub Actions

Getting Started

Prerequisites

  • Node.js >= 20
  • pnpm >= 9
  • A Google account with Apps Script access and the Apps Script API enabled
  • Clasp installed and configured — see Clasp Setup
  • A MoeGo account with API access and a Customer Success Manager-issued API key
  • A Google Sheet and Google Drive folder — see Sheet & Drive Setup
  • A Short.io account with an API key and custom domain — see Short.io Setup

Installation

  1. Clone the repository:

    git clone https://github.com/scottgilmoredev/moego-onboarding.git
    cd moego-onboarding
  2. Install dependencies:

    pnpm install
  3. Set up Clasp — see Clasp Setup

Running Tests

pnpm run test

Development Build

pnpm run build

Project Structure

src/
 ┣ webhook/       # MoeGo webhook receiver and validation
 ┣ moego/         # MoeGo API client (agreements, appointments, customer data)
 ┣ token/         # Per-client token generation, storage, and expiry
 ┣ sheet/         # Google Sheets client for client row writes
 ┣ shortener/     # Short.io URL shortening
 ┣ email/         # Email delivery to business owner
 ┣ types/         # Shared TypeScript types
 ┣ utils/         # Shared utilities and helpers
 ┣ templates/     # HTML templates for landing page and error page
 ┣ server.ts      # Apps Script web app entrypoint (doPost, doGet, uploadVaccinationRecord)

CI/CD

  • GitHub Actions runs linting, tests, and build on every push and pull request

Roadmap

See Milestones for planned enhancements and future development.

Documentation

About

Automates MoeGo client onboarding by generating a personalized token-based landing page for each new client and delivering the link to the business owner via email.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Contributors

Languages