Repository navigation
Expand file tree
/
Copy pathcontent.py
More file actions
763 lines (748 loc) · 35.3 KB
/
Copy pathcontent.py
File metadata and controls
763 lines (748 loc) · 35.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
"""Email subject / body / reply generators.
Templates are keyed so we can record the last one used per (inbox, kind) in SQLite
and avoid using the same template twice in a row for the same sender.
"""
from __future__ import annotations
import random
from dataclasses import dataclass
import database
@dataclass(frozen=True)
class Template:
key: str
subject: str
body: str
_SEND_TEMPLATES: list[Template] = [
Template(
"checkin_short",
"Quick follow up",
"Hey {to_first},\n\nJust wanted to follow up on what we were chatting about. "
"Let me know when you have a sec.\n\nThanks,\n{from_first}",
),
Template(
"project_update",
"Quick update",
"Hi {to_first},\n\nWanted to share a quick update on the project — making good progress this week "
"and a couple things landed cleanly. Happy to walk through it when you have time.\n\nBest,\n{from_first}",
),
Template(
"question_meet",
"Got a few minutes this week?",
"Hi {to_first},\n\nDo you have a few minutes to connect this week? I've got a couple of small "
"questions and figured it'd be quicker to talk than type it all out.\n\nThanks,\n{from_first}",
),
Template(
"casual_thanks",
"Thanks for the help",
"Hey {to_first},\n\nThanks for sending that over the other day — really helpful. Saved me a "
"good chunk of time digging through it myself.\n\nAppreciate it,\n{from_first}",
),
Template(
"meeting_confirm",
"Thursday 2pm?",
"Hi {to_first},\n\nDoes Thursday at 2pm work for you? Happy to flex earlier or later if that's tight. "
"Let me know what works on your end.\n\nThanks,\n{from_first}",
),
Template(
"doc_share",
"Doc for your review",
"Hi {to_first},\n\nWhen you have a minute, would love a second pair of eyes on the doc I'm putting "
"together. No rush — anytime this week is fine.\n\nThanks!\n{from_first}",
),
Template(
"intro_warm",
"Touching base",
"Hey {to_first},\n\nTouching base — it's been a bit. How's everything going on your side? "
"Curious to hear what you've been working on lately.\n\nTalk soon,\n{from_first}",
),
Template(
"schedule_swap",
"Schedule shuffle",
"Hi {to_first},\n\nQuick one — would it be okay to push our chat back by a day? Something came up "
"but I want to make sure we still get the time in.\n\nThanks for the flexibility,\n{from_first}",
),
Template(
"small_win",
"Small win today",
"Hey {to_first},\n\nJust a quick note — the thing we'd been chasing finally landed. Felt like you'd "
"want to know. Beers on me next time.\n\nCheers,\n{from_first}",
),
Template(
"asking_input",
"Want your take",
"Hi {to_first},\n\nWanted to get your take on something when you have a moment. Nothing urgent — "
"just trust your read on this kind of thing.\n\nThanks,\n{from_first}",
),
Template(
"quick_question",
"Quick question",
"Hey {to_first},\n\nQuick question for you when you get a sec — nothing major, just want to "
"make sure I'm not missing anything obvious.\n\nThanks,\n{from_first}",
),
Template(
"status_nudge",
"Where are we on this?",
"Hi {to_first},\n\nWhere are we landing on this one? No pressure — just trying to line up my "
"side around it.\n\nThanks,\n{from_first}",
),
Template(
"kudos",
"Nice work",
"Hey {to_first},\n\nJust wanted to say nice work on that — came together really well. Made the "
"rest of it a lot easier.\n\nCheers,\n{from_first}",
),
Template(
"heads_up",
"Heads up",
"Hi {to_first},\n\nQuick heads up so it's not a surprise later — timing shifted slightly on my "
"end but nothing that should affect you.\n\nThanks,\n{from_first}",
),
Template(
"move_earlier",
"Could we move earlier?",
"Hi {to_first},\n\nAny chance we could move our time a bit earlier? Totally fine if not — just "
"trying to free up the afternoon.\n\nThanks,\n{from_first}",
),
Template(
"free_friday",
"Free Friday?",
"Hey {to_first},\n\nAre you around Friday? Would be good to close the loop on a couple of things "
"before the week's out.\n\nThanks,\n{from_first}",
),
Template(
"recap",
"Recap from earlier",
"Hi {to_first},\n\nQuick recap of where we got to so we're on the same page — happy to expand on "
"any of it if useful.\n\nBest,\n{from_first}",
),
Template(
"need_eyes",
"Mind taking a look?",
"Hey {to_first},\n\nWould you mind glancing at this when you have a moment? Just want a sanity "
"check before I take it further.\n\nThanks,\n{from_first}",
),
Template(
"two_min_call",
"Two-minute call?",
"Hi {to_first},\n\nGot two minutes for a quick call later? Faster to say it than write it all "
"out, honestly.\n\nThanks,\n{from_first}",
),
Template(
"thanks_intro",
"Thanks for the intro",
"Hey {to_first},\n\nThanks for the intro the other day — already turned into a good conversation. "
"Appreciate you thinking of it.\n\nCheers,\n{from_first}",
),
Template(
"hows_it_coming",
"How's it coming?",
"Hi {to_first},\n\nHow's it coming along on your end? No rush at all — just keeping a loose eye "
"on the moving pieces.\n\nThanks,\n{from_first}",
),
Template(
"an_idea",
"An idea",
"Hey {to_first},\n\nHad an idea I wanted to run past you — might be nothing, but figured it was "
"worth a quick gut check.\n\nTalk soon,\n{from_first}",
),
Template(
"sorry_delay",
"Sorry for the delay",
"Hi {to_first},\n\nSorry for the slow reply on this — back on it now. Let me know if anything "
"changed in the meantime.\n\nThanks,\n{from_first}",
),
Template(
"looping_in",
"Looping you in",
"Hi {to_first},\n\nLooping you in so you've got the context — nothing needed from you right now, "
"just keeping you in the picture.\n\nBest,\n{from_first}",
),
Template(
"next_steps",
"Next steps",
"Hi {to_first},\n\nWanted to nail down next steps so nothing slips. I'll take the first part — "
"shout if you'd rather split it differently.\n\nThanks,\n{from_first}",
),
Template(
"coffee_week",
"Coffee this week?",
"Hey {to_first},\n\nAny interest in grabbing coffee this week? Been meaning to catch up properly "
"rather than just over email.\n\nCheers,\n{from_first}",
),
Template(
"just_checking",
"Just checking in",
"Hi {to_first},\n\nJust checking in — how are things on your side? Holler if there's anything I "
"can take off your plate.\n\nThanks,\n{from_first}",
),
Template(
"small_favor",
"Small favor",
"Hey {to_first},\n\nCould I ask a small favor when you get a chance? Quick one, shouldn't take "
"more than a minute of your time.\n\nThanks a lot,\n{from_first}",
),
Template(
"good_progress",
"Good progress",
"Hi {to_first},\n\nDecent progress this week — wanted to flag it while it's fresh. Will have more "
"to share by next week.\n\nBest,\n{from_first}",
),
Template(
"quick_sync",
"Quick sync?",
"Hey {to_first},\n\nWorth a quick sync at some point? Feels like a five-minute chat would save a "
"longer back-and-forth here.\n\nThanks,\n{from_first}",
),
Template(
"following_up_again",
"Circling back",
"Hi {to_first},\n\nCircling back on this so it doesn't drop off — totally fine if now's not the "
"moment, just didn't want to lose it.\n\nThanks,\n{from_first}",
),
Template(
"appreciate_patience",
"Appreciate your patience",
"Hey {to_first},\n\nAppreciate you being patient while I sorted this out. Should be smoother from "
"here on.\n\nThanks,\n{from_first}",
),
Template(
"morning_checkin",
"Morning check-in",
"Morning {to_first},\n\nHoping you had a good start to the week. Wanted to see how things are "
"sitting on your end before we get too deep into it.\n\nThanks,\n{from_first}",
),
Template(
"end_of_week",
"Before the week's out",
"Hey {to_first},\n\nWanted to touch base before the week closes — are we still on track with "
"everything we talked about? Let me know if anything shifted.\n\nCheers,\n{from_first}",
),
Template(
"monday_ping",
"Happy Monday",
"Hi {to_first},\n\nHope the weekend treated you well. Quick ping to see if you had a chance to "
"look at that thing we discussed.\n\nThanks,\n{from_first}",
),
Template(
"availability_check",
"Availability this week",
"Hi {to_first},\n\nWhat does your week look like? Trying to find a slot that works on both sides "
"for a quick catch-up.\n\nThanks,\n{from_first}",
),
Template(
"lunch_invite",
"Lunch sometime?",
"Hey {to_first},\n\nAny interest in grabbing lunch this week or next? Would be nice to catch up "
"outside of the usual back-and-forth.\n\nTalk soon,\n{from_first}",
),
Template(
"opinion_request",
"Curious what you think",
"Hi {to_first},\n\nWanted to get your opinion on something — you usually have a good read on "
"this kind of thing and I trust your instinct.\n\nThanks,\n{from_first}",
),
Template(
"fyi_note",
"FYI",
"Hi {to_first},\n\nJust wanted to flag this for you — no action needed, just thought you'd "
"want to be in the loop.\n\nBest,\n{from_first}",
),
Template(
"clarify_question",
"Quick clarification",
"Hey {to_first},\n\nOne quick thing I wanted to clarify before I move ahead — just want to make "
"sure I've got the right picture.\n\nThanks,\n{from_first}",
),
Template(
"confirm_receipt",
"Just confirming",
"Hi {to_first},\n\nJust wanted to confirm you received what I sent over earlier. Let me know "
"if anything didn't come through properly.\n\nThanks,\n{from_first}",
),
Template(
"congrats_note",
"Congrats!",
"Hey {to_first},\n\nJust heard the news — congrats! Really well deserved. Hope you're "
"taking a moment to enjoy it.\n\nCheers,\n{from_first}",
),
Template(
"stalled_thread",
"Picking this back up",
"Hi {to_first},\n\nWanted to pick this thread back up — it went quiet on my side for a bit "
"but I haven't forgotten about it.\n\nThanks,\n{from_first}",
),
Template(
"offer_help",
"Let me know if I can help",
"Hey {to_first},\n\nIf there's anything I can take off your plate right now, just say the word. "
"Happy to pitch in where it makes sense.\n\nCheers,\n{from_first}",
),
Template(
"idea_to_run",
"Wanted to run something by you",
"Hi {to_first},\n\nHad a thought I wanted to run by you — might be worth exploring, might not, "
"but figured your take would help me decide.\n\nTalk soon,\n{from_first}",
),
Template(
"propose_call",
"Worth a quick call?",
"Hi {to_first},\n\nWould it be worth hopping on a quick call about this? I think we could "
"clear it up pretty fast if we just talked it through.\n\nThanks,\n{from_first}",
),
Template(
"follow_up_polite",
"Following up",
"Hey {to_first},\n\nFollowing up on the note I sent last week — no stress if it's not the "
"right time, just didn't want it to slip through.\n\nThanks,\n{from_first}",
),
Template(
"share_thought",
"A thought",
"Hi {to_first},\n\nHad a thought that felt relevant to what you're working on. Not sure if "
"it's useful but wanted to share it anyway.\n\nBest,\n{from_first}",
),
Template(
"how_did_it_go",
"How did it go?",
"Hey {to_first},\n\nHow did that go? I was curious to hear how it landed — hope it went "
"smoothly.\n\nTalk soon,\n{from_first}",
),
Template(
"reschedule_ask",
"Need to reschedule",
"Hi {to_first},\n\nSomething came up on my end and I need to move our time — sorry for "
"the inconvenience. Does [another time] work for you?\n\nThanks,\n{from_first}",
),
Template(
"morning_thought",
"Morning thought",
"Morning {to_first},\n\nSomething popped into my head this morning that I thought was worth "
"passing on. Probably low stakes but felt relevant.\n\nBest,\n{from_first}",
),
Template(
"flagging_small_win",
"Small thing worth flagging",
"Hey {to_first},\n\nJust a small win worth flagging — one of those things that's easy to "
"miss but actually moved the needle a bit.\n\nCheers,\n{from_first}",
),
Template(
"nudge_gentle",
"Gentle nudge",
"Hi {to_first},\n\nI know you're busy — just a gentle nudge on this since I don't want it "
"to fall too far back in the queue.\n\nThanks,\n{from_first}",
),
Template(
"check_progress",
"Checking on progress",
"Hi {to_first},\n\nWanted to check in on where things stand — no pressure, just doing a "
"bit of a status sweep on my side.\n\nThanks,\n{from_first}",
),
Template(
"wrap_up_thread",
"Wrapping this up",
"Hey {to_first},\n\nI think we're close to done here — just want to make sure we're aligned "
"before I close the loop on my side.\n\nBest,\n{from_first}",
),
Template(
"quick_favor",
"Quick favor to ask",
"Hi {to_first},\n\nWould you be able to help me out with something small? Shouldn't be more "
"than a few minutes on your end.\n\nAppreciate it,\n{from_first}",
),
Template(
"short_summary",
"Summary from yesterday",
"Hi {to_first},\n\nHere's a quick summary of where we got to — wanted to write it down "
"while it's fresh so nothing gets lost.\n\nBest,\n{from_first}",
),
Template(
"tuesday_touch",
"Touching base mid-week",
"Hey {to_first},\n\nTouching base mid-week — how's everything tracking on your side? Hopefully "
"not too hectic.\n\nTalk soon,\n{from_first}",
),
Template(
"send_thanks_review",
"Thanks for the review",
"Hi {to_first},\n\nThanks for taking the time to look it over — your notes were exactly what I "
"needed. Made a big difference.\n\nAppreciate it,\n{from_first}",
),
Template(
"quick_heads_up",
"Just a heads-up",
"Hey {to_first},\n\nJust a heads-up before this catches you off guard — nothing serious, but "
"thought you'd want to know ahead of time.\n\nCheers,\n{from_first}",
),
Template(
"time_confirm",
"Confirming the time",
"Hi {to_first},\n\nJust confirming the time we locked in — still works on my end. Let me know "
"if anything's changed on yours.\n\nThanks,\n{from_first}",
),
Template(
"light_apology",
"My fault on that one",
"Hey {to_first},\n\nMy fault on the mix-up — should have been clearer. Fixed my end, let me "
"know if it looks right to you now.\n\nThanks,\n{from_first}",
),
Template(
"checking_alignment",
"Making sure we're aligned",
"Hi {to_first},\n\nWanted to do a quick check to make sure we're still aligned on this — felt "
"like a good moment to sync before it moves forward.\n\nBest,\n{from_first}",
),
Template(
"open_slot",
"Open slot tomorrow",
"Hey {to_first},\n\nI've got an open slot tomorrow afternoon if that works — happy to use it "
"to go over things.\n\nThanks,\n{from_first}",
),
Template(
"sharing_update",
"Sharing a quick update",
"Hi {to_first},\n\nWanted to share a quick update so you're not in the dark — things are "
"moving along but a few small things are still in flight.\n\nBest,\n{from_first}",
),
Template(
"hows_everything",
"How's everything going?",
"Hey {to_first},\n\nHow's everything going? It's been a while and I realized I've been "
"meaning to check in.\n\nTalk soon,\n{from_first}",
),
Template(
"end_of_day_note",
"Before I wrap up",
"Hi {to_first},\n\nBefore I wrap up for the day — wanted to send this over while I was "
"thinking about it.\n\nThanks,\n{from_first}",
),
Template(
"input_on_approach",
"Thoughts on the approach?",
"Hi {to_first},\n\nWanted to get your thoughts on the approach before I go any further. "
"Happy to talk through it briefly if that's easier.\n\nThanks,\n{from_first}",
),
Template(
"back_in_office",
"Back at my desk",
"Hey {to_first},\n\nBack at my desk and working through the queue — will have a proper reply "
"to you shortly. Thanks for your patience.\n\nBest,\n{from_first}",
),
Template(
"quick_update_note",
"Very quick update",
"Hi {to_first},\n\nVery quick update — something shifted slightly but nothing that changes "
"the overall picture. Wanted to keep you posted.\n\nThanks,\n{from_first}",
),
Template(
"sense_check",
"Sense check",
"Hey {to_first},\n\nCould you sense-check something for me? Just want a second opinion "
"before I commit to it.\n\nThanks a lot,\n{from_first}",
),
Template(
"one_more_thing",
"One more thing",
"Hi {to_first},\n\nOne more thing I forgot to mention — worth knowing before you go "
"too far down the road on it.\n\nThanks,\n{from_first}",
),
Template(
"appreciate_update",
"Thanks for keeping me posted",
"Hey {to_first},\n\nThanks for keeping me posted on this — really appreciate the "
"visibility. Helps me plan on my side.\n\nCheers,\n{from_first}",
),
Template(
"week_ahead",
"Looking ahead this week",
"Hi {to_first},\n\nLooking at the week ahead — anything you need from me to keep things "
"moving? Happy to clear the path where I can.\n\nBest,\n{from_first}",
),
Template(
"late_reply_sorry",
"Late getting back to you",
"Hi {to_first},\n\nSorry for the late reply — wasn't ignoring you, just got buried. "
"Still very much on my radar.\n\nThanks,\n{from_first}",
),
Template(
"passing_thought",
"Passing thought",
"Hey {to_first},\n\nHad a passing thought that might be worth five minutes of your time — "
"probably nothing but could be something.\n\nTalk soon,\n{from_first}",
),
Template(
"connect_soon",
"Let's connect soon",
"Hi {to_first},\n\nWe should find a time to connect — it's been a while and I've got a "
"couple of things that would be easier to hash out in person.\n\nThanks,\n{from_first}",
),
Template(
"things_on_track",
"Things looking on track",
"Hey {to_first},\n\nJust a note to say things are looking on track from where I'm sitting — "
"will flag if anything changes.\n\nCheers,\n{from_first}",
),
Template(
"forwarding_context",
"Some background",
"Hi {to_first},\n\nSending this your way with a bit of background so you've got the full "
"picture. Let me know if you have questions.\n\nBest,\n{from_first}",
),
Template(
"afternoon_ping",
"Afternoon ping",
"Hey {to_first},\n\nHope the afternoon's going smoothly. Quick ping — do you have a "
"moment to look at something?\n\nThanks,\n{from_first}",
),
Template(
"post_holiday",
"Hope you had a good break",
"Hi {to_first},\n\nHope you had a good break — welcome back! No rush on anything, just "
"getting threads back in order on my end.\n\nCheers,\n{from_first}",
),
Template(
"pre_holiday",
"Before you head out",
"Hey {to_first},\n\nBefore you head out for the break — just wanted to sort this one "
"thing so it doesn't linger.\n\nThanks,\n{from_first}",
),
Template(
"second_opinion",
"Second opinion?",
"Hi {to_first},\n\nWould you mind giving me a second opinion on this? I want to make sure "
"I'm not missing something before I move forward.\n\nAppreciate it,\n{from_first}",
),
Template(
"noting_progress",
"Noting the progress",
"Hey {to_first},\n\nJust wanted to note the progress here — it's easy to overlook when "
"you're in the thick of it, but it's real.\n\nCheers,\n{from_first}",
),
Template(
"keeping_posted",
"Keeping you posted",
"Hi {to_first},\n\nKeeping you posted as things develop — nothing dramatic yet, just "
"steady movement in the right direction.\n\nBest,\n{from_first}",
),
Template(
"request_slot",
"Any time this Thursday?",
"Hey {to_first},\n\nDo you have any time Thursday? Would be great to carve out even "
"twenty minutes if we can.\n\nThanks,\n{from_first}",
),
Template(
"works_better",
"What works better for you?",
"Hi {to_first},\n\nWanted to check — what works better for you, morning or afternoon? "
"Happy to go with whatever fits your schedule.\n\nThanks,\n{from_first}",
),
Template(
"brief_touch",
"Brief touch-base",
"Hey {to_first},\n\nJust a brief touch-base — everything's moving along but I wanted to "
"make sure we're still in sync before the end of the week.\n\nBest,\n{from_first}",
),
Template(
"appreciate_time",
"Thanks for your time",
"Hi {to_first},\n\nThanks for the time earlier — it was useful. I'll take it from here "
"and come back to you when there's something worth sharing.\n\nAppreciate it,\n{from_first}",
),
Template(
"share_result",
"Sharing the result",
"Hey {to_first},\n\nWanted to share how this turned out — you helped shape it and figured "
"you'd want to see the outcome.\n\nCheers,\n{from_first}",
),
Template(
"closing_loop",
"Closing the loop",
"Hi {to_first},\n\nJust closing the loop on this one — all sorted now. Thanks for bearing "
"with me through the back-and-forth.\n\nThanks,\n{from_first}",
),
Template(
"reachout_catchup",
"Long time no talk",
"Hey {to_first},\n\nLong time no talk! Hope things have been good. Would love to catch "
"up if you have a few minutes sometime this week.\n\nTalk soon,\n{from_first}",
),
Template(
"good_news",
"Good news",
"Hi {to_first},\n\nGood news — the thing we were waiting on finally came through. "
"Figured that's worth a quick note.\n\nBest,\n{from_first}",
),
Template(
"thoughts_welcome",
"Thoughts welcome",
"Hey {to_first},\n\nThoughts welcome on this — no pressure, just open to any reaction "
"you have.\n\nThanks,\n{from_first}",
),
Template(
"waiting_on_you",
"Waiting on your end",
"Hi {to_first},\n\nI think we're waiting on your side to move forward — no rush, just "
"flagging so it doesn't get lost.\n\nThanks,\n{from_first}",
),
Template(
"friendly_reminder",
"Friendly reminder",
"Hey {to_first},\n\nFriendly reminder on this one — not trying to nag, just don't want "
"it to get buried.\n\nThanks a lot,\n{from_first}",
),
Template(
"drop_by",
"Drop by?",
"Hi {to_first},\n\nAny chance you could drop by for a few minutes? Or happy to come to "
"you — whichever's easier.\n\nThanks,\n{from_first}",
),
Template(
"input_needed",
"Need your input",
"Hey {to_first},\n\nI'm at a point where I really need your input to move forward — "
"just a few minutes would unblock me.\n\nAppreciate it,\n{from_first}",
),
Template(
"wrap_before_holiday",
"Wrapping up before the break",
"Hi {to_first},\n\nWanted to get this sorted before everyone heads out. Should only "
"take a moment — happy to talk it through quickly.\n\nThanks,\n{from_first}",
),
Template(
"check_still_on",
"Still on for tomorrow?",
"Hey {to_first},\n\nJust double-checking we're still on for tomorrow — wanted to make sure "
"nothing's changed on your end.\n\nSpeak soon,\n{from_first}",
),
]
_REPLY_TEMPLATES: list[Template] = [
Template("ack_thanks", "", "Thanks for reaching out — appreciate it!\n\n{from_first}"),
Template("ack_got_it", "", "Got it, talk soon.\n\n{from_first}"),
Template("ack_good", "", "Sounds good to me!\n\n{from_first}"),
Template("ack_works", "", "Yep, that works for me.\n\n{from_first}"),
Template(
"ack_circle",
"",
"Thanks for the note — let me think on it for a day and I'll circle back.\n\n{from_first}",
),
Template(
"ack_helpful",
"",
"Appreciate it, that's really helpful context.\n\n{from_first}",
),
Template("ack_quick", "", "Quick yes from me — let's do it.\n\n{from_first}"),
Template(
"ack_followup",
"",
"Got it. I'll follow up later in the week with the next step.\n\n{from_first}",
),
Template("ack_confirmed", "", "Confirmed — see you then.\n\n{from_first}"),
Template("ack_appreciate", "", "Really appreciate you sending this over.\n\n{from_first}"),
Template("ack_great", "", "This is great, thanks!\n\n{from_first}"),
Template("ack_will_review", "", "Thanks — I'll take a look and get back to you.\n\n{from_first}"),
Template("ack_makes_sense", "", "Makes sense, thanks for clarifying.\n\n{from_first}"),
Template("ack_on_it", "", "On it — I'll have something for you soon.\n\n{from_first}"),
Template("ack_lets_talk", "", "Let's find a few minutes to talk this through.\n\n{from_first}"),
Template("ack_no_worries", "", "No worries at all — thanks for the heads up.\n\n{from_first}"),
Template("ack_perfect", "", "Perfect, thanks for letting me know.\n\n{from_first}"),
Template("ack_agreed", "", "Agreed — let's go with that.\n\n{from_first}"),
Template("ack_checking", "", "Let me check on this and circle back shortly.\n\n{from_first}"),
Template("ack_received", "", "Received, thank you.\n\n{from_first}"),
Template("ack_nice_work", "", "That's good to hear — nice work.\n\n{from_first}"),
Template("ack_flexible", "", "Either way works for me, your call.\n\n{from_first}"),
Template("ack_sounds_plan", "", "Sounds like a plan.\n\n{from_first}"),
Template("ack_much_appreciated", "", "Much appreciated.\n\n{from_first}"),
Template("ack_loop_back", "", "Thanks — I'll loop back once I've had a chance to dig in.\n\n{from_first}"),
Template("ack_all_good", "", "All good on my end, thanks for checking.\n\n{from_first}"),
Template("ack_noted", "", "Noted, thanks.\n\n{from_first}"),
Template("ack_understood", "", "Understood — I'll keep that in mind.\n\n{from_first}"),
Template("ack_will_do", "", "Will do, thanks for the heads-up.\n\n{from_first}"),
Template("ack_totally_fine", "", "Totally fine with me.\n\n{from_first}"),
Template("ack_of_course", "", "Of course — happy to help.\n\n{from_first}"),
Template("ack_copy_that", "", "Copy that, thanks.\n\n{from_first}"),
Template("ack_ten_four", "", "Got it, I'll take it from here.\n\n{from_first}"),
Template("ack_let_me_know", "", "Let me know if there's anything else you need from me.\n\n{from_first}"),
Template("ack_sounds_right", "", "Sounds right to me.\n\n{from_first}"),
Template("ack_same_page", "", "Good, we're on the same page then.\n\n{from_first}"),
Template("ack_look_forward", "", "Looking forward to it.\n\n{from_first}"),
Template("ack_catch_up_soon", "", "Let's catch up properly soon.\n\n{from_first}"),
Template("ack_happy_to", "", "Happy to — just say when.\n\n{from_first}"),
Template("ack_works_for_me", "", "Works for me, thanks for organizing.\n\n{from_first}"),
Template("ack_will_get_back", "", "I'll get back to you on this by end of week.\n\n{from_first}"),
Template("ack_solid", "", "Solid, thanks for the update.\n\n{from_first}"),
Template("ack_fair_enough", "", "Fair enough — makes sense.\n\n{from_first}"),
Template("ack_sounds_good_timing", "", "Sounds good, that timing works.\n\n{from_first}"),
Template("ack_appreciate_flag", "", "Appreciate the heads-up, good to know.\n\n{from_first}"),
Template("ack_glad_to_hear", "", "Glad to hear it — nice work.\n\n{from_first}"),
Template("ack_good_to_know", "", "Good to know, thanks for passing it along.\n\n{from_first}"),
Template("ack_will_flag", "", "Got it — I'll flag if anything changes on my side.\n\n{from_first}"),
Template("ack_no_problem", "", "No problem at all, take your time.\n\n{from_first}"),
Template("ack_just_saw", "", "Just saw this — on it now.\n\n{from_first}"),
Template("ack_right_behind", "", "Right behind you on this one.\n\n{from_first}"),
Template("ack_stand_by", "", "Stand by — I'll have something back to you shortly.\n\n{from_first}"),
Template("ack_good_call", "", "Good call, I think that's the right move.\n\n{from_first}"),
Template("ack_totally_get_it", "", "Totally get it — no worries.\n\n{from_first}"),
Template("ack_either_works", "", "Either works for me, whatever's easier for you.\n\n{from_first}"),
Template("ack_morning_or_afternoon", "", "Morning works better for me, but I can flex if needed.\n\n{from_first}"),
Template("ack_yes_please", "", "Yes please — that would be really helpful.\n\n{from_first}"),
Template("ack_count_me_in", "", "Count me in.\n\n{from_first}"),
Template("ack_already_on_it", "", "Already on it — will update you when done.\n\n{from_first}"),
Template("ack_good_progress", "", "Good progress — keep it coming.\n\n{from_first}"),
Template("ack_send_it_over", "", "Sure, send it over and I'll take a look.\n\n{from_first}"),
Template("ack_few_minutes", "", "I've got a few minutes — let's talk.\n\n{from_first}"),
Template("ack_ping_me", "", "Ping me when you're ready and we'll sort it out.\n\n{from_first}"),
Template("ack_keep_posted", "", "Thanks — keep me posted as it develops.\n\n{from_first}"),
Template("ack_not_a_problem", "", "Not a problem — glad you mentioned it.\n\n{from_first}"),
Template("ack_got_your_back", "", "Got your back — let me know what you need.\n\n{from_first}"),
Template("ack_happy_either_way", "", "Happy either way — you decide.\n\n{from_first}"),
Template("ack_makes_total_sense", "", "Makes total sense, thanks for explaining.\n\n{from_first}"),
Template("ack_very_helpful", "", "Very helpful — thank you.\n\n{from_first}"),
Template("ack_take_your_time", "", "Take your time, no rush from me.\n\n{from_first}"),
Template("ack_sounds_like_plan", "", "Sounds like a good plan to me.\n\n{from_first}"),
Template("ack_happy_with_that", "", "Happy with that, let's go ahead.\n\n{from_first}"),
Template("ack_thanks_quick", "", "Thanks for the quick response.\n\n{from_first}"),
Template("ack_excited", "", "That's exciting — looking forward to it.\n\n{from_first}"),
Template("ack_relief", "", "That's a relief — good to hear.\n\n{from_first}"),
Template("ack_one_sec", "", "One second — let me check and come back to you.\n\n{from_first}"),
Template("ack_checking_now", "", "Checking on it right now.\n\n{from_first}"),
Template("ack_leave_with_me", "", "Leave it with me, I'll sort it out.\n\n{from_first}"),
Template("ack_consider_done", "", "Consider it done.\n\n{from_first}"),
Template("ack_on_my_list", "", "On my list — I'll get to it today.\n\n{from_first}"),
Template("ack_nothing_from_me", "", "Nothing urgent from me, you're all set.\n\n{from_first}"),
Template("ack_appreciate_patience", "", "Appreciate your patience — almost there.\n\n{from_first}"),
Template("ack_thanks_for_waiting", "", "Thanks for waiting on me.\n\n{from_first}"),
Template("ack_still_on_it", "", "Still on it — will have an update for you soon.\n\n{from_first}"),
Template("ack_this_works", "", "This works perfectly, thank you.\n\n{from_first}"),
Template("ack_good_thinking", "", "Good thinking — hadn't considered that angle.\n\n{from_first}"),
Template("ack_simple_yes", "", "Yes — works for me.\n\n{from_first}"),
Template("ack_simple_no", "", "Not quite — let me suggest an alternative.\n\n{from_first}"),
Template("ack_back_to_you", "", "All yours — let me know what you think.\n\n{from_first}"),
Template("ack_good_to_go", "", "Good to go on my end.\n\n{from_first}"),
Template("ack_handled", "", "Handled — nothing else needed from you.\n\n{from_first}"),
Template("ack_dig_in", "", "I'll dig in today and report back.\n\n{from_first}"),
Template("ack_open_to_it", "", "Open to it — tell me more.\n\n{from_first}"),
Template("ack_great_idea", "", "Great idea, let's try it.\n\n{from_first}"),
Template("ack_full_support", "", "You have my full support on this.\n\n{from_first}"),
Template("ack_touch_base_later", "", "Let's touch base later this week.\n\n{from_first}"),
Template("ack_following_along", "", "Following along — keep me in the loop.\n\n{from_first}"),
Template("ack_talk_then", "", "Talk then — looking forward to it.\n\n{from_first}"),
Template("ack_well_done", "", "Well done — that took some effort.\n\n{from_first}"),
Template("ack_appreciate_looping", "", "Appreciate you keeping me in the loop.\n\n{from_first}"),
]
def _pick_excluding(templates: list[Template], exclude_key: str | None) -> Template:
options = [t for t in templates if t.key != exclude_key] if exclude_key else templates
return random.choice(options)
def generate_send(from_email: str, from_first: str, to_first: str) -> tuple[str, str, str]:
"""Returns (subject, body, template_key). Won't repeat the last template used."""
last_key = database.last_template(from_email, "send")
tpl = _pick_excluding(_SEND_TEMPLATES, last_key)
subject = tpl.subject
body = tpl.body.format(from_first=from_first, to_first=to_first)
database.record_template(from_email, "send", tpl.key)
return subject, body, tpl.key
def generate_reply(from_email: str, from_first: str, original_subject: str) -> tuple[str, str, str]:
"""Returns (subject, body, template_key). Subject is the original prefixed with 'Re: ' if needed."""
last_key = database.last_template(from_email, "reply")
tpl = _pick_excluding(_REPLY_TEMPLATES, last_key)
subject = original_subject if original_subject.lower().startswith("re:") else f"Re: {original_subject}"
body = tpl.body.format(from_first=from_first)
database.record_template(from_email, "reply", tpl.key)
return subject, body, tpl.key