@@ -1536,3 +1536,50 @@ function optionalFields() {
15361536 console . log ( "Found an element" ) ;
15371537 }
15381538}
1539+
1540+ // GmailMessage.createDraftReply and createDraftReplyAll with subject option
1541+ function testGmailDraftReplyWithSubject ( ) {
1542+ const message = GmailApp . getMessageById ( "message-id" ) ;
1543+ const thread = GmailApp . getThreadById ( "thread-id" ) ;
1544+
1545+ // Test GmailMessage.createDraftReply with subject option
1546+ message . createDraftReply ( "Reply body" ) ; // $ExpectType GmailDraft
1547+ message . createDraftReply ( "Reply body" , { subject : "Custom subject" } ) ; // $ExpectType GmailDraft
1548+ // $ExpectType GmailDraft
1549+ message . createDraftReply ( "Reply body" , {
1550+ subject : "Custom subject" ,
1551+ 1552+ 1553+ htmlBody : "<p>HTML reply</p>" ,
1554+ } ) ;
1555+
1556+ // Test GmailMessage.createDraftReplyAll with subject option
1557+ message . createDraftReplyAll ( "Reply all body" ) ; // $ExpectType GmailDraft
1558+ message . createDraftReplyAll ( "Reply all body" , { subject : "Custom subject for all" } ) ; // $ExpectType GmailDraft
1559+ // $ExpectType GmailDraft
1560+ message . createDraftReplyAll ( "Reply all body" , {
1561+ subject : "Custom subject for all" ,
1562+ 1563+ htmlBody : "<p>HTML reply all</p>" ,
1564+ } ) ;
1565+
1566+ // Test GmailThread.createDraftReply with subject option
1567+ thread . createDraftReply ( "Thread reply body" ) ; // $ExpectType GmailDraft
1568+ thread . createDraftReply ( "Thread reply body" , { subject : "Thread custom subject" } ) ; // $ExpectType GmailDraft
1569+ // $ExpectType GmailDraft
1570+ thread . createDraftReply ( "Thread reply body" , {
1571+ subject : "Thread custom subject" ,
1572+ 1573+ name : "Custom Name" ,
1574+ } ) ;
1575+
1576+ // Test GmailThread.createDraftReplyAll with subject option
1577+ thread . createDraftReplyAll ( "Thread reply all body" ) ; // $ExpectType GmailDraft
1578+ thread . createDraftReplyAll ( "Thread reply all body" , { subject : "Thread custom subject for all" } ) ; // $ExpectType GmailDraft
1579+ // $ExpectType GmailDraft
1580+ thread . createDraftReplyAll ( "Thread reply all body" , {
1581+ subject : "Thread custom subject for all" ,
1582+ 1583+ attachments : [ DriveApp . getFileById ( "file-id" ) . getBlob ( ) ] ,
1584+ } ) ;
1585+ }
0 commit comments