Regarding the deletion of user data:
I would like to add one possibility for free:
You can use our doi plugin for mautic in the newest version.
You can find it under:
In the newest release you got the feature to update lead fields after doi with other lead fields
OR use a set of specific tokens the plugin provide ( {tokenid}, {doi_ip}, {doi_timestamp} ).
For the use case you describe you would configure the plugin in a way that AFTER a successful “doi” you
overwrite the lead fields with the content of {tokenid} (which is a cryptografic save random string)
for example like this:
Config Option:
Update Lead Fields after successfull DOI
Value:
email={tokenid},firstname={tokenid},lastname={tokenid}
This would allow a workflow like this:
- A user would request deletion of his data via mautic form
- the mautic form use our doi plugin to send a doi email
- after the user clicks the doi confirmation link (=prove that he owns the data)
the plugin would overwrite the important lead fields with random strings
But still two thing left to do:
- This would leave the audit_log entries and the form_submissions entries
Both tables could identify the original lead or contain sensitive user data.
From my point of view you could solve this case if you write a specific keyword in one lead field
and then delete via cronjob and sql statement every entry in this tables with this key word.
Assuming that you have a custom lead field with name anonymization and it got the value = 1 ( if you want to delete the entries)
it would be something like this to run regulary via cron job:
php bin/console doctrine:query:sql 'DELETE form_submissions from form_submissions join leads on leads.id=form_submissions.lead_id where leads.anonymization=1;'
php bin/console doctrine:query:sql 'DELETE audit_log FROM audit_log JOIN leads on audit_log.object_id = leads.id and audit_log.object = 'lead' where leads.anonymization=1;'
This would run this queries to delete the entries in audit_log and form_submissions:
DELETE form_submissions from form_submissions
join leads on leads.id=form_submissions.lead_id
where leads.anonymization=1;
DELETE audit_log FROM audit_log
JOIN leads on audit_log.object_id = leads.id and audit_log.object = 'lead'
where leads.anonymization=1;
and you need to config the doi action like this:
Config Option:
Update Lead Fields after successfull DOI
Value:
email={tokenid},firstname={tokenid},lastname={tokenid},anonymization=1
- You need to enable mautics ip anonymization