python-samples icon indicating copy to clipboard operation
python-samples copied to clipboard

Gmail API Python Client in Cloud Function

Open lamyaraed opened this issue 4 years ago • 0 comments

Problem

I'm using Gmail API to send emails with attachments within a cloud function. using gmail api client

gmail_client.users().messages().send(userId='me', body={'raw': raw_string}).execute()

following this Guide: https://developers.google.com/gmail/api/guides/sending#python I implemented it and it is working fine, but the problem is that the attachments are saved (uploaded) to a cloud storage whenever an email is sent, in the following path

/bucket/emailSubject/attachmentFileName

I don't wish this to happen, I don't want the attachments to be saved in cloud storage, is there a way I can prevent this?

lamyaraed avatar Nov 25 '21 14:11 lamyaraed