move email request from inbox when video is downloaded

This commit is contained in:
DBras 2025-03-02 20:06:16 +01:00
parent b874389ed2
commit 094671c654
1 changed files with 8 additions and 0 deletions

View File

@ -92,6 +92,14 @@ func main() {
log.Fatalf("Video download failed: %v", err)
}
var modifications gmail.ModifyMessageRequest
modifications.AddLabelIds = []string{"Label_6181251506395195727"}
modifications.RemoveLabelIds = []string{"INBOX"}
_, err = service.Users.Messages.Modify(USER, msg.Id, &modifications).Do()
if err != nil {
log.Fatalf("Unable to move email request from inbox: %v", err)
}
var message gmail.Message
messageStr := fmt.Sprintf(
"From: %s\r\n" +