Skip to content

Instantly share code, notes, and snippets.

@retuka1
retuka1 / php redirect
Created February 21, 2023 20:52 — forked from uniquerockrz/php redirect
Redirect to a page using JS and PHP. Useful if you want to display ads before downloading the file
<html>
<head>
<title>Download</title>
</head>
<body>
<!-- This is the redirect php script -->
<?php
$url;
$time = 5000; // time in milliseconds
switch ($_GET['file']) {
(function (d, w, c) {
(w[c] = w[c] || []).push(function() {
try {
w.yaCounter42337284 = new Ya.Metrika({
id:42337284,
clickmap:true,
trackLinks:true,
accurateTrackBounce:true
});
@retuka1
retuka1 / submit.md
Created February 12, 2023 17:46 — forked from tanaikech/submit.md
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