bark: clear bark data on-opt-out

We shouldn't leave stale data in the mailchimp database, but rather wipe
any data we've collected for users that are explicitly opting out.
This commit is contained in:
fang 2023-10-05 10:24:31 +02:00
parent 7bd7e4f54b
commit 245503f5e7
No known key found for this signature in database
GPG Key ID: EB035760C1BBA972
2 changed files with 12 additions and 2 deletions

View File

@ -76,7 +76,13 @@
%bark-remove-recipient
=+ !<(=ship vase)
?> =(src.bowl ship)
`this(recipients (~(del in recipients) ship))
:_ this(recipients (~(del in recipients) ship))
:_ ~
:* %pass /save-summary/(scot %p src.bowl)/(scot %da now.bowl)
%arvo %k %fard
%landscape %save-summary %noun
!>(`[tlon.api mailchimp.api src.bowl %wipe ~])
==
::
%bark-generate-summaries
?> =(src.bowl our.bowl)
@ -107,7 +113,7 @@
== ==
vase
?~ result
`this(recipients (~(del in recipients) src.bowl))
$(mark %bark-remove-recipient, vase !>(src.bowl))
::TODO maybe drop the result (or re-request) if the timestamp is too old?
:_ this
:~ :* %pass /save-summary/(scot %p src.bowl)/(scot %da requested.u.result)

View File

@ -18,6 +18,7 @@
::
$= summary
$% [%life [sen=@ud rec=@ud gro=@t] [dms=@ud etc=@ud group=@t chat=@t]]
[%wipe ~]
==
==
=/ args !<([~ arg-mold] arg)
@ -45,6 +46,9 @@
=; vars=(map @t json)
!>(`[mailchimp.args u.mail vars])
%- ~(gas by *(map @t json))
=? summary.args ?=(%wipe -.summary.args)
[%life [0 0 ''] [0 0 '' '']]
?> ?=(%life -.summary.args)
=, summary.args
:~ ['MSGS_SENT' (numb:enjs:format sen)]
['MSGS_RECD' (numb:enjs:format rec)]