I am trying to draft an email response and I am trying to actually reply to the thread. I have followed answers on other SO questions but its still not working.
draft_message = EmailMessage()
draft_message.set_content(message)
draft_message['In-Reply-To'] = <message_id>
draft_message['References'] = <message_id>
draft_message['Subject'] = subject
encoded_message = base64.urlsafe_b64encode(draft_message.as_bytes()).decode()
body = {"message": {'threadId': thread_id, "raw": encoded_message}}
service
.users()
.drafts()
.create(userId="me", body=create_message)
.execute()
I have set the thread_id
and set all the headers like I think should be done but its still not replying to the thread. What am I doing wrong?