Convert a string into a GmailThread object

42 Views Asked by At

How can you convert a string into a GmailThread object?

var threadid = PropertiesService.getScriptProperties().getProperty('threadid');  
var msgs = threadid.getMessages(); //error

Thks, jfg

1

There are 1 best solutions below

0
On

Check getThreadById(id) of GmailApp. Hence your code will be like:

var thread = GmailApp.getThreadById(threadId);
var msgs = thread.getMessages();