<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Snippets To Have]]></title><description><![CDATA[Snippets To Have]]></description><link>https://michalel-levy.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Mon, 14 Sep 2026 18:44:12 GMT</lastBuildDate><atom:link href="https://michalel-levy.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Script for Gmail to extend filter - archive yesterday's emails based on rules in Google Sheet]]></title><description><![CDATA[I’ve struggled for some time with my Gmail inbox filling up with newsletters, alerts, and community updates. Most of these emails are only useful if I read them on the same day, but if they stay in the inbox, they become noise and waste time the next...]]></description><link>https://michalel-levy.hashnode.dev/script-for-gmail-to-extend-filter-archive-yesterdays-emails-based-on-rules-in-google-sheet</link><guid isPermaLink="true">https://michalel-levy.hashnode.dev/script-for-gmail-to-extend-filter-archive-yesterdays-emails-based-on-rules-in-google-sheet</guid><category><![CDATA[gmail filters]]></category><category><![CDATA[#gmall]]></category><category><![CDATA[filters]]></category><dc:creator><![CDATA[Michael Levy]]></dc:creator><pubDate>Tue, 25 Nov 2025 11:58:49 GMT</pubDate><content:encoded><![CDATA[<p>I’ve struggled for some time with my Gmail inbox filling up with newsletters, alerts, and community updates. Most of these emails are only useful if I read them on the same day, but if they stay in the inbox, they become noise and waste time the next day. Still, I do not want to unsubscribe from them as from time to time they do bring something interesting - that’s also the initial reason I subscribed to them.  </p>
<p>Gmail filters, unfortunately, don’t offer a way to automatically handle emails based on their age. You cannot make a rule, "do that and that for emails of 3 days ago”.  </p>
<p>To solve this issue, ChatGPT helped me build a small automation that is shared below:</p>
<h3 id="heading-what-the-script-does">✅ What the script does</h3>
<ol>
<li><p><strong>Automatically archives yesterday’s emails</strong> according to customizable rules<br /> (for example, you can include/exclude messages based on whether they are starred or contain certain keywords).</p>
</li>
<li><p><strong>Sends you a daily summary at 8 AM</strong> showing everything that was archived, so you can quickly check if anything important was removed.</p>
</li>
<li><p><strong>Lets you manage all rules in a Google Sheet</strong>, so you never have to edit the script itself.</p>
</li>
</ol>
<p>How to set it up:</p>
<ol>
<li><p>Open a new Google Sheet, give it a name like “Newsletters Filter Rules”</p>
</li>
<li><p>Rename a default Sheet into “Rules” - you whatever you want</p>
</li>
<li><p>Set up parameters in this Sheet  </p>
<p> So it will look like this:  </p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764071353231/93b86418-23a0-436c-9506-e6510a0e0851.png" alt class="image--center mx-auto" /></p>
<p> <img src alt class="image--center mx-auto" /></p>
</li>
</ol>
<p>    This spereadsheet above has following columns, and they have to be exactly in this order and with the same names:<br />    <strong>Enabled</strong> - if the Rule is active<br />    <strong>RuleName</strong> - just a name, whatever you put<br />    <strong>Sender</strong> - email of the sender<br />    <strong>SubjectWords</strong> - if you put something here, than rule is applied only if it find the words in the subject<br />    <strong>StarredHandling</strong> - if Exclude - then exclude those that starred, Include - include them  </p>
<p>    4. Now paste the code: In your google spreadsheet go to Extensions→App Script and paste the code below:</p>
<p>    (here how it looks)</p>
<p>    <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1764071708253/dbf43a22-3533-4a7f-b249-82f25809a650.png" alt class="image--center mx-auto" /></p>
<p>    the code to paste:  </p>
<p>    %[https://gist.github.com/microbidsoftware/61d51ddf121c23a236565c6281b94da0]</p>
]]></content:encoded></item></channel></rss>