If anyone's looking to reproduce this but in a no-code way then I have a setup to send and receive WhatsApp messages via email[1] using android VM and tasker which could be modified/extended for retrieving other data.
But OP method has lesser moving parts and more easily reproducible if coding is not the barrier.
But OP method has lesser moving parts and more easily reproducible if coding is not the barrier.
[1] https://abishekmuthian.com/send-and-receive-whatsapp-message...