Skip to content

Instantly share code, notes, and snippets.

View aekozhevnikov's full-sized avatar
🌴
On vacation

Antonio aekozhevnikov

🌴
On vacation
View GitHub Profile
@tanaikech
tanaikech / submit.md
Last active March 22, 2024 19:33
Sending Multiple Emails using Batch Request with Gmail API using Google Apps Script

Sending Multiple Emails using Batch Request with Gmail API using Google Apps Script

This is a sample script for sending multiple emails using the batch request with Gmail API using Google Apps Script. When multiple emails are sent using "GmailApp.sendEmail" and "MailApp.sendEmail", a loop is used. But in this case, the process cost becomes high. In this post, I would like to introduce the sample script for reducing the process cost under this situation. Gmail API can be requested with the batch request. The batch request can be processed with the asynchronous process. By this, I thought that the process cost for sending multiple emails. So, this sample script sends multiple emails using the batch request with Gmail API.

Sample script

This sample script uses a Google Apps Script library of BatchRequest. So, before you use this script, please install a Google Apps Script library of BatchReques

@tanaikech
tanaikech / submit.md
Created October 11, 2021 00:47
Sending Gmail with Title and Body Including Emoji using Google Apps Script

Sending Gmail with Title and Body Including Emoji using Google Apps Script

This is a sample script for sending Gmail with the title and body including Emoji using Google Apps Script.

Sample script

This sample script uses Gmail API. So please enable Gmail API at Advanced Google services. Ref

@tanaikech
tanaikech / submit.md
Last active July 18, 2024 06:01
Parsing HTML using Google Apps Script

Parsing HTML using Google Apps Script

This is a sample script for parsing HTML using Google Apps Script. When HTML data is converted to Google Document, the HTML data can be parsed and be converted to Google Document. In this case, the paragraphs, lists and tables are included. From this situation, I thought that this situation can be used for parsing HTML using Google Apps Script. So I could came up with this method.

In the Sheet API, the HTML data can be put to the Spreadsheet with the PasteDataRequest. But unfortunately, in this case, I couldn't distinguish between the body and tables.

The flow of this method is as follows. In this sample script, the tables from HTML are retrieved.

Flow