adobe-to-docusign-migrator/bulk-send
Paul Huliganga c5b7b9f5b8 fix: resolve latent bugs found in code review
- Fix ValueError crash in migrate_template.py and migrate_paul_template.py:
  compose_template() returns a 3-tuple since Phase 23 but both CLI scripts
  were still unpacking 2 values
- Fix ImportError in bulk-send/bulk_send.py: replace non-existent auth_helper
  import with docusign_auth.get_access_token via sys.path
- Activate log sanitizer at web app startup so tokens never appear in logs
- Log a warning at startup when SESSION_SECRET_KEY is the default dev value
- Add reportlab to requirements.txt (used by generate_pdfs.py, was missing)
- Move asyncio import from bottom of templates.py to top where it belongs
- Correct stale coordinate comment in generate_pdfs.py (both platforms use
  top-left origin; the comment incorrectly described bottom-left inversion)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-23 09:51:20 -04:00
..
README.md Add bulk send prototype — script, sample CSV, and demo guide 2026-04-20 01:49:19 -04:00
bulk_send.py fix: resolve latent bugs found in code review 2026-04-23 09:51:20 -04:00
recipients.csv Add bulk send prototype — script, sample CSV, and demo guide 2026-04-20 01:49:19 -04:00

README.md

DocuSign Bulk Send — Demo Guide

What is Bulk Send?

Bulk Send lets you send one template to many recipients at once — each gets their own unique envelope, personalized with their name, email, and custom field values.

Files in This Directory

File Purpose
bulk_send.py Main script — creates bulk list, envelope, and sends
recipients.csv Sample recipient list (5 demo contacts)

CSV Format

Name,Email,Company,Title,CustomField1
Alice Johnson,alice.johnson@example.com,Acme Corp,CEO,CONTRACT-001
Column Maps To
Name Recipient display name
Email Recipient email address
Company Tab value in template (Company tab)
Title Tab value in template (Title tab)
CustomField1 Envelope custom field (tracking/reference)

How to Run

Dry Run (safe — no emails sent)

source venv/bin/activate
python3 bulk-send/bulk_send.py \
  --template-id <YOUR_TEMPLATE_ID> \
  --csv bulk-send/recipients.csv \
  --dry-run

Live Send

python3 bulk-send/bulk_send.py \
  --template-id <YOUR_TEMPLATE_ID> \
  --csv bulk-send/recipients.csv

How It Works (3 API Calls)

1. POST /bulk_send_lists        → Upload recipient list → get bulk_list_id
2. POST /envelopes              → Create draft envelope from template → get envelope_id
3. POST /bulk_send_lists/{id}/send → Trigger send → get batch_id

Each recipient gets:

  • Their own envelope
  • Pre-filled tabs (name, company, title)
  • Unique signing link via email

DocuSign API Docs


Notes for Customer Demo

  • Uses demo environment (demo.docusign.net) — no real emails sent
  • Template must have a signer role named "Signer"
  • Tabs in template must be named Company and Title to auto-fill from CSV
  • Batch status can be checked via: GET /bulk_send_batch/{batchId}