jaizendra-netizen / reply-label-mix
PHP CLI and library: count the labels you gave to email replies, overall and per campaign, with an optional positive share for the labels you name.
Package info
github.com/jaizendra-netizen/reply-label-mix
Type:project
pkg:composer/jaizendra-netizen/reply-label-mix
Requires
- php: >=8.1
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is not auto-updated.
Last update: 2026-11-30 03:34:25 UTC
README
PHP command line tool and library. Give it a CSV with one row per reply to your outreach, the campaign it belongs to and a label that you gave it, by hand or with your own tool (for example interested, not now or out of office). It counts the labels overall and per campaign and, if you name the labels you count as positive, shows the positive share of each campaign and of everything. It does no classification and calls no AI service: the labels, the list of positive labels and the minimum campaign size are yours. Labels and campaigns are trimmed and matched without regard to case, and the first spelling seen is shown. Labels are sorted by count (highest first, then by name) and campaigns by number of replies (highest first, then by name). A campaign with fewer replies than --min-replies is left out of the per campaign list and the output says how many were hidden; the overall mix and the overall positive share still count every reply. A label named in --positive that never occurs in the file only produces a warning line. All percentages are rounded to 1 decimal. The numbers describe your file; a campaign with a handful of replies says little.
Part of the OneGTMLab free GTM tools. Background on the idea: Instantly vs QuickMail.
Install
composer require jaizendra-netizen/reply-label-mix
Use
Input is a CSV with the columns reply_id, campaign and label. Column names are matched without regard to case and may be in any order. Option --positive "a,b" is a comma list of labels, matched without regard to case, set by you. Option --min-replies N (a whole number of 1 or more, default 1, set by you) hides campaigns with fewer than N replies. The command stops at the first bad row and names it. A duplicate reply_id, an empty reply_id, campaign or label, a missing column, a row with the wrong number of cells, a file with no rows, a bad --min-replies or an empty --positive exits 1 with a message; an unreadable file, an unknown option or an option without a value exits 2.
$ php bin/reply-label-mix sample.csv --positive "interested,meeting booked" --min-replies 2
replies read: 11, campaigns: 3, minimum replies per campaign: 2 (set by you)
overall label mix:
Interested: 3 (27.3%)
not now: 3 (27.3%)
Meeting booked: 2 (18.2%)
Out of office: 2 (18.2%)
Unsubscribe: 1 (9.1%)
campaign Campaign Alpha: 5 replies
Interested: 2 (40.0%)
Meeting booked: 1 (20.0%)
not now: 1 (20.0%)
Out of office: 1 (20.0%)
positive: 3 of 5 (60.0%)
campaign Campaign Beta: 5 replies
not now: 2 (40.0%)
Interested: 1 (20.0%)
Meeting booked: 1 (20.0%)
Unsubscribe: 1 (20.0%)
positive: 2 of 5 (40.0%)
hidden by the minimum replies: 1 campaign
overall positive (interested, meeting booked): 5 of 11 (45.5%)
Test
php tests/run.php
Offline, no network calls, no dependencies beyond the language runtime. MIT licensed.