I'm building a GAS on GmailApp to extract participants from a thread. Then I want to find out their contact info on ContactsApp.
I've tried the following:
1. loop over an array of thread participants emails and do a ContactsApp.getContact(email), however this leads to a timeout.
2. load all contacts into an array with ContactsApp.getContacts() then loop over the array of participants and for each loop over contacts and getEmails() and getAddress(). However this takes several seconds and makes the add-on load in about 6 seconds or so.
I'm assuming I'm not using the stuff as expected. What would be the right way to do that?