0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Slack の確認コードの入力を自動化するGoogle Apps Script

Posted at
コード.gs
function messageToObject(message) {
  return {
    date: message.getDate(),
    subject: message.getSubject(),
    plainBody: message.getPlainBody(),
  }
}


function doGet() {
  const response = GmailApp.search('subject:"Slack の確認コード"').flatMap(thread => thread.getMessages().map(messageToObject))
  return ContentService.createTextOutput(JSON.stringify(response, null, 2)).setMimeType(ContentService.MimeType.JSON)
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?