Change theme
Help
Press space for more information.
Show links for this issue (Shortcut: i, l)
Copy issue ID
Previous Issue (Shortcut: k)
Next Issue (Shortcut: j)
Sign in to use full features.
Vote: I am impacted
Notification menu
Refresh (Shortcut: Shift+r)
Go home (Shortcut: u)
Pending code changes (auto-populated)
Show all 5 items in the list
Tags used for linking issues. [ID: 1172495]
View issue level access limits(Press Alt + Right arrow for more information)
Unintended behavior
View staffing
Description
Description
I have a script that sends messages (via the send endpoint) to prospective volunteers to sign up for a shift. The emails are going through successfully and appear in the sender's "sent" folder in the Gmail UI. However, when I query the sent messages in the readonly endpoint, the successfully sent messages are not returned. At first I thought this was a race condition but I tried querying 24 hours after the message was sent and the sent messages still did not appear.
Code
To send the email: service.users().messages().send(userId=user_id, body=message).execute() // the subject line for this message is "Test Subject Unique" and it returns a response code of 200
To query the sent folder: results = service.users().messages().list(userId="me", q=f'in:sent subject:"Test Subject Unique"').execute() messages = results.get("messages", []) return messages
Output
Empty array