[Solved] How to have a script to search for emails inside Gmail using the resource?
Let me describe what i want to do manually and tell me roughly how to do this inside windmill.dev
Manual Steps
1. search inside gmail
[DigitalOcean] Your 2024-07 invoice is available
and it will generate a list of emails (see attached image)
2. i want to iterate through each email
3. and then download each attachment (which is pdf)
4. and then do something to the pdf
how to do this inside windmill
given that i have the gmail resource installed (see attached), how do i use the resource in my script?
I have read this https://www.windmill.dev/docs/core_concepts/resources_and_types#fetching-them-from-within-a-script-by-using-the-wmill-client-in-the-respective-language but i am still unsure how to use this.
DO I use a script, flow, or app?
all i know is i do
gmail_resource = wmill.get_resource("u/kimsia/picturesque_gmail")
then i am lost what to do nextResources and Resource Types | Windmill
Resources are rich objects in JSON that allow to store configuration and credentials.
11 Replies
write code (with potentially library) to do the operations that you need helped with the token
so you mean
like that?
because when i go to https://hub.windmill.dev/resource_types/38/gmail, all i see is token
i have tried
.get
.token
["token"]
all not suitablei have read this but this was in deno https://hub.windmill.dev/scripts/gmail/1291/-send-email-gmail
Script ' Send Email' for gmail | Windmill Hub
How to Send Email for gmail : Send an email using Gmail without any attachments.
["token"] should work in python
but you saw this right?
this is my code
this is the warning
will be fixed in next version
meaning to say the warning is wrong, so i can just use as is?
or i have to wait till new version before i can use?
warning is wrong
it's just an editor thingy you can ignore it
ok i can finally search emails inside gmail