ctsit / redcapcustodian

Simplified, automated data management on REDCap systems
Other
12 stars 6 forks source link

Add logging of activity to `cleanup_bad_email_addresses.R` #57

Closed pbchase closed 1 year ago

pbchase commented 2 years ago

cleanup_bad_email_addresses.R is very quiet. It neither logs its activity nor sends out an email summary. We need a better record of the changes it is making.

To make this work, we need update_redcap_email_addresses() to return some data about what it did. We might want it to actually log the changes directly and send summary data back to the caller.

We would also want to suspend_users_with_no_primary_email() to return summary information about its activities. It would be difficult to get suspend_users_with_no_primary_email() to report which accounts were suspended given the nature of the update statement it uses.

With the summary data available, the ETL could write a summary record stating the number of users suspended and the number of email addresses revised. The summary record could also include the email address set for which users if desired.

pbchase commented 1 year ago

@ChemiKyle, I'll have a PR for your tomorrow. Probably in the a.m. I've been busy. :-)