I want to get the last mail from my Gmail mailbox. I’m not a newbie on Make, I’m trying to optimize the task.
Let’s imagine I have 10’000 mails. and I only want to get the last one.
Method 1 (takes long time, but 1 operation) : The email ‘get emails’ module gets all mails, starting from the OLDEST to most RECENT, and then sorts them by date. example : Limit 100 → It’ll get 100 oldest mails, and then put the most recent in this list as Bundle 1. I’ll have to search Limit 10’000 → Then I’ll have the most recent mail as Bundle 1 → Mission accomplished.
Method 2 (doesn’t take long, 1 operation, but doesn’t work 100% of the time) : limit 10000, with query ‘newer_than=30d’. This will effectively get all mails from last month and get me the last one as Bundle 1. Takes less time, because I don’t actually have 10k mail last month. Problem : I might have last mail dating 3 months ago, and ‘Last mail’ won’t show up. I’d be forced to use repeater function to go back 30d more, and then search again, and again, until i get at least 1 bundle (this consumes time and operations, worse than method 1).
Anyone has a better method to get just ‘Last mail’ ? I don’t want to use ‘Watch mail’ module. I have also tried gmail API to search through 10k mails faster, it’s very fast, but I’m having a hard time working with some parameters, UID is not the same as ID, etc.
Thanks !