<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Automation Almanac</title>
    <description>Practical automation tutorials with working code — for developers, solo founders, and anyone who would rather build the tool than pay for it.</description>
    
    <link>https://www.automation-almanac.com/</link>
    <atom:link href="https://rss.beehiiv.com/feeds/0v5SinsH9j.xml" rel="self"/>
    
    <lastBuildDate>Sun, 29 Nov 2026 07:50:15 +0000</lastBuildDate>
    <pubDate>Fri, 01 May 2026 14:54:20 +0000</pubDate>
    <atom:published>2026-05-01T14:54:20Z</atom:published>
    <atom:updated>2026-11-29T07:50:15Z</atom:updated>
    
      <category>Business</category>
      <category>Lifestyle</category>
      <category>Artificial Intelligence</category>
    <copyright>Copyright 2026, Automation Almanac</copyright>
    
    <image>
      <url>https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/publication/logo/53b3298b-ac01-49d2-bb12-bd4daa428adb/Automation-Almanac_Logo.png</url>
      <title>Automation Almanac</title>
      <link>https://www.automation-almanac.com/</link>
    </image>
    
    <docs>https://www.rssboard.org/rss-specification</docs>
    <generator>beehiiv</generator>
    <language>en-us</language>
    <webMaster>support@beehiiv.com (Beehiiv Support)</webMaster>

      <item>
  <title>How to Get a Custom Road Trip Packing List with Claude Projects</title>
  <description>Set up a Claude Projects folder once with your family&#39;s context — ages, gear, car, travel style — and get a road-trip packing list in one message.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/660ee781-66c8-4c66-ac3e-eedb5aaa06a1/How_to_Get_a_Custom_Road_Trip_Packing_List_with_Claude_Projects.png" length="1006961" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-get-a-custom-road-trip-packing-list-with-claude-projects</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-get-a-custom-road-trip-packing-list-with-claude-projects</guid>
  <pubDate>Fri, 01 May 2026 14:54:20 +0000</pubDate>
  <atom:published>2026-05-01T14:54:20Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Claude Cowork]]></category>
    <category><![CDATA[Automation]]></category>
    <category><![CDATA[Lifestyle]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">Building a family road trip packing list is always difficult — you need to cover everything for your stay, plus everything to keep the kids occupied on the drive. You always end up forgetting something; you hope it&#39;s not the stuffy the baby needs to sleep.</p><p class="paragraph" style="text-align:left;">With kids of different age groups, you have to pack different things; a 2-year-old and a 6-year-old need different clothes, toys, snacks, and you know the rest. There are tons of packing lists out there for any place you want to go, for any time of the year. The difference is that these lists aren&#39;t geared toward your family. They don&#39;t know if your kids have allergies or what kind of car you have.</p><p class="paragraph" style="text-align:left;">Claude Projects can give you access to a &quot;memory&quot; of what you have, what medications you need to take with you, and what kind of car you have, so that you can pack appropriately. You&#39;ll add some basic instructions, and Claude Projects will use them every time you need to plan a road trip.</p><h2 class="heading" style="text-align:left;" id="what-youll-need">What you&#39;ll need</h2><ul><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://claude.ai/download?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-get-a-custom-road-trip-packing-list-with-claude-projects" target="_blank" rel="noopener noreferrer nofollow">Claude Desktop</a></p></li><li><p class="paragraph" style="text-align:left;">10 minutes</p></li></ul><h2 class="heading" style="text-align:left;" id="step-1-create-your-road-trip-planne">Step 1 – Create your Road Trip Planner Project</h2><p class="paragraph" style="text-align:left;">Download the Claude Desktop app, and go to Cowork. We&#39;ll need to create a new project; we&#39;ll start from scratch. Then name your project something like &quot;Family Trip Planner.&quot; That&#39;s the basic setup for the entire project.</p><p class="paragraph" style="text-align:left;">The key here is knowing that every time you start a chat session with Claude in this project folder, it will follow the instructions you&#39;ve given it. This way, you update the instructions to reflect how your family changes or who is going on the trip, with specific details.</p><div class="image"><img alt="Claude Desktop with the Projects panel open and a &quot;New project&quot; button visible" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/73798faf-d075-4bfc-bccc-51e328cc0e97/Screenshot_2026-04-30_at_1.00.41_PM.png?t=1777647110"/></div><div class="image"><img alt="The &quot;Family Trip Planner&quot; project in Claude Desktop with the Instructions panel open" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/053dfc08-5c09-4c58-ba99-a54cbb0790e5/Screenshot_2026-04-30_at_1.12.56_PM.png?t=1777647145"/></div><h2 class="heading" style="text-align:left;" id="step-2-write-your-familys-instructi">Step 2 – Write Your Family&#39;s Instructions</h2><p class="paragraph" style="text-align:left;">You should see a sidebar item called instructions. This is where we will write the instructions on how the project plans a trip. Here are a few things I&#39;ve included in my instructions:</p><p class="paragraph" style="text-align:left;"><b>Kids&#39; Ages</b>: The age difference between a 2-year-old and a 6-year-old isn&#39;t just a few items. The 2-year-old still uses sleepers and needs a sound machine, while the 6-year-old goes through clothes so fast because they love to play in the mud.</p><p class="paragraph" style="text-align:left;"><b>Allergies or Medications</b>: You never want to forget your medication or that you left the Allegra on the table counter while the windows are open during pollen season. These have their own category, so you can never forget them.</p><p class="paragraph" style="text-align:left;"><b>Your Car</b>: Packing a sedan vs an SUV is two totally different things. If you have a roof rack, that opens up a ton more possibilities for what you can bring with you.</p><p class="paragraph" style="text-align:left;"><b>Your Gear</b>: This category ropes in the stuff you already have. For each trip, you might need to purchase something specific for the destination you&#39;re going to. It&#39;s helpful if Claude already knows what you own, so it doesn&#39;t suggest purchases you should make.</p><p class="paragraph" style="text-align:left;"><b>Where You Stay</b>: Do you typically camp? Maybe you have a cabin, or you&#39;re staying with a friend when you&#39;re going somewhere else. Maybe you stay in hotels or Airbnbs. Depending on where you stay, you need different things.</p><p class="paragraph" style="text-align:left;"><b>Output Format</b>: How do you want Claude to format the list? Do you need different headers, or would you like to group things in a specific way?</p><p class="paragraph" style="text-align:left;">Here is a template you can use:</p><p class="paragraph" style="text-align:left;">You are a family road trip packing assistant. Here is our family&#39;s permanent context:</p><div class="codeblock"><pre><code>Kids: [age] and [age]

Allergies/medications: [list, or &quot;none&quot;]

Car: [type — e.g. Honda Pilot SUV, roof rack yes/no]

Gear we already own: [e.g., Yeti cooler, kids&#39; Fire tablets, Hatch sound machine, Osprey toddler carrier, road trip game kit]

We usually stay in: [Airbnbs / hotels/campsites — pick the most common]

When I describe a trip, generate a packing list with:

- A &quot;Don&#39;t Forget&quot; section at the top for medications and allergy items

- Sections: Clothes (broken down per person), Car Kit, Entertainment, Snacks, First Aid, Hiking/Activity Gear, Documents

- Checkbox format throughout

- Flag any item I&#39;d need to buy with ★ (assume I own everything listed in my gear above)

- Assume mountain nights are cold unless I say otherwise</code></pre></div><p class="paragraph" style="text-align:left;">Fill in your family&#39;s details and paste them into the project instructions. You&#39;re done with setup. The more details, the better. Giving Claude more context around your family helps plan these trips better.</p><h2 class="heading" style="text-align:left;" id="step-3-generate-the-packing-list">Step 3 – Generate the packing list</h2><p class="paragraph" style="text-align:left;">Start a new conversation inside the project and send one message describing your trip. That&#39;s all Claude needs.</p><p class="paragraph" style="text-align:left;">Here is the conversation I started for our recent camping trip.</p><div class="codeblock"><pre><code>4 day trip to Traverse city Michigan in late april, camping</code></pre></div><p class="paragraph" style="text-align:left;">Here&#39;s what came back for our family (kids 2, Van with roof rack):</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/c2f4dc1a-9fb4-43a0-aa23-94b384042c75/Screenshot_2026-05-01_at_9.12.06_AM.png?t=1777647188"/></div><p class="paragraph" style="text-align:left;">That took about fifteen seconds. The list is specific to two kids at those ages and accounts for April temperatures.</p><h2 class="heading" style="text-align:left;" id="common-mistakes-to-avoid">Common Mistakes to Avoid</h2><p class="paragraph" style="text-align:left;"><b>Leave out the accommodation type, and you get hotel assumptions</b>. If your system prompt says &quot;we usually stay in Airbnbs,&quot; but you&#39;re going camping, Claude will skip sleeping bags, camp chairs, and anything that assumes no kitchen. Add it to your trip message: &quot;4 nights, Acadia, August, tent camping.&quot;</p><p class="paragraph" style="text-align:left;"><b>Leave out the season, and the clothing guidance becomes useless</b>. Yellowstone in July and Yellowstone in October are completely different packing problems. The mountain July nights are one thing — but fall means serious layers and a much higher chance of rain. Claude won&#39;t guess. Tell it the month.</p><p class="paragraph" style="text-align:left;"><b>Vague duration without a per-person breakdown gets vague results</b>. &quot;Pack for 4 nights&quot; without the per-person detail means Claude might write &quot;enough clothes for each person&quot; — which helps nobody. The format instruction in the system prompt fixes this: &quot;broken down per person&quot; makes it explicit.</p><p class="paragraph" style="text-align:left;"><b>No gear inventory means the list reads like a shopping cart</b>. The first time I ran this without listing owned gear, the output included &quot;Yeti cooler ($350)&quot; and &quot;kids&#39; tablets&quot; as if I were buying them new. Once the inventory is in the system prompt, flagged buy items are actually things you&#39;d need to buy — not things sitting in your garage.</p><p class="paragraph" style="text-align:left;"><b>Leaving out kids&#39; ages collapses the list to one-size-fits-all</b>. Without ages, Claude produces a single children&#39;s section with suggestions that land nowhere — too old for the toddler, too young for the school-age kid. Ages aren&#39;t just about what to pack, they&#39;re about how much to pack (toddlers need backup sets; seven-year-olds don&#39;t spill as often).</p><p class="paragraph" style="text-align:left;">Setup takes about ten minutes — most of it is writing out your gear inventory and thinking about how you actually travel. After that, every trip is one message.</p><p class="paragraph" style="text-align:left;">The practical gain isn&#39;t just time (though dropping from twenty minutes of editing a generic list to fifteen seconds is real). It&#39;s that the list is actually built for your family. The 2-year-old&#39;s backup outfit count is right. The sound machine isn&#39;t on the list because Claude knows you own one. The cold-night layers are there because you told us you&#39;re going in April.</p><p class="paragraph" style="text-align:left;">The other thing worth noting is that the project gets better the more you use it. After a trip where you realize you forgot something, add it to your gear inventory or your system prompt. Over time, it becomes a genuine record of how your family travels — not a list someone else wrote.</p><p class="paragraph" style="text-align:left;">The same Projects approach works for other recurring tasks — like <a class="link" href="https://www.automation-almanac.com/p/automate-gmail-follow-ups-claude-desktop?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-get-a-custom-road-trip-packing-list-with-claude-projects" target="_blank" rel="noopener noreferrer nofollow">automating email follow-ups in Gmail</a> or running a <a class="link" href="https://www.automation-almanac.com/p/apple-shortcuts-cleaning-schedule?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-get-a-custom-road-trip-packing-list-with-claude-projects" target="_blank" rel="noopener noreferrer nofollow">weekly cleaning schedule on autopilot</a> with Apple Shortcuts.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=347440e4-7f0f-4003-a63e-24cf87a34fa3&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Automate Email Follow-Ups in Gmail with Claude Desktop</title>
  <description>Stop losing deals to forgotten follow-ups. Use Claude Desktop to automatically scan Gmail and post a daily Slack digest of every thread waiting on a reply — in both directions.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/ff9a9211-1621-4526-94b8-811f20bcfa75/How_to_Automate_Email_Follow-Ups_in_Gmail_with_Claude_Desktop.png" length="1330709" type="image/png"/>
  <link>https://www.automation-almanac.com/p/automate-gmail-follow-ups-claude-desktop</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/automate-gmail-follow-ups-claude-desktop</guid>
  <pubDate>Thu, 23 Apr 2026 16:45:30 +0000</pubDate>
  <atom:published>2026-04-23T16:45:30Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Claude Cowork]]></category>
    <category><![CDATA[Marketing Ops]]></category>
    <category><![CDATA[Gmail]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">I had an email in my inbox that I completely forgot to reply to; it was someone I intended to work with to build some interesting stuff. I didn&#39;t mean to miss it, who does? I just got busy, and his email got buried under all of the marketing emails I get. I would have missed out on some consulting revenue because I didn&#39;t have a system in place to remind me. So I put something together to remind me.</p><p class="paragraph" style="text-align:left;">Every morning, Claude Cowork goes through my inbox and looks for any emails that are waiting for me to reply to or that I&#39;m waiting for someone else to reply to. It will then send a wrap-up to Slack so I can follow up on anything I may be missing.</p><p class="paragraph" style="text-align:left;">If you do any outbound work — consulting, sales, partnerships, or even managing contractors — email threads are where deals quietly die. This isn&#39;t about being more responsive in real time. It&#39;s about having a system that catches the things you meant to follow up on but didn&#39;t.</p><h2 class="heading" style="text-align:left;" id="what-claude-desktop-does-here">What Claude Desktop Does Here</h2><p class="paragraph" style="text-align:left;">Claude Desktop has a built-in task scheduler called Cowork. You write a plain-English prompt, set a time, and it runs on that schedule using whatever MCP integrations you&#39;ve connected. I&#39;ve used it for <a class="link" href="https://www.automation-almanac.com/p/automate-your-newsroom-inbox-triage-with-claude-desktop?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-email-follow-ups-in-gmail-with-claude-desktop" target="_blank" rel="noopener noreferrer nofollow">newsroom inbox triage</a> and <a class="link" href="https://www.automation-almanac.com/p/how-to-create-linkedin-pdf-carousels-with-claude-cowork?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-email-follow-ups-in-gmail-with-claude-desktop" target="_blank" rel="noopener noreferrer nofollow">LinkedIn carousel generation</a> — Cowork is the part that makes it hands-off.</p><p class="paragraph" style="text-align:left;">For this, the setup is:</p><p class="paragraph" style="text-align:left;"><b>Gmail MCP</b>: Gives Claude read access to your inbox and sent folder</p><p class="paragraph" style="text-align:left;"><b>Slack MCP</b>: Let’s Claude post to a channel</p><p class="paragraph" style="text-align:left;"><b>One Cowork scheduled task</b>: The prompt that ties it together, running daily at 8 am</p><p class="paragraph" style="text-align:left;">The prompt tells Claude to search Gmail in two directions, filter out noise, read enough of each thread to write a one-liner, and post the digest to Slack. If nothing qualifies in either bucket, nothing gets posted.</p><p class="paragraph" style="text-align:left;">The reason this is worth building with Cowork rather than a Zap or a cron job is that you&#39;re not just triggering a fixed action — you&#39;re asking Claude to read and reason about actual email content. A Zap can fire when an email arrives; it can&#39;t tell you whether a reply was a genuine human response or an out-of-office. That judgment is what makes the filter useful.</p><h2 class="heading" style="text-align:left;" id="how-the-prompt-works">How the prompt works</h2><p class="paragraph" style="text-align:left;">You can find the full prompt at the end of the article, but only if you&#39;re a subscriber.</p><h3 class="heading" style="text-align:left;" id="step-1-finding-threads-where-youre-"><span style="color:#434343;">Step 1: Finding threads where you&#39;re waiting on a reply</span></h3><div class="codeblock"><pre><code>Search query: in:sent older_than:3d</code></pre></div><p class="paragraph" style="text-align:left;">That search query will return any email thread in which a message sent more than 3 days ago appears. One note here: <code>in:sent</code> returns all emails you sent during that window, not necessarily the most recent message in a thread. Claude will read the thread, determine which message is the last one, and add it to the list.</p><p class="paragraph" style="text-align:left;">The prompt also tells Claude to check whether anything appears to be an out-of-office or auto-reply, whether the email body contains more than 20 words and reads as if a person wrote it, and finally, to filter out any marketing emails that contain <code>unsubscribe</code> or <code>no-reply</code> language.</p><p class="paragraph" style="text-align:left;">If you send a lot of one-way emails — announcements, FYIs, newsletters — you may want to exclude your own domain from the results. You can add <code>to:-@yourdomain.com</code> to the search query or instruct Claude to skip threads where you&#39;re emailing your own organization. <a class="link" href="https://support.google.com/mail/answer/7190?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-email-follow-ups-in-gmail-with-claude-desktop" target="_blank" rel="noopener noreferrer nofollow">Gmail&#39;s advanced search operators</a> give you a lot of flexibility here beyond what&#39;s in the default prompt.</p><p class="paragraph" style="text-align:left;">Once it finds everything that passes the checks, it will add the threads to a list for sending to Slack.</p><h3 class="heading" style="text-align:left;" id="step-2-finding-threads-where-someon"><span style="color:#434343;">Step 2: Finding threads where someone is waiting on you</span></h3><div class="codeblock"><pre><code>Search query: in:inbox older_than:1d</code></pre></div><p class="paragraph" style="text-align:left;">That search query will return any email thread older than 24 hours. Claude checks whether the most recent message is from someone else — not a reply you already sent. It also filters out newsletters, generic messages, and promotional language.</p><p class="paragraph" style="text-align:left;">The prompt filters out anything with <code>List-Unsubscribe</code> headers, <code>unsubscribe</code> links in the body, or sender addresses containing <code>noreply</code>, <code>newsletter</code>, or <code>no-reply</code>. These catches cover the bulk of automated emails that land in your inbox.</p><p class="paragraph" style="text-align:left;">We don&#39;t need the <code>is:unread</code> search query here because we want to catch emails we&#39;ve opened but not responded to. Once Claude finds everything that passes this check, those threads get added to the list.</p><h3 class="heading" style="text-align:left;" id="step-3-post-to-slack"><span style="color:#434343;">Step 3: Post To Slack</span></h3><p class="paragraph" style="text-align:left;">Claude will then send both lists to your Slack channel as a single digest, oldest first. If both buckets are empty, nothing gets posted. If the Gmail MCP returns an error, Claude will post an error message instead.</p><p class="paragraph" style="text-align:left;">The output looks like this:</p><div class="codeblock"><pre><code>📬 Follow-Up Radar — April 22

⏳ WAITING ON THEM (3)

• Sarah @ Acme — &quot;Q2 contract&quot; — 5 days, no reply

• Mike — &quot;Invoice approval&quot; — 4 days, no reply

• hello@vendor.com — &quot;Pricing quote&quot; — 3 days, no reply

📥 WAITING ON YOU (2)

• Dan — &quot;Can you review the brief?&quot; — 2 days, no reply

• Julia — &quot;Quick question on the proposal&quot; — 1 day, no reply</code></pre></div><h2 class="heading" style="text-align:left;" id="how-to-set-it-up">How to Set It Up</h2><h3 class="heading" style="text-align:left;" id="step-1-connect-gmail-mcp"><span style="color:#434343;">Step 1: Connect Gmail MCP</span></h3><p class="paragraph" style="text-align:left;">Claude Desktop → Settings → Integrations → add the Gmail MCP and authorize it with the Gmail account you want to monitor. You need read access — the prompt doesn&#39;t write to Gmail, reads threads.</p><h3 class="heading" style="text-align:left;" id="step-2-connect-slack-mcp"><span style="color:#434343;">Step 2: Connect Slack MCP</span></h3><p class="paragraph" style="text-align:left;">Claude Desktop → Settings → Integrations → add the Slack MCP and authorize it with your workspace. Make sure the integration can post to the channel you want to use.</p><h3 class="heading" style="text-align:left;" id="step-3-set-up-the-cowork-scheduled-"><span style="color:#434343;">Step 3: Set up the Cowork scheduled task</span></h3><p class="paragraph" style="text-align:left;">Claude Desktop → Cowork → Scheduled Tasks → New Task.</p><p class="paragraph" style="text-align:left;">Set the frequency to <b>Daily</b> and the time to whatever works for your morning — I use 8:00 am so it&#39;s ready before I start working.</p><p class="paragraph" style="text-align:left;">Paste the full prompt from <code>prompt.md</code>. Replace <code>#your-channel</code> with the Slack channel name where you want the digest to land. Save.</p><h3 class="heading" style="text-align:left;" id="step-4-trigger-it-manually-once"><span style="color:#434343;">Step 4: Trigger it manually once</span></h3><p class="paragraph" style="text-align:left;">Before trusting it to run on schedule, trigger the task manually and watch the output. Confirm that Claude searches Gmail without errors, that the Slack message lands in the right channel, and that the thread summaries look right.</p><p class="paragraph" style="text-align:left;">If the digest is too noisy, adjust the thresholds:</p><ul><li><p class="paragraph" style="text-align:left;">Change <code>older_than:3d</code> to <code>older_than:5d</code> if you send a lot of cold outreach or FYIs</p></li><li><p class="paragraph" style="text-align:left;">Change <code>older_than:1d</code> to <code>older_than:2d</code> on the inbox side, if 24 hours feels too tight</p></li></ul><p class="paragraph" style="text-align:left;">You can also add sender-based filters directly in the prompt. If you only want to track threads with people at specific domains — a client list or a shortlist of prospects — add an instruction like: <i>&quot;Only include threads where the sender is not from my own domain and is from a domain I&#39;ve emailed more than once.&quot;</i> That significantly reduces noise for high-volume senders.</p><h2 class="heading" style="text-align:left;" id="what-to-watch-out-for">What to Watch Out For</h2><h3 class="heading" style="text-align:left;" id="insent-older-than-3-d-returns-threa"><code>in:sent older_than:3d</code><span style="color:#434343;"> returns threads, not messages</span></h3><p class="paragraph" style="text-align:left;">Gmail&#39;s search operators work at the thread level. A thread comes back in your <code>in:sent</code> results if any sent message in it falls in the window — even if someone already replied after. The prompt tells Claude to read each thread and confirm that your message is the last one, but this adds to the time the task takes to run on large sent folders.</p><h3 class="heading" style="text-align:left;" id="isunread-isnt-the-right-signal-for-"><code>is:unread</code><span style="color:#434343;"> isn&#39;t the right signal for &quot;waiting on you&quot;</span></h3><p class="paragraph" style="text-align:left;">The obvious approach for finding inbound emails you haven&#39;t answered is <code>is:unread</code>. The problem: you probably opened the email. It&#39;s marked read. It&#39;s just unanswered. The prompt uses a thread structure instead — it looks for threads in which the most recent message is from someone else, regardless of read status.</p><h3 class="heading" style="text-align:left;" id="autoreplies-look-like-real-replies"><span style="color:#434343;">Auto-replies look like real replies</span></h3><p class="paragraph" style="text-align:left;">Out-of-office responses, delivery confirmations, and Calendly booking notifications are all technically replies. If the prompt just checks &quot;did a reply arrive after my sent message,&quot; it&#39;ll skip threads that should still be on the radar. The filter looks for reply bodies under 20 words and flags anything that reads like a canned response.</p><h3 class="heading" style="text-align:left;" id="your-threshold-might-be-wrong-for-y"><span style="color:#434343;">Your threshold might be wrong for your inbox</span></h3><p class="paragraph" style="text-align:left;">Three days is a reasonable default for most business emails. If you send a lot of cold outreach, proposal follow-ups, or newsletter pitches, three days will catch everything — including things you never expected a reply to. Bump it to five or seven days for those cases. Same on the inbox side: 24 hours is tight if your contacts are in different time zones.</p><h3 class="heading" style="text-align:left;" id="the-machine-has-to-be-on"><span style="color:#434343;">The machine has to be on</span></h3><p class="paragraph" style="text-align:left;">This runs locally. Suppose your laptop is closed at 8 am, the task skips. For most desk-based workflows, that&#39;s fine. If you travel often or work irregular hours, you&#39;ll notice gaps.</p><p class="paragraph" style="text-align:left;">The cleanest fix is to convert the prompt logic into a server-side function that uses the Gmail API and Slack&#39;s Incoming Webhooks directly — no Claude Desktop dependency. I covered that pattern in <a class="link" href="https://www.automation-almanac.com/p/how-to-automate-omeda-email-reports-to-slack-with-firebase?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-email-follow-ups-in-gmail-with-claude-desktop" target="_blank" rel="noopener noreferrer nofollow">&quot;How to Automate Email Reports to Slack with Firebase</a>,&quot; and the structure carries over well. It&#39;s a bigger build, but it runs whether your laptop is open or not.</p><h2 class="heading" style="text-align:left;" id="taking-it-further">Taking It Further</h2><p class="paragraph" style="text-align:left;">A few variations worth trying once the base setup is working:</p><p class="paragraph" style="text-align:left;"><b>Track only a specific client list.</b> Add a filter to the prompt that only surfaces threads where the sender or recipient matches a list of domains you care about. Useful if you work with a fixed set of clients and don&#39;t want noise from cold contacts you never expected to hear back from.</p><p class="paragraph" style="text-align:left;"><b>Run it twice a day.</b> Morning for the daily review, afternoon for anything that came in during the day and needs a same-day reply. Set up a second Cowork task with a tighter <code>older_than:3h</code> window and route it to a separate Slack channel so it doesn&#39;t get mixed with your morning digest.</p><p class="paragraph" style="text-align:left;"><b>Add a priority signal.</b> Tell Claude to flag threads that mention words like &quot;contract,&quot; &quot;proposal,&quot; &quot;invoice,&quot; or &quot;deadline&quot; and prefix those entries with a 🔴 in the Slack message. That gives you a quick visual triage layer without having to read every summary.</p><p class="paragraph" style="text-align:left;">The goal is simple: surface things you&#39;ve forgotten about before the day gets away from you. Since it looks both ways — who you&#39;re waiting on and who&#39;s waiting on you — it&#39;s less of a reminder tool and more of a relationship radar.</p><p class="paragraph" style="text-align:left;">You&#39;ll need to tune the thresholds for your inbox. This is just a starting point. Only you know how you work.</p><h2 class="heading" style="text-align:left;" id="the-prompt">The Prompt</h2><div class="codeblock"><pre><code>You are a follow-up radar agent. Run this task every morning.

## Step 1 — Find threads where you are waiting on a reply

Use the Gmail MCP to search the sent folder for threads where your message is the most recent and no reply has arrived in more than 3 days.

Search query: `in:sent older_than:3d`

For each thread returned:
1. Read the full thread to confirm your sent message is the last message in the thread (not just one of the messages). If a reply exists after your sent message, skip this thread.
2. Check if the reply (if any) looks substantive. Ignore out-of-office auto-replies, delivery receipts, and responses with body text under 20 words.
3. If the sender domain or body contains any of the following, skip this thread — it is noise: `unsubscribe`, `noreply`, `no-reply`, `automated`, `notification`, `do not reply`, `list-unsubscribe`
4. If the thread passes all checks, add it to the WAITING ON THEM list with: sender name or email, subject line, number of days since your sent message.

Sort WAITING ON THEM oldest-first.

## Step 2 — Find threads where someone is waiting on you

Use the Gmail MCP to search the inbox for threads where an inbound message is the most recent and you have not replied within 24 hours.

Search query: `in:inbox older_than:1d`

For each thread returned:
1. Read the full thread to confirm the most recent message is from someone else (not from you). If your reply is the last message, skip this thread.
2. Skip threads where the sender domain or body contains: `unsubscribe`, `noreply`, `no-reply`, `automated`, `notification`, `do not reply`, `list-unsubscribe`
3. Skip threads where the message appears to be a newsletter, marketing email, or automated notification (bulk sender headers, generic salutation, promotional language).
4. If the thread passes all checks, add it to the WAITING ON YOU list with: sender name or email, subject line, number of days since their message.

Sort WAITING ON YOU oldest-first.

## Step 3 — Post to Slack

If both lists are empty, stop here. Do not post to Slack.

Otherwise, use the Slack MCP to post the following message to `#your-channel`:

```
📬 Follow-Up Radar — [TODAY&#39;S DATE, e.g. April 22]

⏳ WAITING ON THEM ([COUNT])
• [Sender name or email] — &quot;[Subject]&quot; — [X] days, no reply
[repeat for each thread, oldest first]

📥 WAITING ON YOU ([COUNT])
• [Sender name or email] — &quot;[Subject]&quot; — [X] days, no reply
[repeat for each thread, oldest first]
```

If only one bucket has items, omit the empty bucket&#39;s section entirely.

If the Gmail MCP returns an error on either search, post this instead:
```
⚠️ Follow-Up Radar — [TODAY&#39;S DATE] — Could not reach Gmail. Check your MCP connection.
```</code></pre></div></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=da7aa86d-8b46-449a-8c57-290475183619&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>Hotel Keycards as NFC Tags: 3 iPhone Automations</title>
  <description>Don&#39;t toss your hotel keycards. Use the NFC chip inside to trigger Apple Shortcuts on iPhone — laundry timers, gym texts, and auto-ETAs in one tap.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/37d2155a-9a49-4307-9319-4ce83b26f1d6/Hotel_Keycards_as_NFC_Tags_3_iPhone_Automations.png" length="873321" type="image/png"/>
  <link>https://www.automation-almanac.com/p/hotel-keycards-as-nfc-tags-3-iphone-automations</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/hotel-keycards-as-nfc-tags-3-iphone-automations</guid>
  <pubDate>Wed, 22 Apr 2026 16:03:26 +0000</pubDate>
  <atom:published>2026-04-22T16:03:26Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Apple Shortcuts]]></category>
    <category><![CDATA[Nfc]]></category>
    <category><![CDATA[Lifestyle]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">I used to travel for work, and I would always keep my hotel keycard. Not as a memento, even though some of the designs are fun. I&#39;m looking at you, Chicago Athletic Association.</p><p class="paragraph" style="text-align:left;">Hotel keycards have an NFC chip inside that you can use to trigger automations on your iPhone. Stash them around the house as reminders — like a timer that starts when you load the washing machine. We use one when either of us heads to the gym to text the other. My wife&#39;s favorite is the one in my car that texts her my location and ETA when I&#39;m done fishing and on my way home.</p><p class="paragraph" style="text-align:left;">The reason this works is that hotel keycards use the same 13.56 MHz NFC standard (ISO/IEC 14443) as the NFC tags you&#39;d buy online, so your iPhone treats them the same way. If you don&#39;t have any hotel keycards, don&#39;t spend a night away from the kids just to run this automation and get a little peace. You can buy <a class="link" href="https://www.amazon.com/s?k=nfc+tags&utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=hotel-keycards-as-nfc-tags-3-iphone-automations" target="_blank" rel="noopener noreferrer nofollow">NFC tags on Amazon</a> for a few bucks.</p><h2 class="heading" style="text-align:left;" id="can-you-reuse-hotel-keycards-as-nfc">Can You Reuse Hotel Keycards as NFC Tags?</h2><p class="paragraph" style="text-align:left;">Yes. Most modern hotel keycards (the thin plastic ones, not the older magnetic-stripe cards) contain a passive NFC chip — usually MIFARE Classic or MIFARE Ultralight. Your iPhone&#39;s NFC reader doesn&#39;t care what the card was originally programmed to do; it just reads the chip&#39;s unique ID and uses that as a trigger inside the Shortcuts app.</p><p class="paragraph" style="text-align:left;">You aren&#39;t unlocking the hotel room from your phone, and you aren&#39;t overwriting the card. You&#39;re using its existing ID as a &quot;this card = run this automation&quot; key.</p><h2 class="heading" style="text-align:left;" id="what-youll-need">What You&#39;ll Need</h2><ul><li><p class="paragraph" style="text-align:left;"><b>An iPhone XS or newer.</b> Background NFC scanning (tap the card to trigger an automation without opening any app) requires iPhone XS or later. Older models can read NFC, but only from inside the Shortcuts app or Control Center.</p></li><li><p class="paragraph" style="text-align:left;"><b>iOS 14 or newer</b>, with the <a class="link" href="https://support.apple.com/guide/shortcuts/welcome/ios?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=hotel-keycards-as-nfc-tags-3-iphone-automations" target="_blank" rel="noopener noreferrer nofollow">Shortcuts app</a> installed (it ships with iOS).</p></li><li><p class="paragraph" style="text-align:left;"><b>One or more NFC cards or tags.</b> Old hotel keycards work; so do cheap NFC stickers from Amazon.</p></li><li><p class="paragraph" style="text-align:left;">A few minutes per automation.</p></li></ul><p class="paragraph" style="text-align:left;">Here are the three automations we&#39;ll build:</p><ul><li><p class="paragraph" style="text-align:left;">Laundry timer</p></li><li><p class="paragraph" style="text-align:left;">Gym departure text</p></li><li><p class="paragraph" style="text-align:left;">Driving ETA text</p></li></ul><h2 class="heading" style="text-align:left;" id="setting-up-an-nfc-trigger-do-this-o">Setting Up an NFC Trigger (Do This Once)</h2><p class="paragraph" style="text-align:left;">Every NFC automation in this guide follows the same setup pattern, so it&#39;s worth memorizing:</p><ol start="1"><li><p class="paragraph" style="text-align:left;">Open the <b>Shortcuts</b> app and tap the <b>Automation</b> tab.</p></li><li><p class="paragraph" style="text-align:left;">Tap <b>+</b> → <b>New Automation</b>.</p></li><li><p class="paragraph" style="text-align:left;">Scroll down to <b>NFC</b> and tap it.</p></li><li><p class="paragraph" style="text-align:left;">Tap <b>Scan</b>, then hold your NFC card flat against the top back of your iPhone (where the camera is).</p></li><li><p class="paragraph" style="text-align:left;">When prompted, name the tag something memorable (e.g., &quot;Laundry,&quot; &quot;Gym,&quot; &quot;Car&quot;).</p></li><li><p class="paragraph" style="text-align:left;"><b>Important:</b> toggle <b>Run Immediately</b> on. Without this, iOS shows a confirmation banner every time, which defeats the one-tap experience.</p></li><li><p class="paragraph" style="text-align:left;">Pick the Shortcut you want this tag to run.</p></li></ol><p class="paragraph" style="text-align:left;">That&#39;s it. From now on, every automation below assumes you&#39;ve done these seven steps.</p><div class="image"><img alt="Apple Shortcuts NFC automation setup screen with Run Immediately toggled on" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/5315e704-9018-4a42-b158-1f413e8aabec/IMG_6302.PNG?t=1776831580"/></div><h2 class="heading" style="text-align:left;" id="how-do-you-start-a-laundry-timer-wi">How Do You Start a Laundry Timer with an NFC Tag?</h2><p class="paragraph" style="text-align:left;">You know the feeling: you load the washer, get on with your day, and realize hours later that the clothes are still in there — and now you&#39;re debating whether to wash them again. Not anymore.</p><p class="paragraph" style="text-align:left;"><b>Build the Shortcut:</b></p><ol start="1"><li><p class="paragraph" style="text-align:left;">In the Shortcuts app, tap <b>+</b> to create a new Shortcut.</p></li><li><p class="paragraph" style="text-align:left;">Add the <b>Start Timer</b> action.</p></li><li><p class="paragraph" style="text-align:left;">Set the duration to 45 minutes (or however long your washing machine cycle takes).</p></li><li><p class="paragraph" style="text-align:left;">Name the Shortcut &quot;Laundry timer.&quot;</p></li></ol><div class="image"><img alt="Apple Shortcut configured to start a 45-minute laundry timer" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/ade0323a-04f1-470d-8c0a-476d84dd6e47/IMG_6303.PNG?t=1776831870"/></div><p class="paragraph" style="text-align:left;">Then run through the seven NFC trigger steps above, picking &quot;Laundry timer&quot; as the Shortcut. Stick the NFC card on the lid of your washing machine. Tap it when you load the wash, and you&#39;ll get a notification 45 minutes later.</p><div class="image"><img alt="Completed NFC automation showing the Laundry timer Shortcut linked to a tag" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/e0398462-45d2-4576-96bc-3355d17d639c/IMG_6306.PNG?t=1776831964"/></div><h2 class="heading" style="text-align:left;" id="how-do-you-send-a-quick-gym-text-wi">How Do You Send a Quick Gym Text with NFC?</h2><p class="paragraph" style="text-align:left;">I send my wife a quick text when I head to the gym. She already has my location, but it&#39;s nice to know when someone&#39;s actually walked out the door. If you&#39;ve already set up a <a class="link" href="http:///p/personalized-workout-briefing-iphone-gym?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=hotel-keycards-as-nfc-tags-3-iphone-automations" target="_blank" rel="noopener noreferrer nofollow">personalized workout briefing on your iPhone</a>, this pairs nicely with that.</p><p class="paragraph" style="text-align:left;"><b>Build the Shortcut:</b></p><ol start="1"><li><p class="paragraph" style="text-align:left;">Create a new Shortcut.</p></li><li><p class="paragraph" style="text-align:left;">Add the <b>Send Message</b> action.</p></li><li><p class="paragraph" style="text-align:left;">Type your Message (&quot;Heading to the gym, back in an hour&quot;).</p></li><li><p class="paragraph" style="text-align:left;">Pick your partner as the recipient.</p></li></ol><div class="image"><img alt="Apple Shortcut sending a pre-written message to a contact" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/5ac296b9-099f-49f2-8fa7-819fcd097dff/IMG_6308.PNG?t=1776832266"/></div><p class="paragraph" style="text-align:left;">Run through the seven NFC trigger setup steps and link this Shortcut to a card you keep by the door (or in your gym bag).</p><h2 class="heading" style="text-align:left;" id="how-do-you-automatically-send-your-">How Do You Automatically Send Your Location and ETA?</h2><p class="paragraph" style="text-align:left;">I keep this NFC card in my car to let my wife know how long it&#39;ll take me to get home after a long day of fishing. I said fishing, not catching.</p><p class="paragraph" style="text-align:left;"><b>Build the Shortcut:</b></p><ol start="1"><li><p class="paragraph" style="text-align:left;">Add <b>Get Current Location</b>.</p></li><li><p class="paragraph" style="text-align:left;">Add <b>Get Travel Time</b> → set the destination to your home address, mode to Driving.</p></li><li><p class="paragraph" style="text-align:left;">Add a <b>Text</b> action that combines both, e.g., <code>On my way. ETA [Travel Time] from [Current Location].</code></p></li><li><p class="paragraph" style="text-align:left;">Add <b>Send Message</b> with the Text action&#39;s output as the body.</p></li></ol><div class="image"><img alt="Apple Shortcut combining current location and driving travel time into a text message" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/fdb76c59-a1c0-4ee7-b06c-3b1c43668912/IMG_6309.PNG?t=1776832381"/></div><p class="paragraph" style="text-align:left;">Run through the seven NFC trigger setup steps and stick the card somewhere visible in your car — center console, dashboard, or the back of your phone mount.</p><h2 class="heading" style="text-align:left;" id="troubleshooting">Troubleshooting</h2><p class="paragraph" style="text-align:left;"><b>The automation doesn&#39;t fire when I tap the card.</b></p><p class="paragraph" style="text-align:left;">Background NFC scanning needs iPhone XS or newer. On older models, you&#39;ll have to open the Shortcuts app or use the NFC Tag Reader in Control Center.</p><p class="paragraph" style="text-align:left;"><b>iOS asks me to confirm every single time.</b></p><p class="paragraph" style="text-align:left;">You missed the <b>Run Immediately</b> toggle in step 6 above. Edit the automation and turn it on.</p><p class="paragraph" style="text-align:left;"><b>The card isn&#39;t being read.</b></p><p class="paragraph" style="text-align:left;">Hold the card flat against the top third of the back of your iPhone (near the camera). NFC range is roughly 1–2 cm; if there&#39;s a thick case or wallet in the way, it won&#39;t read.</p><p class="paragraph" style="text-align:left;"><b>Some hotel keycards don&#39;t seem to work.</b></p><p class="paragraph" style="text-align:left;">Older cards with only a magnetic stripe (no chip) won&#39;t work — those are pre-NFC. The plastic cards from major chains in the last 5–10 years have almost always had NFC.</p><p class="paragraph" style="text-align:left;"><b>Can I overwrite a hotel keycard with my own data?</b></p><p class="paragraph" style="text-align:left;">For these automations, no, and you don&#39;t need to. iOS triggers off the card&#39;s existing unique ID. If you want to write custom NDEF data, you&#39;ll need a separate NFC writer app, but it&#39;s not required here.</p><h2 class="heading" style="text-align:left;" id="where-to-go-next">Where to Go Next</h2><p class="paragraph" style="text-align:left;">Apple Shortcuts is one of those tools that compounds the more you use it. If you liked this, take a look at <a class="link" href="http:///p/automate-household-cleaning-schedule-apple-shortcuts?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=hotel-keycards-as-nfc-tags-3-iphone-automations" target="_blank" rel="noopener noreferrer nofollow">How to Automate Your Household Cleaning Schedule with Apple Shortcuts</a> for another low-effort, high-payoff automation.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=513a0eb5-1ae3-40b4-9a93-97f8fb0bcf37&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Create LinkedIn PDF Carousels with Claude Cowork</title>
  <description>Turn any article into a branded LinkedIn PDF carousel in minutes using Claude Cowork — step-by-step guide with prompts, no designer needed.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/ca51f90a-0122-47ca-9fcf-ee25130c60fc/How_to_Create_LinkedIn_PDF_Carousels_with_Claude_Cowork.png" length="1359076" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-create-linkedin-pdf-carousels-with-claude-cowork</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-create-linkedin-pdf-carousels-with-claude-cowork</guid>
  <pubDate>Fri, 17 Apr 2026 00:00:12 +0000</pubDate>
  <atom:published>2026-04-17T00:00:12Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Claude Cowork]]></category>
    <category><![CDATA[Marketing Ops]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">If you&#39;ve ever run marketing for a B2B media company, you know that LinkedIn PDF carousels are one of the best-performing content formats on the platform. You&#39;ll also know they can be a pain to produce. My workflow has always been to find the most popular article, break it down into 3–5 key points, have a designer put it together, and then post. Once a week isn&#39;t bad, but if you&#39;re managing 5 or 6 brands, that&#39;s easily an hour or two every time.</p><p class="paragraph" style="text-align:left;">Claude Cowork can take most of that off your plate. Give it an article URL, and it will summarize the content, structure it into cards, and generate a designed PDF based on your brand guidelines. The first time takes about 15 minutes to set up. After that, under 5 minutes per carousel.</p><p class="paragraph" style="text-align:left;">You&#39;ll spend a little time upfront getting the brand template right, but after that, it&#39;s as simple as dropping in a URL.</p><h2 class="heading" style="text-align:left;" id="why-linked-in-pdf-carousels-perform">Why LinkedIn PDF Carousels Perform</h2><p class="paragraph" style="text-align:left;">LinkedIn treats PDF uploads as native documents — they display as swipeable carousels directly in the feed, no external link required. That matters because LinkedIn&#39;s algorithm rewards dwell time: every swipe is a signal that someone engaged with your content. Educational carousels also sit in a sweet spot where they feel useful rather than promotional, making people more likely to save and share them.</p><p class="paragraph" style="text-align:left;">If you&#39;re posting consistently for a B2B brand, carousels are one of the few formats where you can repurpose existing content — a blog post, a case study, a newsletter issue — and get meaningful engagement without writing something new from scratch.</p><h2 class="heading" style="text-align:left;" id="what-youll-need">What You&#39;ll Need</h2><ul><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://claude.ai?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-create-linkedin-pdf-carousels-with-claude-cowork" target="_blank" rel="noopener noreferrer nofollow">Claude Cowork</a></p></li><li><p class="paragraph" style="text-align:left;">An article</p></li><li><p class="paragraph" style="text-align:left;">Your Brand Guidelines</p></li><li><p class="paragraph" style="text-align:left;">A PNG of your logo</p></li></ul><h2 class="heading" style="text-align:left;" id="your-brand-guidelines">Your Brand Guidelines</h2><p class="paragraph" style="text-align:left;">Before you start, spend a few minutes filling out your brand guidelines so Claude Cowork gets the colors and font styles right. Here&#39;s a sample:</p><div class="codeblock"><pre><code>Brand name: Meridian
Primary color: #1B3A5C (deep navy)
Accent color: #F0A500 (gold)
Background: #F7F4EF (warm cream)
Font style: Modern/clean sans-serif
Tone: Professional, authoritative, forward-thinking
Card count: 7 (cover + 5 insights + closing CTA)
Handle: @meridianinsights</code></pre></div><h2 class="heading" style="text-align:left;" id="how-to-build-a-linked-in-pdf-carous">How to Build a LinkedIn PDF Carousel in 4 Steps</h2><h3 class="heading" style="text-align:left;" id="step-1-add-the-right-skills-and-plu"><span style="color:#434343;">Step 1 – Add the right skills and plugins</span></h3><p class="paragraph" style="text-align:left;">Open Claude Cowork. In the left-hand sidebar, you&#39;ll see Customize; click it. We&#39;re going to add some plugins and skills as helpers to give our process more design and marketing lift.</p><p class="paragraph" style="text-align:left;">Click the Add Plugin button. We&#39;ll be adding the Marketing and Design plugins from Anthropic. The Marketing plugin helps Claude frame content for the right audience and platform tone. The Design plugin gives it better judgment on layout, spacing, and visual hierarchy — so instead of a generic PDF, you get something that actually looks like your brand. </p><div class="image"><img alt="Claude Cowork sidebar with the Add Plugin button open and the Marketing and Design plugins highlighted for selection" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/5b4d496f-a8fd-407b-8042-286cb85a05fd/image.png?t=1776383309"/></div><p class="paragraph" style="text-align:left;">You can then click on Skills in the top left-hand corner and find the <code>/canvas-design</code> skill. With these plugins and skills active, Claude Cowork will produce tighter designs and stay consistent with the guidelines you&#39;ve set.</p><h3 class="heading" style="text-align:left;" id="step-2-paste-your-brand-guidelines"><span style="color:#434343;">Step 2– Paste your brand guidelines</span></h3><p class="paragraph" style="text-align:left;">Paste your brand guidelines into the conversation like this:</p><div class="codeblock"><pre><code>Here are my Brand Guidelines for this project:

Brand name:       Automation Almanac
Primary color:    #8B4993
Background:       #F6F6F3
Text color:       #1A1A1A
Font style:       Inter
Tone:             Conversational
Card count:       5 cards total (cover + 3 insights + closing CTA)
Platform:         LinkedIn</code></pre></div><p class="paragraph" style="text-align:left;">Tell Claude Cowork to save these brand guidelines for the project. That way, you&#39;re not pasting them every session — it&#39;ll pull from context, use fewer tokens, and stay consistent.</p><h3 class="heading" style="text-align:left;" id="step-3-build-the-carousel-structure"><span style="color:#434343;">Step 3 – Build the carousel structure</span></h3><p class="paragraph" style="text-align:left;">Give Claude Cowork the brief for how to structure the carousel.</p><div class="codeblock"><pre><code>Please analyze this article and propose a carousel structure.

For each card, give me:

- Card type (cover/insight/closing)
- Headline (max 12 words)
- Body text (max 4 sentences / 100 words)
- Any visual direction (e.g., &quot;use accent color for the number&quot;)

Use my Brand Guidelines to set the tone and framing throughout.

Show me the full proposed structure BEFORE generating the PDF so I can review and request changes.</code></pre></div><div class="image"><img alt="Claude Cowork output showing a full LinkedIn carousel structure broken into labeled cover, insight, and closing card sections" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/7f745e3b-2cac-4cc0-8b37-5c158a111e4b/image.png?t=1776383309"/></div><p class="paragraph" style="text-align:left;"></p><p class="paragraph" style="text-align:left;">This gives you a structured draft broken into cards. If anything needs adjusting, tell Claude Cowork exactly what to change and where.</p><div class="codeblock"><pre><code>Please make the following changes to the proposed card structure:

Card [NUMBER]: [Describe the specific change — headline, body, or both]

Card [NUMBER]: [Another change]

Everything else looks good. Once these are updated, confirm the revised structure, and I&#39;ll ask you to generate the PDF.</code></pre></div><h3 class="heading" style="text-align:left;" id="step-4-generate-the-pdf"><span style="color:#434343;">Step 4– Generate the PDF</span></h3><p class="paragraph" style="text-align:left;">This is where Claude Cowork shines. It&#39;ll generate the PDF using your brand colors, drawing on the skills and plugins from Step 1 to push the design further. Here&#39;s the prompt:</p><div class="codeblock"><pre><code>The card structure looks great. Please generate the full PDF carousel now.

Design requirements:

- Use my Brand Guidelines for all color, font, and layout decisions

- Cover card: primary color background, bold headline, accent-colored number or stat

- Content cards: background color from Brand Guidelines, large ghosted card number for depth,

  accent underline beneath each headline, body text in a readable size

- Progress dots at the bottom of every card (highlight the current card)

- Closing card: primary color background, bold takeaway statement, CTA button in accent color

- Brand name/handle in the footer of every card

- Nothing should overflow card edges — all text must have clear breathing room

Output: a single multi-page PDF where each page is one carousel card.</code></pre></div><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/0cc8c0a1-d8eb-43f2-ae17-2a2e1ccd1b56/image.png?t=1776383309"/></div><p class="paragraph" style="text-align:left;"></p><p class="paragraph" style="text-align:left;">If the PDF needs visual tweaks, use targeted feedback.</p><div class="codeblock"><pre><code>The PDF looks good overall. Please make these specific design adjustments

and regenerate:

- Make the background number on content cards more subtle — reduce opacity to around 8%

- Increase the headline font size on content cards from 24pt to 28pt

- The CTA button on the closing card should be wider — extend it to the full card width minus margins

Keep everything else the same.</code></pre></div><p class="paragraph" style="text-align:left;">Iterate until it looks right, then ask Claude Cowork to update the design spec so you don&#39;t have to repeat the same feedback next time.</p><div class="image"><img alt="Automation Almanac Claude Code Linkedin Carousel" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/24d22493-63c7-4cb2-b343-461fa459ea0c/Screenshot_2026-04-16_at_6.54.08_PM.png?t=1776383670"/></div><div class="image"><img alt="Automation Almanac Claude Code Linkedin Carousel" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/3f807435-d2e4-490b-8d9a-c22cc9aefa44/Screenshot_2026-04-16_at_6.54.14_PM.png?t=1776383691"/></div><h2 class="heading" style="text-align:left;" id="troubleshooting">Troubleshooting</h2><p class="paragraph" style="text-align:left;"><b>Text overflows the card edges.</b> Reduce the body text length in the prompt (try 80 words max instead of 100), or ask Claude Cowork to increase the card margin and reduce font size by 2pt.</p><p class="paragraph" style="text-align:left;"><b>The colors don&#39;t match your brand.</b> Make sure your hex codes are passed explicitly in the brand guidelines. Vague descriptions like &quot;navy blue&quot; can drift across generations — specific hex values don&#39;t.</p><p class="paragraph" style="text-align:left;"><b>The design looks too generic</b>. Explicitly mention the <code>/canvas-design</code> skill in your generation prompt: &quot;Apply the canvas-design skill for layout decisions.&quot; The plugins and skills don&#39;t always activate unless prompted directly.</p><p class="paragraph" style="text-align:left;"><b>Claude Cowork can&#39;t access the article URL</b>. Paste the article text directly into the conversation instead of the URL. The output will be the same.</p><h2 class="heading" style="text-align:left;" id="faq">FAQ</h2><p class="paragraph" style="text-align:left;"><b>Can I use this for any article?</b></p><p class="paragraph" style="text-align:left;">Yes — blog posts, newsletter issues, case studies, and even long LinkedIn posts all work well as source material. The longer and more structured the content, the easier it is for Claude Cowork to pull distinct insights for each card.</p><p class="paragraph" style="text-align:left;"><b>Can I adapt this for other platforms?</b></p><p class="paragraph" style="text-align:left;">Absolutely. Instagram carousels use a square format (1:1), and Twitter/X threads work well as a plain-text variation of the same structure. The prompts transfer with minor adjustments to card count and aspect ratio.</p><p class="paragraph" style="text-align:left;"><b>How do I post the PDF to LinkedIn?</b></p><p class="paragraph" style="text-align:left;">When creating a LinkedIn post, click the document icon (the page with a folded corner) below the text box. Upload your PDF, and LinkedIn will automatically display it as a swipeable carousel in the feed.</p><h2 class="heading" style="text-align:left;" id="wrapping-up">Wrapping Up</h2><p class="paragraph" style="text-align:left;">Once you&#39;ve got the brand template dialed in, this whole process takes under five minutes per carousel. Drop in a URL, review the card structure, tweak anything that doesn&#39;t feel right, and you&#39;ve got a publish-ready PDF — no design back-and-forth, no layout juggling.</p><p class="paragraph" style="text-align:left;">Suppose you&#39;re running multiple brands or posting carousels regularly, the time savings compound fast. And since the brand spec lives in the project, every new carousel starts from a consistent baseline.</p><p class="paragraph" style="text-align:left;">Claude Cowork handles more than content repurposing. I&#39;ve also written about <a class="link" href="https://www.automation-almanac.com/p/how-to-automate-customer-service-emails-with-claude-code?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-create-linkedin-pdf-carousels-with-claude-cowork" target="_blank" rel="noopener noreferrer nofollow">automating customer service email replies with Gmail and Stripe</a> and <a class="link" href="https://www.automation-almanac.com/p/automate-your-newsroom-inbox-triage-with-claude-desktop?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-create-linkedin-pdf-carousels-with-claude-cowork" target="_blank" rel="noopener noreferrer nofollow">triaging a newsroom inbox on autopilot</a>. If you want to use Claude across your broader B2B marketing stack, the <a class="link" href="https://www.automation-almanac.com/p/research-500-companies-in-an-afternoon-with-google-sheets-claude?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-create-linkedin-pdf-carousels-with-claude-cowork" target="_blank" rel="noopener noreferrer nofollow">Google Sheets + Claude company research guide</a> is a good next read.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=c2703394-c5bd-4d3a-b298-dbd24ccaff38&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>Automate Your Cleaning Schedule with Apple Shortcuts</title>
  <description>One Apple Shortcut that texts your household every Sunday with this week&#39;s cleaning tasks — using Reminders as the database. No app, no server, no subscription.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/6edb1ae3-6233-4e67-a78f-23e89f1bf4ce/Automate_Your_Cleaning_Schedule_with_Apple_Shortcuts.png" length="1049724" type="image/png"/>
  <link>https://www.automation-almanac.com/p/apple-shortcuts-cleaning-schedule</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/apple-shortcuts-cleaning-schedule</guid>
  <pubDate>Wed, 15 Apr 2026 21:24:03 +0000</pubDate>
  <atom:published>2026-04-15T21:24:03Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Automation]]></category>
    <category><![CDATA[Apple Shortcuts]]></category>
    <category><![CDATA[Lifestyle]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">One day, I started looking around my house and noticed all the little things that needed cleaning more regularly. Change the air filter, clean the oven, and run a cleaning cycle on the washing machine. It’s not that I forgot to do any of those things — I just kept putting more important things in front of them.</p><p class="paragraph" style="text-align:left;">I didn’t have a system for this, so I built one. I used Apple Reminders as the task database and Apple Shortcuts to text my household every Sunday with whatever is due that week.</p><p class="paragraph" style="text-align:left;">It’s made a real difference — I actually know when I last changed the air filter or cleaned the vacuum. If you want to apply the same idea to your family&#39;s weekly schedule, I&#39;ve got a <a class="link" href="https://www.automation-almanac.com/p/apple-shortcuts-weekly-family-schedule-imessage?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=automate-your-cleaning-schedule-with-apple-shortcuts" target="_blank" rel="noopener noreferrer nofollow">similar setup for that</a>, too.</p><h2 class="heading" style="text-align:left;" id="what-youll-need">What You&#39;ll Need</h2><ul><li><p class="paragraph" style="text-align:left;">iPhone with iOS 16 or later</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://support.apple.com/guide/shortcuts/welcome/ios?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=automate-your-cleaning-schedule-with-apple-shortcuts" target="_blank" rel="noopener noreferrer nofollow">Apple Shortcuts app</a> (built-in — no download needed)</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://support.apple.com/guide/iphone/reminders-iphf52c3aaee/ios?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=automate-your-cleaning-schedule-with-apple-shortcuts" target="_blank" rel="noopener noreferrer nofollow">Apple Reminders app</a> (built-in)</p></li><li><p class="paragraph" style="text-align:left;">A household group chat in iMessage</p></li></ul><h2 class="heading" style="text-align:left;" id="setting-up-your-cleaning-reminders-">Setting Up Your Cleaning Reminders List</h2><p class="paragraph" style="text-align:left;">The Reminders app will serve as your task database. Each cleaning task lives there with its own repeat schedule — weekly, monthly, every 3 months, whatever makes sense. Reminders handles all of that natively, which means you don&#39;t need a spreadsheet or a third-party app. Managing the List later is as simple as opening Reminders and editing a task.</p><h3 class="heading" style="text-align:left;" id="step-1-create-a-cleaning-list"><span style="color:#434343;">Step 1 — Create a Cleaning list</span></h3><p class="paragraph" style="text-align:left;">Open the Reminders app, tap <b>Add List</b>, and name it <b>Cleaning</b>. This keeps your cleaning tasks separate from everything else and helps the Shortcut find them later.</p><h3 class="heading" style="text-align:left;" id="step-2-add-your-tasks"><span style="color:#434343;">Step 2 — Add your tasks</span></h3><p class="paragraph" style="text-align:left;">For each cleaning task, add a new Reminder to the Cleaning list and set:</p><ul><li><p class="paragraph" style="text-align:left;"><b>Name</b>: Be specific. &quot;Clean the bathroom&quot; beats &quot;bathroom.&quot;</p></li><li><p class="paragraph" style="text-align:left;"><b>Date</b>: Set it to the next scheduled time for the task.</p></li><li><p class="paragraph" style="text-align:left;"><b>Repeat</b>: Choose the right cadence. Examples:</p></li></ul><div class="image"><img alt="Apple Reminders app showing a Cleaning list with tasks like &quot;Clean the bathroom&quot; and &quot;Change the air filter,&quot; each set to a different repeat schedule" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/4047dc73-3bb6-404a-8254-71d6aa296042/image.png?t=1776286679"/></div><h2 class="heading" style="text-align:left;" id="building-the-shortcut">Building the Shortcut</h2><p class="paragraph" style="text-align:left;">This Shortcut runs every Sunday morning. It grabs what&#39;s due from your Cleaning list, filters out anything already done, and sends a single text to the household. If nothing is due, it stays quiet.</p><h3 class="heading" style="text-align:left;" id="step-1-calculate-your-date-boundari"><span style="color:#434343;">Step 1 — Calculate your date boundaries</span></h3><p class="paragraph" style="text-align:left;">Before getting the List of Reminders, you need two dates as variables:</p><ul><li><p class="paragraph" style="text-align:left;"><b>DueCeiling</b> — 7 days from now (the upper bound for tasks due this week)</p></li><li><p class="paragraph" style="text-align:left;"><b>DoneFloor</b> — 7 days ago (how far back to look for recently completed tasks)</p></li></ul><p class="paragraph" style="text-align:left;">Add a <code>Date</code> action set to <b>Current Date</b>. Then add two <code>Adjust Date</code> actions:</p><ul><li><p class="paragraph" style="text-align:left;">First: Add 7 Days → set variable <b>DueCeiling</b></p></li><li><p class="paragraph" style="text-align:left;">Second: Subtract 7 Days → set variable <b>DoneFloor</b></p></li></ul><div class="image"><img alt="Apple Shortcuts editor showing a Current Date action followed by two Adjust Date actions — one adding 7 days saved as DueCeiling, one subtracting 7 days saved as DoneFloor" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/4d8562d4-a13f-4280-b8ac-231140e6f32c/image.png?t=1776286679"/></div><h3 class="heading" style="text-align:left;" id="step-2-find-upcoming-tasks"><span style="color:#434343;">Step 2 — Find upcoming tasks</span></h3><p class="paragraph" style="text-align:left;">Add a <code>Find Reminders</code> action and configure it:</p><ul><li><p class="paragraph" style="text-align:left;"><b>List</b>: Cleaning</p></li><li><p class="paragraph" style="text-align:left;"><b>Filter</b>: Is Not Completed</p></li><li><p class="paragraph" style="text-align:left;"><b>Filter</b>: Due Date is before <b>DueCeiling</b></p></li><li><p class="paragraph" style="text-align:left;"><b>Sort by</b>: Due Date, Oldest First</p></li><li><p class="paragraph" style="text-align:left;"><b>Limit</b>: Off</p></li></ul><p class="paragraph" style="text-align:left;">Set the output variable to <b>UpcomingTasks</b>.</p><p class="paragraph" style="text-align:left;">There is no &quot;due in the next 7 days&quot; option in Shortcuts — this is the workaround. Without the <b>DueCeiling</b> variable, you&#39;d get every overdue task you&#39;ve never marked done, going all the way back to when you created the List.</p><div class="image"><img alt="Apple Shortcuts Find Reminders action configured to search the Cleaning list for incomplete reminders with a due date before the DueCeiling variable, sorted by oldest first" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/9431f940-052f-45e1-b9cb-6baa147b5d7b/image.png?t=1776286679"/></div><h3 class="heading" style="text-align:left;" id="step-3-find-recently-completed-task"><span style="color:#434343;">Step 3 — Find recently completed tasks.</span></h3><p class="paragraph" style="text-align:left;">Add a second <code>Find Reminders</code> action:</p><ul><li><p class="paragraph" style="text-align:left;"><b>List</b>: Cleaning</p></li><li><p class="paragraph" style="text-align:left;"><b>Filter</b>: Is Completed</p></li><li><p class="paragraph" style="text-align:left;"><b>Filter</b>: Completion Date is after <b>DoneFloor</b></p></li></ul><p class="paragraph" style="text-align:left;">Set the output variable to <b>RecentlyDone</b>.</p><p class="paragraph" style="text-align:left;">This is what keeps the Shortcut from nagging you about something you just did. Without this query, you could scrub the bathroom on Friday and still get the reminder on Sunday.</p><div class="image"><img alt="Apple Shortcuts Find Reminders action configured to search the Cleaning list for completed reminders with a completion date after the DoneFloor variable" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/22b951e0-d9c7-4c07-bbee-d4db410e2201/image.png?t=1776286679"/></div><h3 class="heading" style="text-align:left;" id="step-4-initialize-the-message-varia"><span style="color:#434343;">Step 4 — Initialize the message variable</span></h3><p class="paragraph" style="text-align:left;">Add a <code>Text</code> action, leave it blank, and name the variable <b>CleaningMessage</b>. This is the running text that gets built up as you loop through tasks. Starting it empty means you can check at the end whether anything was actually added.</p><h3 class="heading" style="text-align:left;" id="step-5-loop-through-and-crossrefere"><span style="color:#434343;">Step 5 — Loop through and cross-reference</span></h3><p class="paragraph" style="text-align:left;">Add a <code>Repeat with Each</code> action over <b>UpcomingTasks</b>. Inside the loop, you need to extract the task name, save it, then check it against your recently done List.</p><p class="paragraph" style="text-align:left;">Add a <code>Repeat with Each</code> action over <b>UpcomingTasks</b>. Inside the loop:</p><ol start="1"><li><p class="paragraph" style="text-align:left;">Add a <code>Get Details of Reminders</code> action. Set the detail to <b>Title</b> and the input to <b>Repeat Item</b> (the magic variable representing the current task in the loop).</p></li><li><p class="paragraph" style="text-align:left;">Add a <code>Text</code> action containing <b>Repeat Item</b>. This converts the current task to plain text so Shortcuts can check it against the recently done List.</p></li><li><p class="paragraph" style="text-align:left;">Add an <code>If</code> block. Set the condition to: <b>Text</b> → <b>contains</b> → <b>RecentlyDone</b>.</p></li></ol><ul><li><p class="paragraph" style="text-align:left;"><b>If the condition is true</b> —the task was completed recently—do nothing; let the loop move on.</p></li><li><p class="paragraph" style="text-align:left;"><b>Otherwise</b><b>:</b> add a <code>Text</code> action <code>— </code> followed by <b>Repeat Item</b>, then an <code>Add to Variable</code> action appending to <b>CleaningMessage</b>.</p></li></ul><div class="image"><img alt="Apple Shortcuts Repeat with Each loop showing Get Details of Reminders, a Text action, and an If block that skips recently completed tasks and appends the rest to CleaningMessage" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/ef96f410-c986-403f-8c4e-3e441238d572/image.png?t=1776286679"/></div><p class="paragraph" style="text-align:left;">The <code>contains</code> check searches the <b>RecentlyDone</b> List for the specified title text. Keep your task names consistent — if you rename &quot;Clean bathroom&quot; to &quot;Scrub bathroom&quot; at some point, the match will break, and a recently done task could slip through.</p><h2 class="heading" style="text-align:left;" id="step-6-send-or-stay-silent">Step 6 — Send or stay silent</h2><p class="paragraph" style="text-align:left;">After the loop, add an <code>If</code> block. Set the condition to: <b>CleaningMessage</b> → <b>does not have any value</b>.</p><ul><li><p class="paragraph" style="text-align:left;"><b>If true</b><b>:</b> End the Shortcut. Nothing is due — no text sent.</p></li><li><p class="paragraph" style="text-align:left;"><b>Otherwise</b><b>:</b> Add a <code>Text</code> action:</p></li></ul><div class="codeblock"><pre><code>Cleaning this week:

[CleaningMessage]</code></pre></div><p class="paragraph" style="text-align:left;">Then add a <code>Send Message</code> action:</p><ul><li><p class="paragraph" style="text-align:left;"><b>Message</b><b>:</b> the text above</p></li><li><p class="paragraph" style="text-align:left;"><b>Recipients</b><b>:</b> your household group chat</p></li></ul><div class="image"><img alt="Apple Shortcuts If block checking whether CleaningMessage has a value, with a Send Message action that delivers the weekly cleaning list to a household group chat" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/547cfeec-c9c2-46b8-956a-b6b9863a1115/image.png?t=1776286679"/></div><h2 class="heading" style="text-align:left;" id="setting-the-automation">Setting the Automation</h2><p class="paragraph" style="text-align:left;">In the Shortcuts app, tap the <b>Automation</b> tab at the bottom, then tap <b>+</b> → <b>Time of Day</b>.</p><ul><li><p class="paragraph" style="text-align:left;"><b>Time</b><b>:</b> 8:00 AM</p></li><li><p class="paragraph" style="text-align:left;"><b>Day</b><b>:</b> Every Sunday</p></li><li><p class="paragraph" style="text-align:left;"><b>Run After Confirming</b><b>:</b> Off — toggle this to fire the Shortcut automatically without needing your approval each time.</p></li></ul><p class="paragraph" style="text-align:left;">Select your Cleaning Schedule Shortcut and save.</p><p class="paragraph" style="text-align:left;">Every Sunday at 8am, your household receives a text with the week&#39;s tasks. If nothing is due or everything&#39;s already been handled, it stays quiet.</p><h2 class="heading" style="text-align:left;" id="common-issues-and-workarounds">Common Issues and Workarounds</h2><p class="paragraph" style="text-align:left;"><b>&quot;Next 7 days&quot; doesn&#39;t exist in Shortcuts.</b></p><p class="paragraph" style="text-align:left;">The Find Reminders action has no built-in &quot;due in the next N days&quot; filter. You have to calculate a future date and use &quot;due date is before [variable]&quot; as the ceiling. I didn&#39;t know this going in and spent a while wondering why tasks from two months ago were showing up alongside this week&#39;s List.</p><p class="paragraph" style="text-align:left;"><b>Completed reminders aren&#39;t automatically excluded.</b></p><p class="paragraph" style="text-align:left;">The Is Not Completed filter on the first query handles upcoming tasks — but it won&#39;t catch a task you just finished if the next occurrence is already set for this week. The second query (RecentlyDone) is what catches those. Without it, you mark the bathroom done on Thursday, and it&#39;s back in the text on Sunday.</p><p class="paragraph" style="text-align:left;"><b>Completion date filtering is the same trick in reverse.</b></p><p class="paragraph" style="text-align:left;">To find recently completed tasks, you calculate today - 7 days and filter for &quot;completion date is after [<b>DoneFloor</b>].&quot; Without that variable, Shortcuts returns everything ever completed in the List — every task you&#39;ve done since you set this up.</p><p class="paragraph" style="text-align:left;">The air filter got changed. So did the oven — eventually. The difference is now I know when I last did it, and I get a nudge when it&#39;s time again.</p><p class="paragraph" style="text-align:left;">This isn&#39;t a complicated build, but it&#39;s one of those automations that quietly earns its keep. It runs on Sunday, does its thing, and disappears. The only time you notice it is when something actually needs cleaning.</p><p class="paragraph" style="text-align:left;">If you set this up, start with five or six tasks and let it run for a month before adding more. The List gets more useful the more honestly you maintain it.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=8b8b03be-860f-45e3-9bdf-fa473afd9e06&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Automate Customer Service Emails with Claude Code</title>
  <description>Use Claude Code, Gmail, and Stripe to automatically draft customer service replies. Here&#39;s the exact prompt and setup Craig Campbell, founder of Pastmaps, uses to save hours every week.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/f17dc5ed-75ad-4771-99b4-d0747b113b39/How_to_Automate_Customer_Service_Emails_with_Claude_Code.png" length="1065628" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-automate-customer-service-emails-with-claude-code</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-automate-customer-service-emails-with-claude-code</guid>
  <pubDate>Thu, 09 Apr 2026 17:35:17 +0000</pubDate>
  <atom:published>2026-04-09T17:35:17Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Claude Cowork]]></category>
    <category><![CDATA[Marketing Ops]]></category>
    <category><![CDATA[Gmail]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">Customer service takes patience and a lot of planning. It can also cost you hours of your day looking up customer info, figuring out what a customer paid and when, or even just understanding what they&#39;re actually asking.</p><p class="paragraph" style="text-align:left;">For small business owners and solo founders, those hours are brutal. You&#39;re not running a support team — you&#39;re the product person, the marketer, and the customer service rep all at once.</p><h2 class="heading" style="text-align:left;" id="how-craig-set-it-up">How Craig Set It Up</h2><p class="paragraph" style="text-align:left;"><a class="link" href="https://www.threads.com/@that.map.guy.craig?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-customer-service-emails-with-claude-code" target="_blank" rel="noopener noreferrer nofollow">Craig Campbell</a> runs a site called <a class="link" href="https://pastmaps.com/?utm_source=automation-almanac&utm_medium=article&utm_campaign=april-09" target="_blank" rel="noopener noreferrer nofollow">Pastmaps</a>, where users can purchase historical maps or subscribe to access all the historical maps he has on file. Recently, I chatted with Craig because he said he was spending a few hours a week just handling customer service for refunds or Stripe issues.</p><p class="paragraph" style="text-align:left;">Before this, Craig was doing all of it manually — looking up the customer in Stripe, piecing together what they&#39;d paid and when, then writing the reply from scratch. For a small business where customer emails trickle in throughout the week, that overhead adds up fast.</p><p class="paragraph" style="text-align:left;">Craig let me know that he&#39;s been using Claude Cowork to handle a lot of the process. He has Claude check his email every hour. If there is a refund request or a Stripe-related issue, Claude uses the Stripe MCP with the user&#39;s email address to retrieve their details and surface any relevant data to help resolve the issue. Claude then drafts an email outlining tasks for Craig to complete if any human interaction is needed. He also gives Claude a few example emails showing the output format he wants.</p><p class="paragraph" style="text-align:left;">Now he opens Gmail and finds drafts already waiting, with Stripe data pulled and any required actions clearly listed at the top. What used to take a couple of hours a week now takes about 20 minutes for review and approval.</p><div class="section" style="background-color:transparent;border-color:#8B4993;border-radius:3px;border-style:solid;border-width:5px;margin:0.0px 0.0px 0.0px 0.0px;padding:15.0px 15.0px 15.0px 15.0px;"><div class="image"><a class="image__link" href="https://pastmaps.com/?utm_source=automation-almanac&utm_medium=article&utm_campaign=april-09" rel="noopener" target="_blank"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/623161b9-5bf9-4c39-be06-217dd8dd9fce/Screenshot_2026-04-09_at_12.30.13_PM.png?t=1775755836"/></a></div><p class="paragraph" style="text-align:left;">If you want to travel back in time and see what your city looked like before you were born and how much it’s changed since then, <a class="link" href="https://pastmaps.com/?utm_source=automation-almanac&utm_medium=article&utm_campaign=april-09" target="_blank" rel="noopener noreferrer nofollow">give Pastmaps a try.</a> </p></div><h2 class="heading" style="text-align:left;" id="what-youll-need">What You&#39;ll Need</h2><p class="paragraph" style="text-align:left;">To set it up yourself, you&#39;ll need to connect two MCP servers and schedule Claude to run on a cadence.</p><h3 class="heading" style="text-align:left;" id="gmail"><span style="color:#434343;">Gmail</span></h3><p class="paragraph" style="text-align:left;">In Claude Desktop, go to Settings → Integrations and enable the Gmail integration. It uses OAuth, so you&#39;ll connect your Google account and grant Claude permission to read and draft emails. No API keys needed — it&#39;s a few clicks.</p><h3 class="heading" style="text-align:left;" id="stripe"><span style="color:#434343;">Stripe</span></h3><p class="paragraph" style="text-align:left;">The Stripe MCP requires a Stripe API key. Go to your Stripe Dashboard → Developers → API Keys and create a restricted key. Since Claude should only be reading data (never issuing refunds or cancellations), limit the key to read permissions only. Once you have the key, add the Stripe MCP server in Claude Desktop under Settings → Integrations → Stripe MCP and paste it in.</p><h3 class="heading" style="text-align:left;" id="scheduling"><span style="color:#434343;">Scheduling</span></h3><p class="paragraph" style="text-align:left;">Craig has Claude check his inbox every hour. The easiest way to do this in Claude Cowork is to create a new scheduled task, which lets you set up a cron-style trigger. You write your prompt once, set the interval, and Claude Cowork runs it on a schedule without you having to do anything. You can also use a cron job on your machine to kick off a Claude Code session if you prefer more control.</p><h2 class="heading" style="text-align:left;" id="why-this-design-works">Why This Design Works</h2><p class="paragraph" style="text-align:left;">A few things are worth calling out about Craig&#39;s structure before you start writing your own prompt.</p><h3 class="heading" style="text-align:left;" id="claude-never-sends-or-writes-it-onl"><span style="color:#434343;">Claude never sends or writes — it only reads.</span></h3><p class="paragraph" style="text-align:left;">This is deliberate. The goal isn&#39;t to fully automate customer service; it&#39;s to automate the research and drafting so Craig can spend his time reviewing and approving rather than starting from scratch. Keeping Claude in a read-only role means nothing goes out without human eyes on it. That matters a lot when you&#39;re dealing with billing complaints and refund requests — the last thing you want is an AI sending a half-baked response to an already frustrated customer.</p><h3 class="heading" style="text-align:left;" id="the-todo-block-pattern-keeps-everyt"><span style="color:#434343;">The TODO block pattern keeps everything in one place.</span></h3><p class="paragraph" style="text-align:left;">Instead of flagging required actions in a separate doc or a Slack message to yourself, any Stripe tasks live right at the top of the draft email — in red, copy-pasteable, with specific IDs and amounts already filled in. Craig reads the TODO, opens a separate Claude session to handle the Stripe action, and then hits send. The draft becomes the single source of truth for both the reply and the work that needs to happen before it goes out.</p><h3 class="heading" style="text-align:left;" id="the-voice-guidelines-do-a-lot-of-he"><span style="color:#434343;">The voice guidelines do a lot of heavy lifting.</span></h3><p class="paragraph" style="text-align:left;">It&#39;s easy to underestimate how much prompting the tone requires. Craig&#39;s prompt includes specific language patterns, openers, sign-offs, and even examples of how he handles angry emails versus routine cancellations. Without that, you get something that sounds like a support ticket system wrote it. With it, the drafts sound like Craig.</p><p class="paragraph" style="text-align:left;">If you&#39;re adapting this for your own business, the structure carries over cleanly — swap in your business name, email addresses, and your voice. The Stripe steps and Gmail search logic stay the same regardless of what you&#39;re selling.</p><p class="paragraph" style="text-align:left;">Here is Craig’s prompt for Claude Cowork:</p><div class="codeblock"><pre><code>You are Craig, the founder of Pastmaps.com, drafting customer email replies via the Gmail connector and investigating accounts via the Stripe connector.

⚠️ NEVER send emails. Only create drafts. ⚠️ Stripe is read-only. NEVER perform writes (no refunds, no cancellations). Encode all needed actions in the TODO block.

Step 1 — Find unanswered customer emails

Using the Gmail connector, search for emails received in the past day: to:hello@pastmaps.com OR to:craig@pastmaps.com newer_than:1d. Then read each thread to verify Craig hasn&#39;t already replied and no draft exists. Be thorough — missing a customer email is a critical failure.

Skip spam, cold outreach, vendor solicitations, link-building pitches, and natural conversation-enders (e.g. &quot;Thank you!&quot; or &quot;Got it, thanks!&quot;) where no reply is expected.

Step 2 — Investigate via Stripe

When the email involves billing, subscriptions, charges, or refunds, look up the customer before drafting:

Find the customer by email via list_customers. If no match, try search_stripe_resources with a substring match (~) on name or domain — customers often email from a different address than their Stripe account.

Pull relevant data by topic:

Cancellation/billing: list_subscriptions → plan, status, start date, amount

Refund requests: list_invoices or list_payment_intents → specific charges, amounts, dates

Deep dive: fetch_stripe_resources on any specific object ID

Step 3 — Draft replies

For each unanswered email, read the full thread before drafting. Follow Craig&#39;s voice (below) closely. Create drafts using threadId (reply in thread), to (customer), cc (hello@pastmaps.com), and contentType: text/html.

TODO blocks: If the draft requires any Stripe action or human task before sending, add a red bold TODO at the top. The TODO must be a copy-pasteable instruction Craig can paste into a separate Claude chat to execute, with specific Stripe IDs, amounts, and customer IDs.

Format:

&lt;b style=&quot;color:red;&quot;&gt;TODO before sending:&lt;br&gt;
Cancel subscription sub_XXXXX for customer cus_YYYYY (Weekly $9.00, active since Mar 1, 2026). Then refund the most recent charge ch_ZZZZZ ($9.00, charged Mar 28, 2026) back to their card.
&lt;/b&gt;&lt;br&gt;&lt;br&gt;

If an email is too ambiguous to draft a full reply, still create a draft with just a red TODO explaining what Craig needs to investigate.

Step 4 — Report back

For each email handled, echo: sender, subject line, and status (✅ ready to send, or 🔴 has TODO). Craig will review full drafts in Gmail.

## Craig&#39;s Voice Guidelines

Warm, direct, genuine. Never defensive, never corporate, never salesy. Runs Pastmaps with his wife Savannah as a small family business.

Format: &quot;Hi [Name] -&quot; or &quot;Hi [Name],&quot;. Sign off &quot;--Craig&quot;, often with &quot;Hope you have a wonderful rest of your week!&quot; or similar.

Openers: &quot;happy to help&quot;, &quot;thanks for reaching out&quot;, or &quot;sorry to hear about...&quot; — often combined.

Action-first: Write as if actions are already completed (&quot;I&#39;ve gone ahead and canceled...&quot;) because Craig performs TODO actions before sending. Never hedge with &quot;I will&quot; or &quot;I can.&quot;

Honest about limitations: Say so plainly when Pastmaps can&#39;t help and suggest alternatives. When losing a customer, mention upcoming improvements without being pushy.

Cancellations: Confirm done, confirm no further charges, note they can restart from the website anytime.

Refunds: Default to offering generously. Frame courtesy refunds as &quot;one-time courtesy&quot; when relevant.

Emotional range: Match the customer&#39;s energy — brief for simple requests, empathetic for angry ones. Say sorry once, then move to action.

Language: Contractions naturally. No &quot;I hope this email finds you well&quot;, &quot;As per your request&quot;, or corporate filler.

### Reference Examples

Routine cancellation + refund:

Hi Alex - happy to help although we&#39;re sad to see you go! Definitely understand though.

I&#39;ve gone ahead and canceled your subscription, as well as refunded the last month ($9.99) back to your card. You will see no further charges from us unless you decide to restart your subscription from our website in the future.

Hope you have a wonderful weekend!

--Craig

Angry billing complaint:

Hi Jamie, happy to help with this and sorry about the confusion. As a company, we only offer subscription plans; we don&#39;t sell access on a per-map basis. It looks like you signed up for a $9/week subscription which explains the ongoing charges although I&#39;m obviously sad to hear that our product pages were not clear enough in your case. I&#39;m taking the feedback to heart and will be reviewing the full flow going forward to see if there&#39;s ways to add more clarity.

A few next steps to handle this:

I&#39;ve refunded the last 3 weeks of $9 charges that you did not expect back to your card as a one-time courtesy.

I&#39;ve also confirmed that your subscription is canceled (I see you did that yourself this morning). You will see no further charges from us unless you restart a subscription on our website in the future.

Hope you have a great week, and I appreciate your business!

--Craig
</code></pre></div></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=c6018659-cada-4016-b560-90ffe044a039&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Auto-Tag Beehiiv Subscribers by Referring Article</title>
  <description>Use a Firebase Function to automatically tag Beehiiv subscribers based on which article they came from. No forms, no manual work — just clean segmentation.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/b630071b-e260-4dd9-b85f-f577d589335b/How_to_Auto-Tag_Beehiiv_Subscribers_by_Referring_Article.png" length="1774282" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-auto-tag-beehiiv-subscribers-by-referring-article</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-auto-tag-beehiiv-subscribers-by-referring-article</guid>
  <pubDate>Thu, 09 Apr 2026 17:00:31 +0000</pubDate>
  <atom:published>2026-04-09T17:00:31Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Automation]]></category>
    <category><![CDATA[Marketing Ops]]></category>
    <category><![CDATA[Javascript]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">Automation is for everyone, from half-asleep parents to the overcaffeinated marketer. I’ve come to learn this through my own readers. The audiences on Automation Almanac are completely different — and automatically tagging Beehiiv subscribers based on where they came from is how I keep them sorted.</p><p class="paragraph" style="text-align:left;">One audience found me through a <a class="link" href="https://www.automation-almanac.com/p/google-sheets-meal-planner-with-automatic-grocery-list?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-auto-tag-beehiiv-subscribers-by-referring-article" target="_blank" rel="noopener noreferrer nofollow">meal-planning article</a> I wrote; they came from social media, a friend&#39;s recommendation, or simply because they want their lives to be a little less chaotic. The other audience found me through LinkedIn.</p><p class="paragraph" style="text-align:left;">Both groups are exactly the right audience for Automation Almanac. Still, someone who wants a better meal-planning process might not want an article on using <a class="link" href="https://www.automation-almanac.com/p/how-to-normalize-crm-job-titles-by-seniority-with-claude-and-google-sheets?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-auto-tag-beehiiv-subscribers-by-referring-article" target="_blank" rel="noopener noreferrer nofollow">Claude to categorize job titles</a>. The fix isn&#39;t creating another newsletter. It&#39;s using the content people come from to sort them into content they&#39;ll actually use.</p><p class="paragraph" style="text-align:left;">Adding more options to a signup form increases friction, which, in some cases, is actually fine. But we&#39;re clever here at Automation Almanac, and we like to automate things.</p><h2 class="heading" style="text-align:left;" id="how-beehiiv-signals-who-your-subscr">How Beehiiv Signals Who Your Subscriber is</h2><p class="paragraph" style="text-align:left;">When someone clicks a subscribe button on a Beehiiv article, Beehiiv records which article they came from <code>referring_site</code> in their webhook. The URL looks something like </p><div class="codeblock"><pre><code>https://www.automation-almanac.com/p/google-sheets-meal-planner-with-automatic-grocery-list</code></pre></div><p class="paragraph" style="text-align:left;">The slug after <code>/p/</code> is the article identifier. If you’ve tagged your articles in Beehiiv with <code>business</code> or <code>lifestyle</code>, you can look up those tags via the Beehiiv API using that slug.</p><p class="paragraph" style="text-align:left;">So the logic is:</p><ol start="1"><li><p class="paragraph" style="text-align:left;">Subscribers sign up via an article</p></li><li><p class="paragraph" style="text-align:left;">Webhook fires with the subscribers <code>referring_site</code></p></li><li><p class="paragraph" style="text-align:left;">Extract the slug from the URL</p></li><li><p class="paragraph" style="text-align:left;">Look up the article&#39;s content tags</p></li><li><p class="paragraph" style="text-align:left;">Write the matching track back to the subscriber</p></li></ol><p class="paragraph" style="text-align:left;">For people who subscribe from your main page (no article context), there is no referring URL. For those, I added a subscription-type dropdown to the signup form — a fallback custom field they can self-select. The function uses this when the article lookup comes up empty.</p><h2 class="heading" style="text-align:left;" id="setting-up-beehiiv-first">Setting Up Beehiiv First</h2><p class="paragraph" style="text-align:left;">Before the function does anything, Beehiiv needs to be configured—three steps, lots of clicking around.</p><h3 class="heading" style="text-align:left;" id="tag-your-articles"><span style="color:#434343;">Tag your articles</span></h3><p class="paragraph" style="text-align:left;">Open each of your Beehiiv posts and add a content tag you want to track. This is the data the function reads. For a backlog of a dozen articles, it may take 5–10 minutes.</p><h3 class="heading" style="text-align:left;" id="add-the-custom-fields"><span style="color:#434343;">Add The Custom Fields</span></h3><p class="paragraph" style="text-align:left;">In your Beehiiv dashboard, go to Subscribers → Custom Fields. Create a custom field for subscription type. You can also link it to a preference type.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/1bcab6f9-bdb9-4907-a2df-b9d48df71ceb/Screenshot_2026-04-09_at_8.25.28_AM.png?t=1775741164"/></div><h3 class="heading" style="text-align:left;" id="set-up-your-webhooks"><span style="color:#434343;">Set up your webhooks.</span></h3><p class="paragraph" style="text-align:left;">Go to Settings → Webhooks and create a new webhook that fires on <code>subscriber.created</code>. Paste your Firebase function URL once it&#39;s deployed. Beehiiv will start sending a POST request to that URL every time someone new subscribes.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/33cb3d55-633f-433a-87cd-e4b0bda47610/Screenshot_2026-04-09_at_8.25.46_AM.png?t=1775741177"/></div><p class="paragraph" style="text-align:left;">That’s it for the Beehiiv side. Now the Firebase function.</p><h2 class="heading" style="text-align:left;" id="the-code">The Code</h2><p class="paragraph" style="text-align:left;">The full project is on <a class="link" href="https://github.com/kostimarko/beehiiv-subscriber-tagger?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-auto-tag-beehiiv-subscribers-by-referring-article" target="_blank" rel="noopener noreferrer nofollow">GitHub</a>. Here’s how the pieces work. You can use auto-deploy and follow the tutorial on GitHub to get it set up. This will set up the project on Google Firebase and get all the code working for you. You may need to change your content tags to ones that fit your publication.</p><h3 class="heading" style="text-align:left;" id="verifying-the-webhook"><span style="color:#434343;">Verifying the Webhook</span></h3><p class="paragraph" style="text-align:left;">Beehiiv uses <a class="link" href="https://www.svix.com/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-auto-tag-beehiiv-subscribers-by-referring-article" target="_blank" rel="noopener noreferrer nofollow">Svix</a> to deliver webhooks, so the signing scheme is Svix. Each request comes with one of three headers: <code>svix-is</code>, <code>svix-timestamp</code>, <code>svix-signature</code>. The signed content is the concatenation of those three values, separated by dots. The secret is base64-encoded with a <code>whsec_</code> A prefix that you strip before you use it.</p><div class="codeblock"><pre><code>const crypto = require(&quot;crypto&quot;)

function verifySignature(rawBody, headers, secret) &#123;
  const svixId = headers[&quot;svix-id&quot;]
  const svixTimestamp = headers[&quot;svix-timestamp&quot;]
  const svixSignature = headers[&quot;svix-signature&quot;]

  if (!svixId || !svixTimestamp || !svixSignature || !secret) return false

  const signedContent = `$&#123;svixId&#125;.$&#123;svixTimestamp&#125;.$&#123;rawBody&#125;`
  const secretBytes = Buffer.from(secret.replace(/^whsec_/, &quot;&quot;), &quot;base64&quot;)
  const expected = crypto
    .createHmac(&quot;sha256&quot;, secretBytes)
    .update(signedContent)
    .digest(&quot;base64&quot;)

  // svix-signature may contain multiple space-separated signatures: &quot;v1,&lt;sig1&gt; v1,&lt;sig2&gt;&quot;
  const signatures = svixSignature.split(&quot; &quot;)
  return signatures.some(sig =&gt; &#123;
    const [, sigValue] = sig.split(&quot;,&quot;)
    if (!sigValue) return false
    try &#123;
      return crypto.timingSafeEqual(
        Buffer.from(expected),
        Buffer.from(sigValue),
      )
    &#125; catch &#123;
      return false
    &#125;
  &#125;)
&#125;</code></pre></div><p class="paragraph" style="text-align:left;">The <code>svix-signature</code> header can carry multiple signatures, so the code checks if any of them match. If none do, the function returns a 401 error and stops. You don&#39;t want an arbitrary POST request writing tags to your subscribers</p><h3 class="heading" style="text-align:left;" id="detect-the-track"><span style="color:#434343;">Detect the track</span></h3><p class="paragraph" style="text-align:left;">This is the core logic: check the referring URL first. If it’s an article, look up the post’s tags. If not, check the custom field.</p><div class="codeblock"><pre><code>async function detectTrack(payload, getPostTagsFn) &#123;
  const &#123; referring_site, custom_fields &#125; = payload

  // Path 1: subscriber came from an article
  if (referring_site &amp;&amp; referring_site.includes(&quot;/p/&quot;)) &#123;
    const slug = extractSlug(referring_site) // pulls the slug from /p/&lt;slug&gt;
    if (slug) &#123;
      const contentTags = await getPostTagsFn(slug)
      const track = tagsToTrack(contentTags) // maps [&quot;work&quot;] → &quot;work&quot;, etc.
      if (track) return track
    &#125;
  &#125;

  // Path 2: fallback to custom field
  const trackPref = getCustomFieldValue(custom_fields, &quot;subscription_type&quot;)
  if (trackPref) &#123;
    const normalized = trackPref.toLowerCase()
    if ([&quot;business&quot;, &quot;lifestyle&quot;].includes(normalized)) return normalized
  &#125;

  return null // no track detected
&#125;</code></pre></div><h3 class="heading" style="text-align:left;" id="applying-the-track"><span style="color:#434343;">Applying the Track</span></h3><p class="paragraph" style="text-align:left;">Once the track is detected, write it back to the subscriber via the Beehiiv API:</p><div class="codeblock"><pre><code>async function applyTrack(subscriptionId, track, apiKey, pubId) &#123;
  const url = `https://api.beehiiv.com/v2/publications/$&#123;pubId&#125;/subscriptions/$&#123;subscriptionId&#125;`
  const options = &#123;
    method: &quot;PUT&quot;,
    headers: &#123;
      Authorization: `Bearer $&#123;apiKey&#125;`,
      &quot;Content-Type&quot;: &quot;application/json&quot;,
    &#125;,
    body: JSON.stringify(&#123;
      custom_fields: [&#123; name: &quot;track&quot;, value: track &#125;],
    &#125;),
  &#125;

  try &#123;
    const response = await fetch(url, options)
    if (!response.ok) throw new Error(`Beehiiv API error $&#123;response.status&#125;`)
    return response.json()
  &#125; catch (err) &#123;
    // retry once — Beehiiv&#39;s API occasionally hiccups
    const response = await fetch(url, options)
    if (!response.ok) throw new Error(`Beehiiv API error $&#123;response.status&#125;`)
    return response.json()
  &#125;
&#125;</code></pre></div><p class="paragraph" style="text-align:left;">There is a single retry because Beehiiv’s API might return a 5xx error on the first attempt and succeed immediately on the second—just a cheap fail-safe.</p><p class="paragraph" style="text-align:left;"></p><h3 class="heading" style="text-align:left;" id="wiring-it-together"><span style="color:#434343;">Wiring It Together</span></h3><p class="paragraph" style="text-align:left;">The main function handler ties everything together. It verifies the signature, detects the track, and applies it.</p><div class="codeblock"><pre><code>exports.tagSubscriber = onRequest(async (req, res) =&gt; &#123;
  // verify
  if (
    !verifySignature(
      req.rawBody,
      req.headers[&quot;x-beehiiv-signature&quot;],
      BEEHIIV_WEBHOOK_SECRET,
    )
  ) &#123;
    return res.status(401).send(&quot;Unauthorized&quot;)
  &#125;

  const subscription = req.body.data || req.body
  const &#123; id: subscriptionId, referring_site, custom_fields &#125; = subscription

  // detect
  const track = await detectTrack(
    &#123; referring_site, custom_fields: custom_fields || [] &#125;,
    slug =&gt; getPostTags(slug, BEEHIIV_API_KEY, BEEHIIV_PUBLICATION_ID),
  )

  if (!track) &#123;
    return res
      .status(200)
      .json(&#123; subscriber_id: subscriptionId, tagged: false &#125;)
  &#125;

  // apply
  await applyTrack(
    subscriptionId,
    track,
    BEEHIIV_API_KEY,
    BEEHIIV_PUBLICATION_ID,
  )
  return res.status(200).json(&#123; subscriber_id: subscriptionId, track &#125;)
&#125;)</code></pre></div><h2 class="heading" style="text-align:left;" id="gotchas">Gotchas</h2><h3 class="heading" style="text-align:left;" id="use-reqraw-body-for-the-hmac-not-re"><span style="color:#434343;">Use </span><code>req.rawBody</code><span style="color:#434343;"> for the HMAC, not </span><code>req.body.</code></h3><p class="paragraph" style="text-align:left;">Firebase parses the request body before your function sees it. If you compute the HMAC from <code>JSON.stringify(req.body)</code>, it won&#39;t match Beehiiv&#39;s signature — whitespace and key ordering will differ from the original bytes. Firebase v2 gives you <code>req.rawBody</code> for exactly this reason. The code warns if it&#39;s unavailable and falls back, but if you&#39;re seeing 401s on valid webhooks, this is the first thing to check.</p><h3 class="heading" style="text-align:left;" id="you-wont-know-the-exact-payload-sha"><span style="color:#434343;">You won&#39;t know the exact payload shape until the first live delivery</span></h3><p class="paragraph" style="text-align:left;">Beehiiv&#39;s documentation shows a single payload structure, but the actual webhook may nest the subscription under <code>event.data</code> or send it at the top level, depending on the event type. The code handles both <code>req.body.data || req.body</code>, but there&#39;s a comment <code>index.js</code> reminding you to log the first live delivery and confirm the shape before removing the safety net.</p><h3 class="heading" style="text-align:left;" id="the-slug-lookup-can-silently-return"><span style="color:#434343;">The slug lookup can silently return nothing.</span></h3><p class="paragraph" style="text-align:left;">If the post isn&#39;t found — whether it&#39;s a draft, deleted, or has the wrong slug format — the function doesn&#39;t throw. It falls through to the custom field check instead. This is intentional: you don&#39;t want a bad slug breaking the entire signup flow. But it does mean some subscribers might come through untagged if articles aren&#39;t tagged yet in Beehiiv. Tag your articles before you point the webhook at the function.</p><h2 class="heading" style="text-align:left;" id="whats-next">What&#39;s Next</h2><p class="paragraph" style="text-align:left;">Every subscriber now gets tagged automatically. As long as I add the correct content tag to articles, we’ll be able to track which audience segments we&#39;re reaching, target each segment with a different welcome flow, and see whether engagement changes between segments. </p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=8208ccc5-57e6-404f-a324-51f67a17ab40&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>Apple Shortcuts: Auto Workout Briefing When You Hit the Gym</title>
  <description>An Apple Shortcuts location automation that fires when you walk into the gym — delivers your next muscle group and last session maxes automatically.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/49c5eb8b-8dbc-40a8-8d18-1ea51568699e/Apple_Shortcuts_Auto_Workout_Briefing_When_You_Hit_the_Gym.png" length="1544546" type="image/png"/>
  <link>https://www.automation-almanac.com/p/apple-shortcuts-auto-workout-briefing-when-you-hit-the-gym</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/apple-shortcuts-auto-workout-briefing-when-you-hit-the-gym</guid>
  <pubDate>Wed, 08 Apr 2026 21:02:52 +0000</pubDate>
  <atom:published>2026-04-08T21:02:52Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Apple Shortcuts]]></category>
    <category><![CDATA[Google Sheets]]></category>
    <category><![CDATA[Lifestyle]]></category>
    <category><![CDATA[Google Apps Script]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">The workout logger from the previous article captures exercise, weight, reps, and date in a <a class="link" href="https://www.automation-almanac.com/p/how-to-log-workouts-to-google-sheets-using-apple-shortcuts-and-apps-script?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=apple-shortcuts-auto-workout-briefing-when-you-hit-the-gym" target="_blank" rel="noopener noreferrer nofollow">Google Sheet</a>. Great data. Useless when you&#39;re standing at the squat rack trying to remember your last session.</p><p class="paragraph" style="text-align:left;">Every time I went to the gym, I&#39;d stand there looking up when I last did legs and how much I squatted—like an idiot in front of the squat rack, trying to figure out what to work on. We&#39;re trying to grow big, strong, independent humans in my household — we actually need to push ourselves, not just guess at it.</p><p class="paragraph" style="text-align:left;">The data was there. I just needed it to come to me.</p><p class="paragraph" style="text-align:left;">This article shows you how to build an Apple Shortcuts automation on your iPhone that fires when you walk into the gym — it checks your history and delivers a personalized workout briefing before your first set.</p><h2 class="heading" style="text-align:left;" id="what-youll-build">What you&#39;ll build</h2><p class="paragraph" style="text-align:left;">An Apple Shortcuts location automation that triggers when your iPhone detects you&#39;ve arrived at the gym. It calls a Google Apps Script endpoint, reads your workout history, determines which muscle group is next in your rotation, and sends you a notification showing your last session&#39;s max weights for each exercise.</p><h2 class="heading" style="text-align:left;" id="what-youll-need">What you&#39;ll need</h2><ul><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://www.automation-almanac.com/p/how-to-log-workouts-to-google-sheets-using-apple-shortcuts-and-apps-script?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=apple-shortcuts-auto-workout-briefing-when-you-hit-the-gym" target="_blank" rel="noopener noreferrer nofollow">The existing workout logger setup</a></p></li><li><p class="paragraph" style="text-align:left;">Apple Shortcuts (iOS 16+)</p></li></ul><h2 class="heading" style="text-align:left;" id="how-the-rotation-logic-works">How the rotation logic works</h2><p class="paragraph" style="text-align:left;">Some workout plans use a day-of-week rotation: Monday is Push, Tuesday is pull, Wednesday is legs. But I skip days, you skip days, and now your plan is behind, ahead, or lost. </p><p class="paragraph" style="text-align:left;">Instead, our script uses whatever you last logged. The Apps Script endpoint looks at your most recent session, reads the muscle groups you&#39;ve trained, and moves to the next one in the rotation. If you did pull last time, you&#39;re doing Push this time. You can&#39;t get out of sync because it always picks up where you left off.</p><p class="paragraph" style="text-align:left;">This requires one small addition to the existing sheet. We&#39;ll need to add a day column to the workout log, and it needs to be populated with the muscle group when you log a set.</p><ul><li><p class="paragraph" style="text-align:left;">Google Sheets Template: <a class="link" href="https://docs.google.com/spreadsheets/d/1cJViazT5MEh55wX6B7Sg4o-7zYe-3mtkUtW9W7zdp_c/copy?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=apple-shortcuts-auto-workout-briefing-when-you-hit-the-gym" target="_blank" rel="noopener noreferrer nofollow">https://docs.google.com/spreadsheets/d/1cJViazT5MEh55wX6B7Sg4o-7zYe-3mtkUtW9W7zdp_c/copy</a></p></li><li><p class="paragraph" style="text-align:left;">Logger Shortcut: <a class="link" href="https://www.icloud.com/shortcuts/1b0c9c0b7da54d378b6e853c08f6f72d?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=apple-shortcuts-auto-workout-briefing-when-you-hit-the-gym" target="_blank" rel="noopener noreferrer nofollow">https://www.icloud.com/shortcuts/1b0c9c0b7da54d378b6e853c08f6f72d</a></p></li><li><p class="paragraph" style="text-align:left;">Gym Briefing Shortcut: <a class="link" href="https://www.icloud.com/shortcuts/71a91c1e5aee456ca848d1cf7dd8ce7b?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=apple-shortcuts-auto-workout-briefing-when-you-hit-the-gym" target="_blank" rel="noopener noreferrer nofollow">https://www.icloud.com/shortcuts/71a91c1e5aee456ca848d1cf7dd8ce7b</a></p></li></ul><h3 class="heading" style="text-align:left;" id="step-1-copy-the-template"><span style="color:#434343;">Step 1: Copy the template</span></h3><p class="paragraph" style="text-align:left;">Copy the template for yourself.</p><p class="paragraph" style="text-align:left;">The <code>Workout Log</code> tab has a Muscle Group column that you&#39;ll need. </p><h3 class="heading" style="text-align:left;" id="step-2-update-your-logging-shortcut"><span style="color:#434343;">Step 2: Update Your Logging Shortcut</span></h3><p class="paragraph" style="text-align:left;">Open the workout logger Shortcut you built from this article. At the very beginning, add a choose from Menu action with your muscle groups: Legs, Pull, Push, Full Body, Core, or whatever you&#39;re using.</p><p class="paragraph" style="text-align:left;">Set the result to a variable called <code>muscleGroup</code>. Then find the &quot;Get Contents of URL&quot; action where you log a set and add <code>muscleGroup</code> as a parameter in the request body.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/b5cafc25-c94f-472d-877d-c017b87ccfce/Screenshot_2026-04-08_at_2.58.12_PM.png?t=1775681518"/></div><p class="paragraph" style="text-align:left;">Updated Shortcut: <a class="link" href="https://www.icloud.com/shortcuts/1b0c9c0b7da54d378b6e853c08f6f72d?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=apple-shortcuts-auto-workout-briefing-when-you-hit-the-gym" target="_blank" rel="noopener noreferrer nofollow">https://www.icloud.com/shortcuts/1b0c9c0b7da54d378b6e853c08f6f72d</a></p><h3 class="heading" style="text-align:left;" id="step-3-update-your-config"><span style="color:#434343;">Step 3: Update your config</span></h3><p class="paragraph" style="text-align:left;">In the template sheet, go to Extensions → Apps Script. At the top of the script, find the config section and fill in your details.</p><div class="codeblock"><pre><code>const PERSON_1_NAME = &quot;Your Name&quot;
const PERSON_1_PHONE = &quot;+1234567890&quot;
const PERSON_2_NAME = &quot;Partner Name&quot;   // leave blank if solo
const PERSON_2_PHONE = &quot;+0987654321&quot;   // leave blank if solo
const MUSCLE_GROUP_ROTATION = [&quot;Push&quot;, &quot;Pull&quot;, &quot;Legs&quot;,&quot;Full Body&quot;,&quot;Core&quot;]</code></pre></div><p class="paragraph" style="text-align:left;">Update <code>MUSCLE_GROUP_ROTATION</code> to match your program. Just make sure the names match exactly what you pick in your logging Shortcut. The script handles the rest. </p><h3 class="heading" style="text-align:left;" id="step-4-deploy-the-web-app"><span style="color:#434343;">Step 4: Deploy the Web App</span></h3><p class="paragraph" style="text-align:left;">Still in Apps Script, go to Deploy → Manage Deployments.</p><p class="paragraph" style="text-align:left;">If this is your first deployment: click New Deployment, set &quot;Execute as&quot; to yourself and &quot;Who has access&quot; to Anyone, then click Deploy.</p><p class="paragraph" style="text-align:left;">If you already deployed the logger from the previous article, click the pencil icon next to your existing deployment, bump the version to &quot;New version,&quot; and click Deploy.</p><p class="paragraph" style="text-align:left;">Either way, copy the deployment URL when it appears — you&#39;ll paste it into the Shortcut in the next step.</p><h3 class="heading" style="text-align:left;" id="step-5-build-the-location-automatio"><span style="color:#434343;">Step 5: Build the Location Automation in Shortcuts</span></h3><p class="paragraph" style="text-align:left;">This is a different kind of Shortcut than the logger. The logger is something you tap manually. This one runs by itself when you walk through the door.</p><p class="paragraph" style="text-align:left;">Open Shortcuts → Automation tab → tap the + in the top right → Personal Automation → Location.</p><p class="paragraph" style="text-align:left;">Set your gym as the location. A 100–150 meter radius works well. Set the trigger to &quot;Arrives.&quot; Turn off &quot;Ask Before Running&quot;—it is buried in the automation settings, and if you leave it on, you&#39;ll get a confirmation prompt every time, which defeats the whole point.</p><p class="paragraph" style="text-align:left;">Now build the Shortcut actions:</p><h4 class="heading" style="text-align:left;" id="get-the-briefing-from-apps-script"><span style="color:#666666;">Get the briefing from Apps Script.</span></h4><p class="paragraph" style="text-align:left;">Add a &quot;Get Contents of URL&quot; action. Set the method to GET. The URL is your deployment URL with your phone number appended:</p><div class="codeblock"><pre><code>https://script.google.com/macros/s/YOUR_DEPLOYMENT_ID/exec?phone=+1234567890</code></pre></div><p class="paragraph" style="text-align:left;">Replace <code>YOUR_DEPLOYMENT_ID</code> with your actual deployment URL, and hardcode your phone number — same number you put in the config.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/b5ca946e-cb74-493d-914d-05f92d19d132/Screenshot_2026-04-08_at_3.52.42_PM.png?t=1775681571"/></div><h4 class="heading" style="text-align:left;" id="parse-the-response"><span style="color:#666666;">Parse the response</span></h4><p class="paragraph" style="text-align:left;">Add a &quot;Get Dictionary from Input&quot; action, using the output from the URL fetch.</p><h4 class="heading" style="text-align:left;" id="build-the-message-text"><span style="color:#666666;">Build the message text.</span></h4><p class="paragraph" style="text-align:left;">Then add a &quot;Repeat with Each&quot; action over <code>Dictionary Value for exercises</code>. Inside the loop, add another &quot;Text&quot; action:</p><p class="paragraph" style="text-align:left;">Collect each line using an &quot;Add to Variable&quot; action — create a variable called <code>briefingLines</code>.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/d6e8103b-dd65-4ab6-bfaa-585e4e96b992/Screenshot_2026-04-08_at_3.51.40_PM.png?t=1775681589"/></div><h4 class="heading" style="text-align:left;" id="deliver-the-briefing"><span style="color:#666666;">Deliver the briefing</span></h4><p class="paragraph" style="text-align:left;">After the loop, add a &quot;Show Notification&quot; action. Set the title to &quot;Gym Briefing&quot; and the body to the <code>briefingLines</code> variable joined with newlines.</p><p class="paragraph" style="text-align:left;">If you&#39;d rather get an iMessage (it persists in your thread, easier to glance at mid-set), use &quot;Send Message&quot; instead — know that iOS 16+ will prompt for confirmation the first time, and in some versions you can&#39;t suppress that prompt entirely. Notifications are quieter and require no permission dance.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/89e3a9c5-fbf9-41fe-a5cd-01a032f7b884/Screenshot_2026-04-08_at_3.51.43_PM.png?t=1775681602"/></div><p class="paragraph" style="text-align:left;">The final briefing looks like this:</p><div class="codeblock"><pre><code>Gym Briefing

- Deadlift: 245x5 (Mar 28)

- Barbell Row: 155x8 (Mar 25)

- Bicep Curl: 55x10 (Mar 28)</code></pre></div><h2 class="heading" style="text-align:left;" id="gotchas">Gotchas</h2><h3 class="heading" style="text-align:left;" id="ask-before-running-will-be-turned-b"><span style="color:#434343;">&quot;Ask Before Running&quot; will be turned back on after an iOS update. </span></h3><p class="paragraph" style="text-align:left;">Apple occasionally resets automation permissions silently after a major update. If the automation stops firing automatically one day, check that setting first before debugging anything else.</p><h3 class="heading" style="text-align:left;" id="first-run-with-no-history"><span style="color:#434343;">First run with no history. </span></h3><p class="paragraph" style="text-align:left;">The first time you use the briefing, no muscle groups are logged in the sheet yet. The notification will say &quot;Gym Briefing&quot; with no exercise history below it. That&#39;s correct — you haven&#39;t logged Push yet. Log your session, and next time it&#39;ll have data.</p><h3 class="heading" style="text-align:left;" id="exercises-that-span-multiple-muscle"><span style="color:#434343;">Exercises that span multiple muscle groups.</span></h3><p class="paragraph" style="text-align:left;">If you log Deadlifts under both Pull and Legs, the briefing for each day will show the last Deadlift you logged under that specific muscle group. They don&#39;t cross-contaminate. This is usually the right behavior, but it&#39;s worth knowing.</p><h3 class="heading" style="text-align:left;" id="geofence-lag"><span style="color:#434343;">Geofence lag. </span></h3><p class="paragraph" style="text-align:left;">The location trigger relies on your phone getting a clean GPS fix. In a basement gym or a building with a lot of RF interference, the trigger can fire a minute or two after you arrive — or occasionally miss entirely. If reliability matters more than automation magic, you can always add the Shortcut to your Home Screen as a one-tap backup.</p><h3 class="heading" style="text-align:left;" id="the-rotation-only-knows-what-you-te"><span style="color:#434343;">The rotation only knows what you tell it. </span></h3><p class="paragraph" style="text-align:left;">If you do a random arms day and don&#39;t log it with a muscle group, the rotation doesn&#39;t know it happened. It picks up from the last thing you properly logged. This is a feature, not a bug — the rotation tracks what you actually did with intention, not everything you touched.</p><h3 class="heading" style="text-align:left;" id="redeploy-after-every-config-change"><span style="color:#434343;">Redeploy after every config change. </span></h3><p class="paragraph" style="text-align:left;">If you edit the config and don&#39;t redeploy with a new version, the changes won&#39;t take effect. Every time you change the script, bump the version.</p><h2 class="heading" style="text-align:left;" id="what-this-changes">What This Changes</h2><p class="paragraph" style="text-align:left;">The actual workout doesn&#39;t change. The data you&#39;re logging doesn&#39;t change. What changes is that you stop doing the dumb thing I was doing — standing in a rack, squinting at a spreadsheet, reconstructing your training history from memory.</p><p class="paragraph" style="text-align:left;">You walk in. Your phone already knows what you did last time and what&#39;s next. You check the notification, load the bar, and get to work.</p><p class="paragraph" style="text-align:left;">The next step in the series is having Claude analyze your training history — looking for plateaus, spotting when you&#39;ve been stuck at the same weight for too long, and suggesting when to push and when to deload. The data&#39;s all in the sheet already. </p><p class="paragraph" style="text-align:left;"></p><p class="paragraph" style="text-align:left;"></p><p class="paragraph" style="text-align:left;"></p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=3196b49d-3a7b-4ce2-96d7-a61eb38c7197&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>Multiple Recipe Categories in Google Sheets Meal Planner</title>
  <description>Build a Google Sheets meal planner that organizes recipes across multiple category tabs — Mains, Soups, Baking — while still scoring recipes by what you have, generating a grocery list, and syncing to your phone.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/ab84d864-101f-4dd9-8c87-178cd3e5a0e6/How_to_Add_Multiple_Recipe_Categories_to_Your_Google_Sheets_Meal_Planner.png" length="1129330" type="image/png"/>
  <link>https://www.automation-almanac.com/p/multiple-recipe-categories-in-google-sheets-meal-planner</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/multiple-recipe-categories-in-google-sheets-meal-planner</guid>
  <pubDate>Tue, 07 Apr 2026 18:13:46 +0000</pubDate>
  <atom:published>2026-04-07T18:13:46Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Apple Shortcuts]]></category>
    <category><![CDATA[Google Sheets]]></category>
    <category><![CDATA[Lifestyle]]></category>
    <category><![CDATA[Google Apps Script]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">A while back, I built a meal planner in Google Sheets. It scores recipes by how many ingredients you already have, generates a grocery list, and pushes it to Google Tasks or Apple Reminders. I wrote about the full build in &quot;<a class="link" href="https://www.automation-almanac.com/p/google-sheets-meal-planner-with-automatic-grocery-list?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=multiple-recipe-categories-in-google-sheets-meal-planner" target="_blank" rel="noopener noreferrer nofollow">How to Build a Meal Planner and Grocery List Automation with Google Sheets.</a>&quot; If you want the whole system, start there.</p><p class="paragraph" style="text-align:left;">This article is about one problem a subscriber reached out with. &quot;Is there an easy way to add sheets and change the script to the sheets added? For example, if I wanted Mains on one sheet and Soups on another sheet?&quot; I love this idea. I don&#39;t eat multiple courses during dinner, but I can see where this would be really useful for hosting holidays or events.</p><p class="paragraph" style="text-align:left;">A small change fixes that. After the update, the meal planner can pull from any number of tabs: Mains, Soups, Baking, Weeknight, Date Night, etc. You won&#39;t need to reconfigure anything else.</p><h2 class="heading" style="text-align:left;" id="how-the-meal-planner-works">How the Meal Planner Works</h2><p class="paragraph" style="text-align:left;">Quick background, the planner lives in a Google Sheet with two types of tabs:</p><h3 class="heading" style="text-align:left;" id="recipe-tabs"><span style="color:#434343;">Recipe Tabs</span></h3><p class="paragraph" style="text-align:left;">Each row is a recipe with four columns: <code>Name</code>, <code>Ingredients</code>, <code>Steps</code>, and <code>This Week</code>. The <code>This Week</code> The column is a checkbox on what you’re cooking this Week. </p><h3 class="heading" style="text-align:left;" id="pantry-tabs"><span style="color:#434343;">Pantry Tabs</span></h3><p class="paragraph" style="text-align:left;">One tab that tracks what you have on hand, with <code>Item</code>, <code>In Stock</code>, and <code>Quantity</code> columns.</p><p class="paragraph" style="text-align:left;">A Google Apps Script reads both tabs and scores each recipe by how many ingredients are missing from the pantry. The recipes get ranked by the number of missing ingredients and then surfaced through Google Tasks or Apple Shortcuts. </p><p class="paragraph" style="text-align:left;">The full setup — including the sidebar UI, Apple Shortcuts, and web app deployment — is covered in <a class="link" href="https://www.automation-almanac.com/p/google-sheets-meal-planner-with-automatic-grocery-list?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=multiple-recipe-categories-in-google-sheets-meal-planner" target="_blank" rel="noopener noreferrer nofollow">the original article</a>.</p><h2 class="heading" style="text-align:left;" id="the-problem-one-hardcoded-tab-name">The Problem: One Hardcoded Tab Name</h2><p class="paragraph" style="text-align:left;">The function that reads recipes is called <code>getAllRecipes()</code>. In the original version, it looks like this:</p><div class="codeblock"><pre><code>function getAllRecipes(ss) &#123;
  var sheet = ss.getSheetByName(&quot;Recipes&quot;)
  var data = sheet.getDataRange().getValues()
  var recipes = []
  for (var i = 1; i &lt; data.length; i++) &#123;
    if (!data[i][0]) continue
    recipes.push(&#123;
      name: String(data[i][0]).trim(),
      ingredients: String(data[i][1] || &quot;&quot;).trim(),
      steps: String(data[i][2] || &quot;&quot;).trim(),
      thisWeek: data[i][3] === true,
    &#125;)
  &#125;
  return recipes
&#125;</code></pre></div><p class="paragraph" style="text-align:left;"><code>getSheetByName(&quot;Recipes&quot;)</code> — that&#39;s the constraint. Rename the tab or add a second one, and the script either fails silently or ignores it entirely.</p><h2 class="heading" style="text-align:left;" id="the-fix-loop-all-the-sheets-skip-pa">The Fix: Loop All The Sheets, Skip Pantry</h2><p class="paragraph" style="text-align:left;">Instead of asking for a specific sheet by name, the updated version asks for all sheets, then skips any sheet named <code>Pantry</code> and any sheet with no data:</p><div class="codeblock"><pre><code>function getAllRecipes(ss) &#123;
  var sheets = ss.getSheets()
  var recipes = []

  for (var s = 0; s &lt; sheets.length; s++) &#123;
    var sheet = sheets[s]
    var name = sheet.getName()

    // Skip the Pantry tab — it&#39;s not a recipe sheet
    if (name === &quot;Pantry&quot;) continue

    var data = sheet.getDataRange().getValues()

    // Skip sheets with no data rows (only a header, or completely empty)
    if (data.length &lt;= 1) continue

    for (var i = 1; i &lt; data.length; i++) &#123;
      if (!data[i][0]) continue
      recipes.push(&#123;
        name: String(data[i][0]).trim(),
        ingredients: String(data[i][1] || &quot;&quot;).trim(),
        steps: String(data[i][2] || &quot;&quot;).trim(),
        thisWeek: data[i][3] === true,
      &#125;)
    &#125;
  &#125;

  return recipes
&#125;</code></pre></div><p class="paragraph" style="text-align:left;">The function returns the same shape as before — an array of recipe objects. Everything else in the script (scoring, grocery list generation, Cook Tonight, pantry deduction, and the Apple Shortcuts web app) continues to work without any changes.</p><h2 class="heading" style="text-align:left;" id="setting-up-the-sheet">Setting up the sheet</h2><p class="paragraph" style="text-align:left;">If you’re starting fresh, here’s what to build:</p><h3 class="heading" style="text-align:left;" id="recipe-tabs"><span style="color:#434343;">Recipe Tabs</span></h3><p class="paragraph" style="text-align:left;">Create one tab per category. Name them whatever you want: Mains, Soups, Baking, Quick Dinners. Each tab needs the same four columns in the same order.</p><ul><li><p class="paragraph" style="text-align:left;"><b>Ingredients</b>: comma-separated list with quantities</p></li><li><p class="paragraph" style="text-align:left;"><b>Steps</b>: each step on its own line</p></li><li><p class="paragraph" style="text-align:left;"><b>This Week</b>: always a checkbox (Insert -&gt; Checkbox). The script looks for <code>true/false</code> this column.</p></li></ul><h3 class="heading" style="text-align:left;" id="pantry-tab"><span style="color:#434343;">Pantry Tab</span></h3><p class="paragraph" style="text-align:left;">One tab named exactly <code>Pantry</code> with three columns. <code>Item</code>, <code>In Stock</code>(Checkbox), <code>Quantity</code>. The script uses this to score recipes and dedupe ingredients after cooking.</p><h2 class="heading" style="text-align:left;" id="how-to-add-it-to-an-existing-sheet">How to Add it to an Existing Sheet</h2><p class="paragraph" style="text-align:left;">If you already have the original grocery automation running, the update is a two-minute swap:</p><ol start="1"><li><p class="paragraph" style="text-align:left;">Open your Google Sheet → <b>Extensions → Apps Script</b></p></li><li><p class="paragraph" style="text-align:left;">Find the existing <code>getAllRecipes</code> function</p></li><li><p class="paragraph" style="text-align:left;">Select it entirely (from <code>function getAllRecipes(ss) &#123;</code> to its closing <code>&#125;</code>)</p></li><li><p class="paragraph" style="text-align:left;">Paste in the new version above.</p></li><li><p class="paragraph" style="text-align:left;">Save (Cmd+S / Ctrl+S)</p></li><li><p class="paragraph" style="text-align:left;"><b>Deploy → Manage Deployments</b> → edit your existing deployment → set version to <b>New version</b> → Deploy</p></li></ol><p class="paragraph" style="text-align:left;">Then, rename your existing <code>Recipes</code> tab to whatever category fits (Mains, Dinners, etc.) and add new tabs as needed. The script picks them all up on the next run. Apple Shortcuts don&#39;t need any changes.</p><h2 class="heading" style="text-align:left;" id="gotchas">Gotchas</h2><h3 class="heading" style="text-align:left;" id="pantry-is-a-reserved-name"><span style="color:#434343;">Pantry is a reserved name</span></h3><p class="paragraph" style="text-align:left;">The script skips any sheet named <code>Pantry</code>. Don&#39;t name a recipe tab Pantry — it will be silently ignored.</p><h3 class="heading" style="text-align:left;" id="column-structure-must-match-across-"><span style="color:#434343;">Column structure must match across all tabs.</span></h3><p class="paragraph" style="text-align:left;">Each recipe tab needs the same four columns in the same order. If a tab has a different structure, the script reads the wrong columns without throwing an error — recipe names will look garbled, and ingredients won&#39;t parse correctly.</p><h3 class="heading" style="text-align:left;" id="column-d-needs-checkboxes-on-every-"><span style="color:#434343;">Column D needs checkboxes on every tab</span></h3><p class="paragraph" style="text-align:left;">The <code>thisWeek</code> flag reads <code>true</code> only from a checked checkbox cell. If you add a new tab and forget the checkboxes, those recipes will never appear in the This Week list.</p><h3 class="heading" style="text-align:left;" id="blank-or-notes-tabs-are-fine"><span style="color:#434343;">Blank or notes tabs are fine.</span></h3><p class="paragraph" style="text-align:left;">Any tab with no data in rows 2 and beyond is skipped. So scratch tabs and notes tabs are safe — as long as column A is empty.</p><h3 class="heading" style="text-align:left;" id="tabs-with-data-in-column-a-get-read"><span style="color:#434343;">Tabs with data in column A get read as recipe sheets</span></h3><p class="paragraph" style="text-align:left;">If you have any other tab with text in column A (e.g., a budget tracker or a shopping history), the script will try to read it as recipes. Either rename it or keep column A clear.</p><h2 class="heading" style="text-align:left;" id="want-the-template">Want the Template?</h2><p class="paragraph" style="text-align:left;">I put together a Google Sheets template with two recipe tabs (Mains and Soups) pre-populated with sample recipes, the Pantry tab, and the updated script already attached.</p><p class="paragraph" style="text-align:left;">Template: <a class="link" href="https://docs.google.com/spreadsheets/d/1FcbBrDeEVRIBN7ZNrPYuGWox8QrpxLgWdkT89l2xK_A/copy?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=multiple-recipe-categories-in-google-sheets-meal-planner" target="_blank" rel="noopener noreferrer nofollow">https://docs.google.com/spreadsheets/d/1FcbBrDeEVRIBN7ZNrPYuGWox8QrpxLgWdkT89l2xK_A/copy</a></p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=418df658-92b5-472b-9b17-5d16dac1913b&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>Automate Your Newsroom Inbox Triage with Claude Desktop</title>
  <description>Automatically classify your newsroom inbox every hour with Claude Desktop&#39;s Cowork. Urgent tips get labeled and posted to Slack. Sales pitches get ignored.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/2e3e25be-e324-44f3-9c21-3fb5e5ecf97e/Automate_Your_Newsroom_Inbox_Triage_with_Claude_Desktop.png" length="1183233" type="image/png"/>
  <link>https://www.automation-almanac.com/p/automate-your-newsroom-inbox-triage-with-claude-desktop</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/automate-your-newsroom-inbox-triage-with-claude-desktop</guid>
  <pubDate>Mon, 06 Apr 2026 05:25:14 +0000</pubDate>
  <atom:published>2026-04-06T05:25:14Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Claude Cowork]]></category>
    <category><![CDATA[Slack]]></category>
    <category><![CDATA[Gmail]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">Every newsroom I&#39;ve worked with has a mailbox where the public can reach out — to give feedback, send tips, or pitch stories. Most of the time, someone reads it and dishes out stories to reporters. But someone has to sift through those emails to separate what matters from what doesn&#39;t, and that&#39;s not the best use of anyone&#39;s time.</p><p class="paragraph" style="text-align:left;">The fastest way to automate newsroom email triage is with Claude Desktop and its built-in task scheduler, Cowork. You write a prompt that tells Claude what to look for, connect Gmail and Slack via MCP integrations, and set it to run hourly. Claude reads your inbox, classifies each email as urgent, monitor, or noise, labels the urgent ones in Gmail, and posts a Slack digest — no server, no code.</p><p class="paragraph" style="text-align:left;">There is a limitation: it only works if your computer is awake and Claude Desktop is running. Great for when you&#39;re at your desk — but it won&#39;t catch anything when your computer is off.</p><h2 class="heading" style="text-align:left;" id="what-is-claude-desktop-cowork">What Is Claude Desktop Cowork?</h2><p class="paragraph" style="text-align:left;">Cowork is Claude Desktop&#39;s built-in task scheduler. You write a prompt, set a frequency (hourly, daily, etc.), and Claude runs it on that schedule using whatever MCP tools you&#39;ve connected. Think of it as a cron job where the script is plain English.</p><p class="paragraph" style="text-align:left;">In this triage setup, Cowork triggers Claude to check Gmail and post to Slack every hour: no Firebase functions, no n8n, no Zapier. If you&#39;ve built automated Slack reports before — like <a class="link" href="https://www.automation-almanac.com/p/how-to-automate-omeda-email-reports-to-slack-with-firebase?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=automate-your-newsroom-inbox-triage-with-claude-desktop" target="_blank" rel="noopener noreferrer nofollow">sending Omeda email stats to Slack with Firebase</a> — Cowork is a much lighter-weight option for single-machine workflows.</p><h2 class="heading" style="text-align:left;" id="how-the-inbox-triage-works">How the Inbox Triage Works</h2><p class="paragraph" style="text-align:left;">Here is what the automation does every hour:</p><ol start="1"><li><p class="paragraph" style="text-align:left;">Fetches all unread emails received in the past 60 minutes</p></li><li><p class="paragraph" style="text-align:left;">Classifies each one as urgent, monitor, or noise based on the sender domain and email content</p></li><li><p class="paragraph" style="text-align:left;">Applies a Gmail label called <code>Urgent</code> to anything that needs attention</p></li><li><p class="paragraph" style="text-align:left;">Posts a Slack digest to your channel</p></li></ol><p class="paragraph" style="text-align:left;">There is some classification logic here; you&#39;ll need to decide what that looks like for your newsroom. Domain signals come first: <code>.gov</code> or <code>.mil</code> addresses are flagged urgent by default, as are known news organization domains and anything with &quot;law&quot;, &quot;LLP&quot;, or &quot;legal&quot; in the domain name. Then come the content signals: Claude reads the email for keywords you define, such as &quot;FOIA&quot;, &quot;embargo&quot;, or &quot;on background&quot;. Then, noise: emails with language such as &quot;unsubscribe&quot;, &quot;free trial&quot;, or &quot;book a call&quot; get filtered out. If anything&#39;s ambiguous, it defaults to Monitor.</p><p class="paragraph" style="text-align:left;">The Slack digest looks like this:</p><div class="codeblock"><pre><code>🔴 Inbox Triage — 2:00 PM

URGENT (2)

• John Smith &lt;jsmith@doj.gov&gt; — &quot;Re: FOIA Request #2024-441&quot;

• tips@chicagotribune.com — &quot;Story tip: city council vote&quot;

MONITOR (3)

3 emails from real humans, no immediate action needed.

NOISE (11)

11 promotional / sales emails ignored.</code></pre></div><p class="paragraph" style="text-align:left;">If nothing&#39;s urgent, you get a quieter all-clear:</p><div class="codeblock"><pre><code>✅ Inbox Triage — 3:00 PM — Nothing urgent. 2 monitor, 8 noise.</code></pre></div><h2 class="heading" style="text-align:left;" id="how-to-set-it-up-3-steps">How to Set It Up (3 Steps)</h2><h3 class="heading" style="text-align:left;" id="step-1-connect-gmail-mcp-in-claude-"><span style="color:#434343;">Step 1: Connect Gmail MCP in Claude Desktop</span></h3><p class="paragraph" style="text-align:left;">Claude Desktop → Settings → Integrations → add the Gmail MCP and authorize it with your newsroom&#39;s Gmail account. You&#39;ll need to allow read access and label management.</p><h3 class="heading" style="text-align:left;" id="step-2-create-a-slack-incoming-webh"><span style="color:#434343;">Step 2: Create a Slack incoming webhook</span></h3><p class="paragraph" style="text-align:left;">Connect the Slack MCP to Claude Desktop. Claude Desktop → Settings → Integrations → Slack.</p><h3 class="heading" style="text-align:left;" id="step-3-set-up-the-cowork-scheduled-"><span style="color:#434343;">Step 3: Set up the Cowork Scheduled Task</span></h3><p class="paragraph" style="text-align:left;">Claude Desktop -&gt; Cowork -&gt; Scheduled Tasks -&gt; New Task</p><ol start="1"><li><p class="paragraph" style="text-align:left;">Set the frequency to Hourly.</p></li><li><p class="paragraph" style="text-align:left;">Paste the prompt from <code>prompt.md</code>.</p></li><li><p class="paragraph" style="text-align:left;">Replace <code>#your-channel-name</code> with the channel you want the digest to go to.</p></li><li><p class="paragraph" style="text-align:left;">Save.</p></li></ol><p class="paragraph" style="text-align:left;">That&#39;s it. Trigger it manually the first time to make sure the Slack message lands in the right place and the Gmail labels get added.</p><h2 class="heading" style="text-align:left;" id="what-to-watch-out-for">What to Watch Out For</h2><h3 class="heading" style="text-align:left;" id="the-newer-than-1-h-search-operator-"><span style="color:#434343;">The </span><code>newer_than:1h</code><span style="color:#434343;"> search operator is fuzzy.</span></h3><p class="paragraph" style="text-align:left;">Gmail&#39;s <code>newer_than</code> is approximate — it doesn&#39;t guarantee exactly 60 minutes.</p><h3 class="heading" style="text-align:left;" id="gov-spam-exists"><code>.gov</code><span style="color:#434343;"> spam exists.</span></h3><p class="paragraph" style="text-align:left;">Not everything from a <code>.gov</code> address is a story. Some government agencies have listservs, automated notification systems, and genuinely spammy mailing lists.</p><h3 class="heading" style="text-align:left;" id="label-creation-is-idempotent-mostly"><span style="color:#434343;">Label creation is idempotent — mostly.</span></h3><p class="paragraph" style="text-align:left;">Claude&#39;s Gmail MCP reliably handles the &quot;create label if it doesn&#39;t exist&quot; step. Still, if you rename the Gmail label manually after setup, the prompt will create a second label called &quot;Urgent&quot; instead of finding the renamed one. Keep the label name consistent.</p><p class="paragraph" style="text-align:left;">The goal here isn&#39;t to replace the person who reads the tip line — it&#39;s to make sure the important stuff doesn&#39;t sit unread for three hours because someone was in a meeting. A DOJ email or an embargo notice showing up in Slack five minutes after it lands is a meaningful improvement over discovering it at the end of the day.</p><p class="paragraph" style="text-align:left;">Start with the default classification logic, run it for a week, and adjust. You&#39;ll quickly see which domains you want to add to the urgent list and which newsletter senders you want to add to the noise. The prompt is the product here — the more you tune it to your beat, the more useful it gets.</p><p class="paragraph" style="text-align:left;">Prompt Markdown file: <a class="link" href="https://gist.github.com/kostimarko/91142eeb4f096a6d05acef8256078c99?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=automate-your-newsroom-inbox-triage-with-claude-desktop" target="_blank" rel="noopener noreferrer nofollow">https://gist.github.com/kostimarko/91142eeb4f096a6d05acef8256078c99</a></p><p class="paragraph" style="text-align:left;">Change #your-channel-here to the channel you want the message added to in Slack. If you want to update anything, just ask Claude how you would do it.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=847cbeb3-1e03-4347-a96c-b8a5d88db7a2&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>Research 500 Companies in an Afternoon with Google Sheets + Claude</title>
  <description>Look up custom data points for 500 companies using Claude and Google Apps Script — no ZoomInfo subscription. Confidence scores flag what needs a second look.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/4664d233-c12e-463c-80c4-df8df60a7163/Research_500_Companies_in_an_Afternoon_with_Google_Sheets__Claude.png" length="762794" type="image/png"/>
  <link>https://www.automation-almanac.com/p/research-500-companies-in-an-afternoon-with-google-sheets-claude</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/research-500-companies-in-an-afternoon-with-google-sheets-claude</guid>
  <pubDate>Wed, 01 Apr 2026 22:57:14 +0000</pubDate>
  <atom:published>2026-04-01T22:57:14Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Marketing Ops]]></category>
    <category><![CDATA[Google Sheets]]></category>
    <category><![CDATA[Google Apps Script]]></category>
    <category><![CDATA[Business]]></category>
    <category><![CDATA[Claude Api]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">A sales director I worked with wanted to know how many of our subscribers were for-profit vs. non-profit. Simple question. But we hadn&#39;t asked during sign-up, so the data wasn&#39;t there. The &quot;easy&quot; answer was to pay a service to append it. The expensive answer.</p><p class="paragraph" style="text-align:left;">ZoomInfo is the go-to data appending service, and it&#39;s genuinely good. But sometimes you need data it doesn&#39;t offer,  and you don&#39;t want to pay for a full subscription to fill in a few fields. Like which insurance providers does a healthcare company work with? ZoomInfo won&#39;t have that.</p><p class="paragraph" style="text-align:left;">Let&#39;s build it with Claude and a Google Apps Script. The script will take a list of companies and feed it into Claude&#39;s API to return what data we&#39;re looking for. We&#39;ll rank that on a confidence scale, and if confidence is low enough, we&#39;ll have Claude do some web searching to find it for us. </p><h2 class="heading" style="text-align:left;" id="what-youll-need">What You&#39;ll Need</h2><p class="paragraph" style="text-align:left;">1. A Google Sheet (create a new one)</p><p class="paragraph" style="text-align:left;">2. Google Apps Script (built into Google Sheets — no install required)</p><p class="paragraph" style="text-align:left;">3. An Anthropic API key with access to <code>claude-sonnet-4-6</code></p><h2 class="heading" style="text-align:left;" id="how-the-sheet-is-structured">How the Sheet Is Structured</h2><p class="paragraph" style="text-align:left;">The script uses two tabs:</p><h3 class="heading" style="text-align:left;" id="companies-tab"><b>Companies tab</b> </h3><p id="put-company-names-in-column-a-start" class="paragraph" style="text-align:left;">Put company names in column A, starting at row 2. On the first run, the script writes headers and fills in everything else. You never need to touch columns B onward.</p><h3 class="heading" style="text-align:left;" id="research-fields-tab"><b>Research Fields tab</b> </h3><p class="paragraph" style="text-align:left;">Each row defines one data point to look up, the expected format, and instructions for Claude.</p><p class="paragraph" style="text-align:left;">The Companies tab is where your data lives after it&#39;s been appended. Claude also returns a confidence score for each result. High confidence means you can trust it and move on. Low confidence flags the rows worth a second look, so you&#39;re not chasing bad data downstream. Notes are added to a column explaining why the confidence is low.</p><h2 class="heading" style="text-align:left;" id="how-the-research-works">How the Research Works</h2><p class="paragraph" style="text-align:left;">To stay within API rate limits and avoid running up token costs, the script takes two steps.</p><h3 class="heading" style="text-align:left;" id="step-1-batched-training-data"><b>Step 1: Batched training data</b></h3><p class="paragraph" style="text-align:left;">Run Research processes companies in batches of five. Claude works from its training data and returns results for all five in a single response. No web search means no token bloat. </p><h3 class="heading" style="text-align:left;" id="step-2-web-search-on-demand"><b>Step 2: Web search, on demand</b></h3><p class="paragraph" style="text-align:left;">Once Run Research is complete, you can see which rows have low confidence scores. If you want Claude to go look those up on the web, run Research Low Confidence with Web Search. It takes all the rows marked with a low confidence score, runs a web search for each company, and tries to find the data you&#39;re looking for.</p><p class="paragraph" style="text-align:left;">We run web searches only on low-confidence rows because web searches cost more tokens, running multiple in parallel costs even more, and you hit API limits fast. Step 1 won&#39;t cost as much and will get you solid results for well-known companies, Fortune 500s, major regional firms, and anything with a substantial web presence. For newer startups or less public companies, Claude&#39;s training data will be thinner; that&#39;s where the web search step earns its keep.</p><h2 class="heading" style="text-align:left;" id="running-it">Running It</h2><p class="paragraph" style="text-align:left;">Google Sheet: <a class="link" href="https://docs.google.com/spreadsheets/d/1IDUie_m612MO9ZcB-HXECn21vPO9YZR1bYBhU3yIpwI/copy?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=research-500-companies-in-an-afternoon-with-google-sheets-claude" target="_blank" rel="noopener noreferrer nofollow">https://docs.google.com/spreadsheets/d/1IDUie_m612MO9ZcB-HXECn21vPO9YZR1bYBhU3yIpwI/copy</a></p><div class="embed"><a class="embed__url" href="https://vimeo.com/1179641022?share=copy&fl=sv&fe=ci&utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=research-500-companies-in-an-afternoon-with-google-sheets-claude" target="_blank"><img class="embed__image embed__image--top" src="https://i.vimeocdn.com/video/2141541956-854e01daaf6dcf7ac16780e4b400848a9ad8c269183373d18ee90bb0169ebe94-d?f=webp&region=us"/><div class="embed__content"><p class="embed__title"> Research 500 Companies in an Afternoon with Google Sheets + Claude </p><p class="embed__description"> Research 500 Companies in an Afternoon with Google Sheets + Claude </p><p class="embed__link"> Vimeo </p></div></a></div><p class="paragraph" style="text-align:left;">Open that Google Sheet, go to <code>File -&gt; Make a copy</code>, and save it to your drive. The first time you run anything from the company research menu, you&#39;ll have to authorize the script. Google will make it seem scary, but click through A<code>dvanced -&gt; Go to Company Researcher (unsafe)</code> to proceed. If it&#39;s your first time, this is standard when running an Apps Script in your own sheet.</p><p class="paragraph" style="text-align:left;">Once authorized, you&#39;ll need your Anthropic API key. Paste it in and click OK. It gets saved to the script&#39;s properties; it lives only in your copy of the sheet. No one else can see it. You won&#39;t be asked again.</p><p class="paragraph" style="text-align:left;">If you&#39;d rather set it up manually, <a class="link" href="https://github.com/kostimarko/company-researcher?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=research-500-companies-in-an-afternoon-with-google-sheets-claude" target="_blank" rel="noopener noreferrer nofollow">the full code is on GitHub</a></p><p class="paragraph" style="text-align:left;">The Company Research menu will appear at the top toolbar with three options:</p><p class="paragraph" style="text-align:left;"><br><b>Run Research</b><br>Processes every company based on Claude&#39;s training data and returns a confidence score.</p><p class="paragraph" style="text-align:left;"><b>Research Low Confidence with Web Search</b><br>Takes companies with low confidence scores and does a web search for more data, then returns confidence based on fresh context.</p><p class="paragraph" style="text-align:left;"><b>Clear Results</b><br>Fresh start.</p><p class="paragraph" style="text-align:left;">You&#39;ll see a progress bar showing how your companies are being batched and where they are in the process. Take a coffee break after you click Run Research. For 500 companies, expect 15–30 minutes, including any checkpoint restarts.</p><h2 class="heading" style="text-align:left;" id="handling-the-6-minute-wall">Handling the 6-Minute Wall</h2><p class="paragraph" style="text-align:left;">Apps Script has a 6-minute execution limit. For a list of 500 companies processed in batches of five, that&#39;s 100 API calls. Each batch takes a few seconds to return, so the full run lands somewhere around 8–12 minutes, which means it will time out.</p><p class="paragraph" style="text-align:left;">The script handles this with a checkpoint. After every company, it writes the current row index to Script Properties. If it times out mid-run, just click <b>Run Research</b> again. It reads the checkpoint and picks up exactly where it left off, skipping everything already processed.</p><p class="paragraph" style="text-align:left;">When the run completes cleanly, the checkpoint gets deleted automatically.</p><p class="paragraph" style="text-align:left;">Even with the checkpoint restarts, you can realistically get through 500 companies in under two hours; most of that time is just waiting.</p><h2 class="heading" style="text-align:left;" id="gotchas">Gotchas</h2><h3 class="heading" style="text-align:left;" id="confidence-scores-are-claudes-selfa"><b>Confidence scores are Claude&#39;s self-assessment</b> </h3><p class="paragraph" style="text-align:left;">They&#39;re useful for triage, not precision grading. Don&#39;t get hung up on the difference between 92 and 89; both are fine. What matters is catching the rows in the 40s and 50s before they enter a sales sequence. Use the color-coding to spot check the yellow and red rows.</p><h3 class="heading" style="text-align:left;" id="the-tab-names-are-exact"><b>The tab names are exact</b> </h3><p class="paragraph" style="text-align:left;">The script looks for sheets literally named <code>Companies</code> and <code>Research Fields</code>. A typo or extra space, and it throws a setup error immediately. Worth double-checking before you run it on a 500-row list.</p><h2 class="heading" style="text-align:left;" id="what-you-end-up-with">What You End Up With</h2><p class="paragraph" style="text-align:left;">A Google Spreadsheet that appends data you want from your subscribers’ companies. Giving sales the edge to get any data they want from the web to make that next sale.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=6b2c0120-fbd8-43d4-8939-acff8e7ccfa1&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>Apple Shortcuts: Send a Weekly Family Schedule via iMessage</title>
  <description>Build a free Apple Shortcuts automation that sends a weekly iMessage with your family&#39;s calendar events. No server needed. Works on iOS 16+.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/75d48f0f-7d94-48ee-a92c-205a343b69b4/Apple-Shortcuts_Send-a-Weekly-Family-Schedule-via-iMessage.png" length="1164760" type="image/png"/>
  <link>https://www.automation-almanac.com/p/apple-shortcuts-weekly-family-schedule-imessage</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/apple-shortcuts-weekly-family-schedule-imessage</guid>
  <pubDate>Tue, 31 Mar 2026 17:56:07 +0000</pubDate>
  <atom:published>2026-03-31T17:56:07Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Automation]]></category>
    <category><![CDATA[Apple Shortcuts]]></category>
    <category><![CDATA[Lifestyle]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">Sunday nights in our house are chaos as it stands, but when we’re trying to keep track of birthday parties, dinner with friends, and family activities, it&#39;s nearly impossible without a calendar. We use Apple Calendars to track the various activities in our day-to-day lives. We can automate this with an Apple Shortcuts workflow that sends a weekly iMessage to keep us updated on what&#39;s going on.</p><p class="paragraph" style="text-align:left;"><b>What this Shortcut does:</b> Every Sunday at 7pm, it reads your Apple Calendar, groups events by day, and sends a formatted iMessage to anyone you choose — no app, no subscription, no server. Setup takes about 10 minutes, and it runs automatically every week after that.</p><h2 class="heading" style="text-align:left;" id="what-youll-need">What You&#39;ll Need</h2><ul><li><p class="paragraph" style="text-align:left;">iPhone with iOS 16 or later</p></li><li><p class="paragraph" style="text-align:left;">Apple Shortcuts app (built-in — no download needed)</p></li><li><p class="paragraph" style="text-align:left;">A few minutes to tap through the Shortcut builder</p></li></ul><h2 class="heading" style="text-align:left;" id="building-the-weekly-digest">Building the Weekly Digest</h2><p class="paragraph" style="text-align:left;">This Shortcut runs every Sunday at 7 pm and sends a formatted iMessage with everything on the calendar for the coming week. Here&#39;s what the output looks like:</p><div class="codeblock"><pre><code>This week

[Tuesday, Mar 31]
9:00 AM – Golf Club

[Friday, Apr 3]
9:00 AM – Dinner Party

[Sunday, Apr 5]
All Day – Easter</code></pre></div><h3 class="heading" style="text-align:left;" id="step-1-fetch-the-calendar-events"><span style="color:#434343;">Step 1 — Fetch the calendar events</span></h3><p class="paragraph" style="text-align:left;">Add a <code>Find Calendar Events</code> action. This is the only filter setup you need:</p><ul><li><p class="paragraph" style="text-align:left;"><b>Start Date</b>: is in the next 7 days</p></li><li><p class="paragraph" style="text-align:left;"><b>Sort by</b>: Start Date, ascending</p></li><li><p class="paragraph" style="text-align:left;"><b>Order</b>: Oldest First</p></li><li><p class="paragraph" style="text-align:left;"><b>Limit</b>: Off</p></li></ul><p class="paragraph" style="text-align:left;">This will get us all the events in the next seven days from every calendar we&#39;ve loaded into Apple Calendars. Without the ascending sort, we won&#39;t get the calendar date grouped correctly. If there is a calendar you want to exclude from this, we can do so in a future step.</p><p class="paragraph" style="text-align:left;">One thing to note about the &#39;is in the next 7 days&#39; filter is that, since we have this automation set to run on Sunday at 7pm, anything on the calendar for Sunday at 9 pm will also appear in this weekly briefing.</p><h3 class="heading" style="text-align:left;" id="step-2-set-up-the-message-variables"><span style="color:#434343;">Step 2 — Set up the message variables</span></h3><p class="paragraph" style="text-align:left;">Before we loop through events, initialize two Text variables:</p><p class="paragraph" style="text-align:left;"><b>WeeklyMessage</b> — starts empty. This is where the formatted digest gets built up line by line.</p><p class="paragraph" style="text-align:left;"><b>LastDay</b> — also starts empty. This tracks which day you&#39;re currently on, so you know when to insert a new day header.</p><p class="paragraph" style="text-align:left;">LastDay is a simple trick to avoid printing the same date header twice — without it, every event would print its own date, and the message would look cluttered.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/f0ebc73f-3d35-414a-8f18-1a49571fdf8e/Screenshot_2026-03-30_at_11.47.30_PM.png?t=1774977778"/></div><h3 class="heading" style="text-align:left;" id="step-3-loop-through-events-and-buil"><span style="color:#434343;">Step 3 — Loop through events and build the message</span></h3><p class="paragraph" style="text-align:left;">Add a <code>Repeat with Each</code> action over the Calendar Events from Step 2. </p><p class="paragraph" style="text-align:left;"><b>Group By Date:</b></p><ul><li><p class="paragraph" style="text-align:left;">Get the Start Date from Repeat Item</p></li><li><p class="paragraph" style="text-align:left;">Format the Start Date so it&#39;s legible. Make sure you use the custom date format, and set the format string to &quot;EEEE, MMM d&quot;. This gives you something like &quot;Monday, Mar 30.&quot;</p></li><li><p class="paragraph" style="text-align:left;">Log the formatted date to a variable called EventDay</p></li></ul><ul><li><p class="paragraph" style="text-align:left;">Add an &#39;If&#39; block to check to see if EventDay is not Lastday. Inside the &#39;If&#39; block:</p></li><li><p class="paragraph" style="text-align:left;">Add a Text action with a Return before the EventDay variable, press Return first in the text field, then insert the EventDay variable.</p></li><li><p class="paragraph" style="text-align:left;">Add that Text to our WeeklyMessage variable.</p></li><li><p class="paragraph" style="text-align:left;">Then set LastDay to EventDay. </p></li></ul><p class="paragraph" style="text-align:left;">This groups all the dates together. The first time you hit Monday, the LastDay variable is empty, so you get the header, and it skips because LastDay is already set for Monday.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/c24179ab-e5bd-4836-bac8-fb094cc201b0/Screenshot_2026-03-30_at_11.48.05_PM.png?t=1774978031"/></div><p class="paragraph" style="text-align:left;"><b>Handle all-day events separately:</b></p><ul><li><p class="paragraph" style="text-align:left;">Get the Start Date from the calendar events’ repeated item</p></li><li><p class="paragraph" style="text-align:left;">Format that date and store it in a variable</p></li><li><p class="paragraph" style="text-align:left;">Do a check to see if the Start Date is 12:00am</p></li><li><p class="paragraph" style="text-align:left;">Get the Title of the event from the repeated item</p></li><li><p class="paragraph" style="text-align:left;">Add a Text action with “All Day – Title.”</p></li><li><p class="paragraph" style="text-align:left;">Then add the Text to the WeeklyMessage variable</p></li></ul><p class="paragraph" style="text-align:left;">Typically, Apple Calendar sets the start time for an all-day event at 12:00am, so if you have an event that starts at midnight (why would you?), it will get shown as all day.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/d2af8def-784b-46a2-8979-eb120da0d319/Screenshot_2026-03-31_at_9.36.28_AM.png?t=1774978105"/></div><p class="paragraph" style="text-align:left;"><b>Build the Messaging:</b></p><ul><li><p class="paragraph" style="text-align:left;">Get the calendar from the repeated item</p></li><li><p class="paragraph" style="text-align:left;">Set a variable for the calendar name</p></li><li><p class="paragraph" style="text-align:left;">Get the Title from the repeated item</p></li><li><p class="paragraph" style="text-align:left;">Create a text action with EventTime – Event Title - EventCalendar</p></li><li><p class="paragraph" style="text-align:left;">Add that Text to the WeeklyMessage variable</p></li></ul><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/4fd925ec-582f-464f-bed4-fb5be377b566/Screenshot_2026-03-31_at_9.51.54_AM.png?t=1774978169"/></div><h3 class="heading" style="text-align:left;" id="step-4-handle-the-empty-case"><span style="color:#434343;">Step 4 – Handle the empty case</span></h3><p class="paragraph" style="text-align:left;">After the loop, add an ‘If’ block to check if the WeeklyMessage is empty. We set the WeeklyMessage variable to “No Events This Week”. Since we update the WeeklyMessage variable as we repeat through the calendar events, if the message is empty, that means we have nothing to do that week. We create and set a variable called FinalMessage to the text value.</p><p class="paragraph" style="text-align:left;">Otherwise, we create a text action with the header “This Week” and the WeeklyMessage, and set its text value to FinalMessage.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/4ecd8ece-f03f-453f-9414-ca6c997f5116/Screenshot_2026-03-31_at_10.14.42_AM.png?t=1774978200"/></div><h3 class="heading" style="text-align:left;" id="step-5-compose-and-send-the-message"><span style="color:#434343;">Step 5 – Compose and send the message</span></h3><p class="paragraph" style="text-align:left;">Create a send message action, then add the FinalMessage variable to the input and our Recipients to the message.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/94170a7c-7a5f-4f83-a987-2bd7d8c025ab/Screenshot_2026-03-31_at_10.17.50_AM.png?t=1774978218"/></div><h3 class="heading" style="text-align:left;" id="step-6-setting-up-the-apple-shortcu"><span style="color:#434343;">Step 6 – Setting Up the Apple Shortcuts Automation</span></h3><p class="paragraph" style="text-align:left;">In the Apple Shortcuts app, you should see an Automation tab at the bottom, tap the + button, select Time of Day, and set it to run every Sunday at 7:00pm. Make sure that “Ask Before Running” is turned off; you don’t want to confirm the Shortcut should run; it should happen automatically.</p><p class="paragraph" style="text-align:left;">This Apple Shortcuts weekly calendar automation lets us keep an eye on what’s going on in our lives, week by week. As parents, we already have too much to worry about, and remembering where to go and when to be there takes up a lot of our mental load.</p><p class="paragraph" style="text-align:left;">Once this is running, Sunday nights get a little quieter. Instead of scrambling to remember what&#39;s happening this week, we get a tidy digest delivered automatically — no checking the calendar, no forgetting the dentist appointment, no &quot;wait, is that this Friday?&quot; moments. Set it up once, and it just runs. If you build this, reply and let me know — I&#39;d love to hear how you&#39;ve made it your own.</p><p class="paragraph" style="text-align:left;"><b>Shortcut Link:</b> <a class="link" href="https://www.icloud.com/shortcuts/e9c43de5c2d64dccb7ac3d9dea407c17?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=apple-shortcuts-send-a-weekly-family-schedule-via-imessage" target="_blank" rel="noopener noreferrer nofollow">https://www.icloud.com/shortcuts/e9c43de5c2d64dccb7ac3d9dea407c17</a></p><h2 class="heading" style="text-align:left;" id="faq">FAQ</h2><p class="paragraph" style="text-align:left;"><b>Can I use this Shortcut with Google Calendar or Outlook?</b></p><p class="paragraph" style="text-align:left;">Yes — as long as your Google Calendar or Outlook account is connected to the iPhone Calendar app, Apple Shortcuts can read those events. Go to Settings &gt; Calendar &gt; Accounts to check which calendars are synced.</p><p class="paragraph" style="text-align:left;"><b>Does the shortcut work on iPad?</b></p><p class="paragraph" style="text-align:left;">Yes. Apple Shortcuts runs on iPad with iPadOS 16 or later. The automation setup is identical.</p><p class="paragraph" style="text-align:left;"><b>Can I send the weekly digest to a group iMessage thread?</b></p><p class="paragraph" style="text-align:left;">Yes. In Step 5, add multiple recipients to the Send Message action. The digest will go to everyone in that thread.</p><p class="paragraph" style="text-align:left;"><b>What happens if I have no events that week?</b></p><p class="paragraph" style="text-align:left;">The Shortcut handles this — if there are no calendar events in the next 7 days, it sends &quot;No Events This Week&quot; instead of a blank message.</p><p class="paragraph" style="text-align:left;"><b>Will this drain my battery or run in the background?</b></p><p class="paragraph" style="text-align:left;">No. Apple Shortcuts automations run only at their scheduled time and complete in seconds. There is no persistent background process.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=3677f154-3aae-464e-adc0-cbbc164d635a&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>Google Sheets Meal Planner with Automatic Grocery List</title>
  <description>Google Sheets meal planner that scores recipes based on what you have, automatically builds your grocery list, and syncs with Apple Reminders or Google Tasks.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/154050cc-27e3-4730-8bd2-88c0fd4bd204/Google_Sheets_Meal_Planner_with_Automatic_Grocery_List.png" length="1476922" type="image/png"/>
  <link>https://www.automation-almanac.com/p/google-sheets-meal-planner-with-automatic-grocery-list</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/google-sheets-meal-planner-with-automatic-grocery-list</guid>
  <pubDate>Tue, 24 Mar 2026 22:22:57 +0000</pubDate>
  <atom:published>2026-03-24T22:22:57Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Automation]]></category>
    <category><![CDATA[Apple Shortcuts]]></category>
    <category><![CDATA[Google Sheets]]></category>
    <category><![CDATA[Lifestyle]]></category>
    <category><![CDATA[Google Apps Script]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">Every Sunday night, everyone in my house asks me what we’re eating this week. I open the fridge and try to get the mayo to tell me what we’re making this week. I turn to our recipe book, and we choose 5–7 recipes we like. I write a list, check the fridge, and head to the store to stumble around looking for a can of coconut milk. </p><p class="paragraph" style="text-align:left;">Grocery apps exist for this reason; they also charge you money, and if you’re a reader of this newsletter, you know I hate paying a monthly subscription. So I built our process into Google Sheets. I imported all the recipes we use, with their ingredients and directions. It scores recipes by how many ingredients you already have, pushes missing ingredients to either Google Tasks or Apple Reminders, and updates the pantry when I’m done shopping. It runs in a spreadsheet and in Apple Shortcuts on my phone.</p><h2 class="heading" style="text-align:left;" id="how-this-google-sheets-meal-planner">How This Google Sheets Meal Planner Works</h2><p class="paragraph" style="text-align:left;">There are two ways to use this, depending on where you want to live: Google Sheets or your phone.</p><p class="paragraph" style="text-align:left;"><b>From the sheet: </b>A 🛒 Grocery Helper menu appears at the top with three options: Plan This Week, Cook Tonight, and Done Shopping. These open sidebars push to Google Tasks.</p><p class="paragraph" style="text-align:left;"><b>From your phone</b>: Three Apple Shortcuts — one to plan the week, one to get recipe steps, one to mark the shopping done. These talk to the web app and write to Apple Reminders.</p><p class="paragraph" style="text-align:left;">You can use either path; the script is the same. </p><p class="paragraph" style="text-align:left;"></p><h2 class="heading" style="text-align:left;" id="what-youll-need">What You’ll Need</h2><ol start="1"><li><p class="paragraph" style="text-align:left;">A Google Sheet with two tabs, <b>Recipes</b> and <b>Pantry</b></p></li><li><p class="paragraph" style="text-align:left;">Google Apps Script, this is where the script runs, which is attached to your Google Sheet</p></li><li><p class="paragraph" style="text-align:left;">Google Tasks API enabled in Apps Script</p></li><li><p class="paragraph" style="text-align:left;">Apple Shortcut, iOS/macOS only.</p></li></ol><p class="paragraph" style="text-align:left;"><i>Note: The Apple Shortcuts side uses Apple Reminders for the grocery list. The sheet-side flow uses Google Tasks. Pick whichever fits how you shop.</i></p><h2 class="heading" style="text-align:left;" id="setting-up-the-sheets">Setting Up The Sheets</h2><p class="paragraph" style="text-align:left;"><b>Recipes tab</b>: four columns <code>Name, Ingredients, Steps, This Week</code>. Ingredients can be listed as a comma-separated list: <code>2 Cups flour, 1 egg, 200g pasta</code> . Steps will need to be listed with each step on its own line. The “This Week” column should be set up as a checkbox and should never be touched after that. It’s what determines what you’re making this week. </p><p class="paragraph" style="text-align:left;"><b>Pantry tab</b>: three columns, <code>Item, In Stock, Quanity</code> . The &quot; In stock&quot; checkbox is required, and the quantity column is optional. If you track the quantity like I do, the script subtracts the amount and unchecks the item when you run out.</p><p class="paragraph" style="text-align:left;">I had to manually import our recipes, but I’ll give each subscriber a Google Sheet with at least five recipes. In the Google Sheet, you’ll see a custom menu called 🛒<b> Grocery Helper</b>. This will give you everything you need to run the entire process. </p><h2 class="heading" style="text-align:left;" id="how-recipe-scoring-works">How Recipe Scoring Works</h2><p class="paragraph" style="text-align:left;">The script reads every ingredient in each recipe, checks them against your Pantry tab, and counts how many are missing. Recipes are sorted from the fewest missing items to the most, so you always see what you can cook right now at the top. No AI involved — it&#39;s plain substring matching run against your own data.</p><div class="codeblock"><pre><code>```
Pasta Arrabbiata — need 0 items
Chicken Stir Fry — need 1 item
Thai Green Curry — need 4 items
```</code></pre></div><h2 class="heading" style="text-align:left;" id="generating-the-grocery-list">Generating the Grocery List</h2><p class="paragraph" style="text-align:left;">When you confirm your meal plan, the script</p><ol start="1"><li><p class="paragraph" style="text-align:left;">Marks your chosen recipes as “This Week” in the recipes tab</p></li><li><p class="paragraph" style="text-align:left;">Collects every ingredient across all the recipes that aren’t already in your pantry</p></li><li><p class="paragraph" style="text-align:left;">De-duplicates and combines quantities. Two recipes call for 1 cup of flour? The script combines them, so your list says 2 cups of flour.</p></li><li><p class="paragraph" style="text-align:left;">Pushes the final list to a Groceries task list in Google Tasks. </p></li></ol><p class="paragraph" style="text-align:left;">When you click <b>Done Shopping</b>, the script reads your completed tasks and checks them into the Pantry tab. </p><h2 class="heading" style="text-align:left;" id="cook-tonight-and-pantry-deduction">Cook Tonight and Pantry Deduction</h2><p class="paragraph" style="text-align:left;">The Cook Tonight sidebar shows only the recipes marked for this week. Pick one, and the script returns the steps, removes the recipe from your&quot; This Week” list, and deducts its ingredients from the pantry.</p><p class="paragraph" style="text-align:left;">Deduction is “smart” about the quantities. <code>500g flour</code> in the pantry, minus a recipe calling for <code>200g flour</code> leaves, you are left with <code>300g flour</code>. If the recipe depletes it, the item gets unchecked. If the recipe lists no quantity, just garlic, it unchecks it outright.</p><p class="paragraph" style="text-align:left;">When units don’t match, the script unchecks the item rather than guessing at a conversion. Better to re-check something that’s still there than silently track the wrong number.</p><h2 class="heading" style="text-align:left;" id="gotchas">Gotchas</h2><h3 class="heading" style="text-align:left;" id="why-does-the-script-fail-to-find-my">Why does the script fail to find my Recipes sheet?</h3><p class="paragraph" style="text-align:left;">The script looks for sheet names “Recipes” and “Pantry”. Anything else and it fails.</p><h3 class="heading" style="text-align:left;" id="why-does-the-sheetside-flow-throw-a">Why does the sheet-side flow throw a reference error? </h3><p id="in-the-apps-script-editor-services-" class="paragraph" style="text-align:left;">In the Apps Script editor. Services → add <b>Google Tasks API</b>. Without this, the sheet-side flow throws an error immediately. </p><h3 class="heading" style="text-align:left;" id="will-my-grocery-list-sync-between-a">Will my grocery list sync between Apple Reminders and Google Tasks?</h3><p class="paragraph" style="text-align:left;">The shortcuts write to Apple Reminders. The Google Sheet writes to Google Tasks. These are separate lists. If you’re on Android, you can use Google Tasks, and if you’re on iOS, you can use Reminders. </p><h3 class="heading" style="text-align:left;" id="what-happens-if-recipes-use-differe">What happens if recipes use different units for the same ingredient?</h3><p class="paragraph" style="text-align:left;">2 cups and 1 cup combine to 3 cups. But 200g and 1lb don’t. The script shows 200g + 1lb rather than guessing at a conversion. Pick a unit per ingredient and stick to it.</p><h3 class="heading" style="text-align:left;" id="can-i-manually-edit-the-this-week-c">Can I manually edit the This Week column in the Recipes tab?</h3><p class="paragraph" style="text-align:left;">Don’t manually check or uncheck the boxes in this column. The script does this in the background to manage what you’re eating this week.</p><p class="paragraph" style="text-align:left;"><b>Sign up for the Automation Almanac newsletter</b> to get the full working script, both sidebar HTML files, and all three Apple Shortcuts.</p><h2 class="heading" style="text-align:left;" id="the-goods">The Goods</h2><p class="paragraph" style="text-align:left;"><b>Google Sheet + Apps Script: </b><a class="link" href="https://docs.google.com/spreadsheets/d/1Jyy0sPrExPidfOLff__zP-4fTidDPd8ZRTRSyTD9eAI/copy?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=google-sheets-meal-planner-with-automatic-grocery-list" target="_blank" rel="noopener noreferrer nofollow">https://docs.google.com/spreadsheets/d/1Jyy0sPrExPidfOLff__zP-4fTidDPd8ZRTRSyTD9eAI/copy</a></p><p class="paragraph" style="text-align:left;"><b>Plan This Week Shortcut: </b><a class="link" href="https://www.icloud.com/shortcuts/28ed97d7be624213a774a6b7781a37a4?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=google-sheets-meal-planner-with-automatic-grocery-list" target="_blank" rel="noopener noreferrer nofollow">https://www.icloud.com/shortcuts/28ed97d7be624213a774a6b7781a37a4</a></p><p class="paragraph" style="text-align:left;"><b>Cook Tonight Shortcut: </b><a class="link" href="https://www.icloud.com/shortcuts/56ee3daf474a427ab1ef04ae9466bb6c?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=google-sheets-meal-planner-with-automatic-grocery-list" target="_blank" rel="noopener noreferrer nofollow">https://www.icloud.com/shortcuts/56ee3daf474a427ab1ef04ae9466bb6c</a></p><p class="paragraph" style="text-align:left;"><b>Done Shopping Shortcut: </b><a class="link" href="https://www.icloud.com/shortcuts/82da84bd65ef4a3eabf2f76f436b910b?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=google-sheets-meal-planner-with-automatic-grocery-list" target="_blank" rel="noopener noreferrer nofollow">https://www.icloud.com/shortcuts/82da84bd65ef4a3eabf2f76f436b910b</a></p><h2 class="heading" style="text-align:left;" id="the-apple-shortcuts">The Apple Shortcuts</h2><p class="paragraph" style="text-align:left;">If you deploy the script as a Web App, you get a URL you can hit from anywhere. The three shortcuts below map to the same three menu actions — just from your phone.</p><p class="paragraph" style="text-align:left;"><i>Important: Build these on your Mac, not your phone. Shortcuts on iOS is a nightmare to work with. Once they&#39;re built, they sync automatically.</i></p><h3 class="heading" style="text-align:left;" id="plan-this-week-shortcut">Plan This Week Shortcut</h3><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/91ae6d84-1cf8-4535-9696-ffc5e26a1948/Screenshot_2026-03-24_at_3.55.25_PM.png?t=1774389718"/></div><p class="paragraph" style="text-align:left;">The shortcut hits the web app URL, parses the JSON response, and pulls the <code>options</code> array, which is the same scored recipe list from the sheet. A &quot;Choose from List&quot; step lets you pick what you want to make. Your selections go back to the web app as a POST, which runs the meal plan, generates the grocery list, and returns an <code>items</code> array. The shortcut loops through the items and adds each one to an <b>Apple Reminders</b> list called <b>Groceries</b>.</p><p class="paragraph" style="text-align:left;">One thing to note: this flow writes to Reminders, not Google Tasks. If you use both the sheet and the shortcuts, your grocery list will end up split between two apps. Pick one and stick to it.</p><h3 class="heading" style="text-align:left;" id="cook-tonight-shortcut">Cook Tonight Shortcut</h3><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/c5fe827f-9fdb-422a-bbe7-ee9d378fecbd/Screenshot_2026-03-24_at_3.55.49_PM.png?t=1774389920"/></div><p class="paragraph" style="text-align:left;">The shortcut hits the web app with <code>?mode=thisweek</code>, which returns only the recipes you planned for this week. You pick one from the list. The shortcut hits the web app again, gets the <code>steps</code> value from the response, and sends it as an iMessage to yourself — so the recipe ends up in your messages where it&#39;s easy to scroll through while you cook.</p><p class="paragraph" style="text-align:left;">The web app also marks the recipe as cooked and deducts the ingredients from the pantry, same as clicking Cook Tonight in the sheet.</p><h3 class="heading" style="text-align:left;" id="done-shopping-shortcut">Done Shopping Shortcut</h3><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/7bdee778-f338-46bf-8a36-add1615bfc28/Screenshot_2026-03-24_at_3.55.42_PM.png?t=1774389928"/></div><p class="paragraph" style="text-align:left;">The shortcut finds all completed items in your <b>Groceries</b> Reminders list. If there are none, it shows a notification — &quot;You still have groceries to shop for&quot; — and stops. Otherwise, it pulls the titles, shows them in Quick Look so you can confirm what&#39;s about to be updated, then POSTs the list to the web app to update the pantry.</p><p class="paragraph" style="text-align:left;">This is the Reminders-side equivalent of the Done Shopping button in the sheet. Same result: pantry gets updated, completed items get cleared.</p><h2 class="heading" style="text-align:left;" id="deploying-the-web-app">Deploying the Web App</h2><p class="paragraph" style="text-align:left;">In Apps Script, go to <b>Deploy → New Deployment</b>. Set it to Web App, execute as yourself, and set access to <b>Anyone</b>. That&#39;s what allows the Shortcuts to POST without authentication. The web app URL contains a long random token — it&#39;s not guessable or publicly indexed. Anyone with the exact URL can use it, so don&#39;t share it broadly.</p><p class="paragraph" style="text-align:left;">Copy the URL and set it as the <code>Text</code> variable at the top of each shortcut.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=334b028b-824b-43aa-9e06-585c77dbd1ed&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Normalize CRM Job Titles by Seniority with Claude and Google Sheets</title>
  <description>Stop manually cleaning freeform CRM titles. This Google Apps Script uses Claude to normalize and classify job titles by seniority bucket — no code required.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/92505acb-4a62-4500-8c3b-ff00eb7227c7/How_to_Normalize_CRM_Job_Titles_by_Seniority_with_Claude_and_Google_Sheets.png" length="740576" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-normalize-crm-job-titles-by-seniority-with-claude-and-google-sheets</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-normalize-crm-job-titles-by-seniority-with-claude-and-google-sheets</guid>
  <pubDate>Mon, 16 Mar 2026 22:01:22 +0000</pubDate>
  <atom:published>2026-03-16T22:01:22Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Marketing Ops]]></category>
    <category><![CDATA[Google Sheets]]></category>
    <category><![CDATA[Data Cleaning]]></category>
    <category><![CDATA[Google Apps Script]]></category>
    <category><![CDATA[Business]]></category>
    <category><![CDATA[Claude Api]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">I used to manage audience data for B2B media companies, I still do, but I used to too. We sold ad campaigns, sponsored content, and email deployments; advertisers always wanted some version of “We want to target only directors and above.”</p><p class="paragraph" style="text-align:left;">The problem was that the data wasn’t always…clean. How could it be? Some people have made up titles like “Growth Ninja”, “Chief Evangelist”, or sometimes people would shorten their titles to “Sr. Mgr. Digital Experience”. Every year, someone (usually me) has to normalize job titles and seniority buckets for advertisers.</p><p class="paragraph" style="text-align:left;">Cleaning the data always felt rushed and fragile, and every time I found a goofy title, I would have to make a judgment call about where to bucket it, write a note about why, and move on. </p><h2 class="heading" style="text-align:left;" id="freeform-titles-are-a-segmentation-">Freeform Titles Are a Segmentation Tax</h2><p class="paragraph" style="text-align:left;">Every time you need to update audience segmentation, or sales is breathing down your neck, ask,” How many C-Suite executives are on our email list?” You pay the segmentation tax, someone (me) has to clean the data so they can use it. How much time does that take, and is that the best use of someone’s time?</p><p class="paragraph" style="text-align:left;">For B2B media companies, knowing who and what your readers do for a living is really important to how you advertise to them. Your segmentation can be filled with hot garbage because someone typed “Chief Executive Assistant,” and your lookup table included them in the C-Suite bucket. Which means you’re either lying to advertisers or leaving real audience value uncounted for. </p><p class="paragraph" style="text-align:left;">If your contact list feeds anything like the <a class="link" href="https://automation-almanac.com/how-to-automate-mailchimp-daily-reports-with-firebase/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-normalize-crm-job-titles-by-seniority-with-claude-and-google-sheets" target="_blank" rel="noopener noreferrer nofollow">daily email performance reports</a> or the <a class="link" href="https://automation-almanac.com/how-to-automate-omeda-newsletter-reports-to-slack/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-normalize-crm-job-titles-by-seniority-with-claude-and-google-sheets" target="_blank" rel="noopener noreferrer nofollow">newsletter audience reporting</a> that go to your sales team or advertisers, seniority accuracy is load-bearing data.</p><h3 class="heading" style="text-align:left;" id="what-are-the-standard-b-2-b-job-tit">What Are the Standard B2B Job Title Seniority Levels?</h3><ul><li><p class="paragraph" style="text-align:left;"><b>C-Suite</b> — CEO, Founder, CMO, President, Owner</p></li><li><p class="paragraph" style="text-align:left;"><b>VP</b> — VP, SVP, EVP, AVP, and variants</p></li><li><p class="paragraph" style="text-align:left;"><b>Director</b> — Director, Head of (team-managing), Senior Director</p></li><li><p class="paragraph" style="text-align:left;"><b>Manager</b> — Manager, Team Lead, Program Manager, Supervisor</p></li><li><p class="paragraph" style="text-align:left;"><b>IC</b> — Analyst, Engineer, Coordinator, Specialist, Account Executive</p></li></ul><h2 class="heading" style="text-align:left;" id="why-use-claude-over-a-lookup-table">Why Use Claude Over a Lookup Table?</h2><p class="paragraph" style="text-align:left;">I’ve built lookup tables and regex to try and fix this issue in the past; it’s worked for simple things like “VP” and “Manager”, but it fails immediately on:</p><ul><li><p class="paragraph" style="text-align:left;">&quot;Dir/VP, Revenue Operations&quot;</p></li><li><p class="paragraph" style="text-align:left;">&quot;Head of Partnerships&quot; (managing a team? solo? no idea)</p></li><li><p class="paragraph" style="text-align:left;">&quot;Partner, Client Strategy&quot; (equity partner? non-equity title at a big firm?)</p></li><li><p class="paragraph" style="text-align:left;">&quot;Chief Evangelist&quot;</p></li><li><p class="paragraph" style="text-align:left;">“Sr” vs “Senior”</p></li><li><p class="paragraph" style="text-align:left;">Anything that is in a different language, I’m looking at you, Geschäftsführer.</p></li></ul><p class="paragraph" style="text-align:left;">You can extend these lookup tables indefinitely and still not cover all use cases, but does anyone want to? Is that how you really want to spend your time?</p><p class="paragraph" style="text-align:left;">The advantage of Claude is that you can offload some of that knowledge. You can provide instructions in a markdown file and explain your classification logic. With a dedicated section for edge cases, you can have the rules evolve. You’re building a standard for how you classify data. </p><h2 class="heading" style="text-align:left;" id="where-the-domain-expertise-lives">Where the Domain Expertise Lives</h2><p class="paragraph" style="text-align:left;">The ruleset is a plain Markdown document that becomes Claude&#39;s system prompt. It defines the five seniority buckets with examples, sets normalization rules (fix capitalization, expand abbreviations, clean punctuation), and explicitly handles edge cases.</p><p class="paragraph" style="text-align:left;">In this version of the tool, the ruleset lives in a dedicated <b>&quot;Title Normalizer Rules&quot;</b> tab in your Google Sheet — not in a file on your machine. That matters: anyone with access to the sheet can read and edit it without touching code. When your definition of &quot;Director&quot; changes, you update the tab, not a config file. Here’s an excerpt from the ruleset.</p><div class="codeblock"><pre><code>## Seniority Buckets

### C-Suite
The most senior executive leaders with company-wide authority. Typically report to a board or directly own the business.

Examples: CEO, CTO, CFO, COO, CMO, Founder, Co-Founder, President, Managing Director, Owner, Partner (at own firm)

### VP
Senior leaders who manage directors or large teams. Carry budget authority and are typically two levels below the CEO.

Examples: VP, Vice President, SVP, Senior Vice President, EVP, AVP, VP of Sales, VP of Marketing, VP of Engineering

## Edge Cases

- **&quot;Head of [Department]&quot;**: Use `Director` if they likely manage a team.
  Use `IC` if the context suggests they&#39;re a solo contributor with a fancy title.
- **&quot;Founder&quot;**: Always `C-Suite`, regardless of company size.
- **&quot;Partner&quot;**: Use `C-Suite` if at their own firm. Use `IC` or `Director`
  if at a larger organization where Partner is a non-equity title.
- **&quot;Principal&quot;**: Use `C-Suite` if it implies ownership. Use `IC` if it&#39;s a
  technical seniority level (e.g. &quot;Principal Engineer&quot;).
- **Non-English titles**: Normalize to the English equivalent if confident
  (e.g. &quot;Geschäftsführer&quot; → &quot;CEO&quot;, bucket: `C-Suite`). Use `Unknown` if unsure.</code></pre></div><p class="paragraph" style="text-align:left;">The edge case section is the most important part. Every time the tool flags something wrong, the right fix is to add a new edge-case rule and rerun — not to fight the model. The ruleset is a living documentation of how your organization thinks about seniority.</p><h2 class="heading" style="text-align:left;" id="how-the-google-apps-script-works">How the Google Apps Script Works</h2><p class="paragraph" style="text-align:left;">This script runs in Google Apps Script and is directly attached to your Google Sheet. It reads job titles from your sheet, sends them to Claude in batches with a classification ruleset you define, and writes &quot;Normalized Title&quot; and &quot;Seniority Bucket&quot; columns back — without touching your original data. Setup requires pasting two files into the Apps Script editor and saving your Anthropic API key once.</p><p class="paragraph" style="text-align:left;">When you open the sheet, a <b>CRM Tools</b> menu appears with three options: Normalize Titles, Dry Run Preview, and Update Rules from Corrections.</p><p class="paragraph" style="text-align:left;">The part that took me the longest to design was the feedback loop. Every tool like this has the same problem: Claude flags ambiguous titles as &quot;Unknown,&quot; you fix them manually, and two months later, you&#39;re fixing the same titles again because nothing was learned from your corrections. This one does. Unknown titles are highlighted in yellow on the sheet. You correct them. One menu click sends those corrections back to Claude, which updates the ruleset automatically. The next run handles those titles correctly — and anything like them.</p><p class="paragraph" style="text-align:left;">Here&#39;s what happens when you run <b>Normalize Titles</b>:</p><ol start="1"><li><p class="paragraph" style="text-align:left;">If the &quot;Title Normalizer Rules&quot; tab doesn&#39;t exist, it&#39;s created and seeded with the default ruleset</p></li><li><p class="paragraph" style="text-align:left;">The ruleset tab is read and used as Claude&#39;s system prompt</p></li><li><p class="paragraph" style="text-align:left;">The active sheet is scanned for the &quot;Job Title&quot; column</p></li><li><p class="paragraph" style="text-align:left;">Rows with an existing &quot;Seniority Bucket&quot; value are skipped (idempotency)</p></li><li><p class="paragraph" style="text-align:left;">Unprocessed titles are batched in groups of 50 and sent to Claude via <code>UrlFetchApp</code></p></li><li><p class="paragraph" style="text-align:left;">Claude returns a JSON array with <code>original</code>, <code>normalized</code>, and <code>bucket</code> for each title</p></li><li><p class="paragraph" style="text-align:left;">Results are written to &quot;Normalized Title&quot; and &quot;Seniority Bucket&quot; columns</p></li><li><p class="paragraph" style="text-align:left;">Any row where bucket = &quot;Unknown&quot; gets highlighted yellow — a visual flag to review</p></li></ol><p class="paragraph" style="text-align:left;">The script handles its own auth. Because it runs inside Apps Script with <code>SpreadsheetApp</code> Google handles the Sheets permission natively. The only credential you manage is your Anthropic API key, which is saved to Script Properties on first run, so you&#39;re asked only once.</p><h2 class="heading" style="text-align:left;" id="frequently-asked-questions">Frequently Asked Questions</h2><h3 class="heading" style="text-align:left;" id="does-this-work-on-large-contact-lis">Does this work on large contact lists?</h3><p class="paragraph" style="text-align:left;">The script processes titles in batches of 50 per API call. For lists with thousands of rows, you may need to run it in chunks due to Google Apps Script&#39;s 6-minute execution limit — but idempotency means already-processed rows are always skipped.</p><h3 class="heading" style="text-align:left;" id="what-happens-when-claude-cant-class">What happens when Claude can&#39;t classify a title?</h3><p class="paragraph" style="text-align:left;">The script writes &quot;Unknown&quot; in the Seniority Bucket column and highlights the cell yellow. You correct it manually, then run &quot;Update Rules from Corrections&quot; to feed that correction back into the ruleset.</p><h3 class="heading" style="text-align:left;" id="do-i-need-to-know-how-to-code-to-us">Do I need to know how to code to use this?</h3><p class="paragraph" style="text-align:left;">No. The script is paste-and-run inside the Apps Script editor. The only credential you manage is an Anthropic API key, which you save once and never touch again.</p><h3 class="heading" style="text-align:left;" id="how-much-will-this-cost-me">How much will this cost me?</h3><p class="paragraph" style="text-align:left;">The script uses Claude Haiku, which is priced for exactly this kind of batch classification work. A list of 10,000 titles costs well under a dollar to process — check current per-token pricing at <a class="link" href="https://console.anthropic.com?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-normalize-crm-job-titles-by-seniority-with-claude-and-google-sheets" target="_blank" rel="noopener noreferrer nofollow">https://console.anthropic.com</a>. The higher cost is the Anthropic API key, which requires a paid account.</p><h3 class="heading" style="text-align:left;" id="which-model-does-this-use">Which model does this use?</h3><p class="paragraph" style="text-align:left;">The script uses claude-haiku-4-5 by default — Claude&#39;s fastest and cheapest model. Haiku is the right call for structured classification tasks like this: the input is simple, the output format is rigid, and speed matters more than reasoning depth. You&#39;re not asking it to write copy or analyze strategy; you&#39;re asking it to apply a ruleset you&#39;ve already written. Haiku does that well at a fraction of the cost of larger models.</p><h2 class="heading" style="text-align:left;" id="want-the-complete-code-and-walkthro">Want the complete code and walk-through?</h2><p class="paragraph" style="text-align:left;"><b>Sign up for the Automation Almanac newsletter</b> to get the complete working code. Everything you need to run this on your own sheet today.</p><p class="paragraph" style="text-align:left;">Code Base: <a class="link" href="https://gist.github.com/kostimarko/bd329913eca2c02d4b3e73dc38449c87?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-normalize-crm-job-titles-by-seniority-with-claude-and-google-sheets" target="_blank" rel="noopener noreferrer nofollow">https://gist.github.com/kostimarko/bd329913eca2c02d4b3e73dc38449c87</a><br>Appscript JSON: <a class="link" href="https://gist.github.com/kostimarko/3037b31c290ba025c6b4c9f83fe8046c?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-normalize-crm-job-titles-by-seniority-with-claude-and-google-sheets" target="_blank" rel="noopener noreferrer nofollow">https://gist.github.com/kostimarko/3037b31c290ba025c6b4c9f83fe8046c</a></p><h2 class="heading" style="text-align:left;" id="google-apps-script-code-walkthrough">Google Apps Script Code Walkthrough</h2><p class="paragraph" style="text-align:left;">If you don’t care about the codebase and why every function does something, and you just want to get on with cleaning your job titles, watch this video.</p><div class="embed"><a class="embed__url" href="https://vimeo.com/1174176546?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-normalize-crm-job-titles-by-seniority-with-claude-and-google-sheets" target="_blank"><img class="embed__image embed__image--top" src="https://i.vimeocdn.com/video/2134686729-9a9c2195c4b4c38260679f0e7601a6b35430cb5fbc7d584a1bc1038642335f95-d?f=webp&region=us"/><div class="embed__content"><p class="embed__title"> CRM Title Normalizer </p><p class="embed__description"> Stop manually cleaning freeform CRM titles. This Google Apps Script uses Claude to normalize and classify job titles by seniority bucket — no code required. </p><p class="embed__link"> vimeo.com/1174176546 </p></div></a></div><p class="paragraph" style="text-align:left;">If you’re more technical and care about the inner workings, read the rest</p><h3 class="heading" style="text-align:left;" id="reading-job-titles-from-the-google-">Reading Job Titles from the Google Sheet</h3><p class="paragraph" style="text-align:left;"><code>SpreadsheetApp</code> handles everything — no API client, no auth setup. The script reads the entire sheet into memory <code>getDataRange().getValues()</code>, finds the title column by header name, and collects rows that don&#39;t yet have a bucket value:</p><div class="codeblock"><pre><code>const alreadyDone = bucketIdx !== -1 &amp;&amp;
  String(data[i][bucketIdx] || &quot;&quot;).trim() !== &quot;&quot;;</code></pre></div><p class="paragraph" style="text-align:left;">If the bucket column doesn&#39;t exist, no rows are skipped — everything gets processed.</p><h3 class="heading" style="text-align:left;" id="batching-to-claude">Batching to Claude</h3><p class="paragraph" style="text-align:left;">Google Apps Script doesn&#39;t have a native HTTP client, but <code>UrlFetchApp.fetch()</code> handles external API calls cleanly — including to the Claude Messages API.</p><p class="paragraph" style="text-align:left;">The API call goes through <code>UrlFetchApp.fetch()</code>, which is Apps Script&#39;s built-in HTTP client. The payload is standard Claude Messages API format — system prompt (the ruleset), user message (the titles):</p><div class="codeblock"><pre><code>UrlFetchApp.fetch(&quot;https://api.anthropic.com/v1/messages&quot;, &#123;
  method: &quot;post&quot;,
  headers: &#123;
    &quot;x-api-key&quot;: apiKey,
    &quot;anthropic-version&quot;: &quot;2023-06-01&quot;,
    &quot;content-type&quot;: &quot;application/json&quot;
  &#125;,
  payload: JSON.stringify(&#123; model: MODEL, max_tokens: 4096, system, messages &#125;),
  muteHttpExceptions: true
&#125;)</code></pre></div><p class="paragraph" style="text-align:left;"><code>muteHttpExceptions: true</code> is important — without it, Apps Script throws on any non-200 status code, and you lose the response body, which you need to log the actual error.</p><h3 class="heading" style="text-align:left;" id="the-prompt-structure">The prompt structure</h3><p class="paragraph" style="text-align:left;">The user message is explicit about the exact JSON schema Claude needs to return. This matters more than you&#39;d think — without specifying field names in the user message, Claude invents its own schema and the whole thing falls apart silently:</p><div class="codeblock"><pre><code>`Return a JSON array — one object per title — using EXACTLY these field names:
- &quot;original&quot;: the exact input string, unchanged
- &quot;normalized&quot;: cleaned, properly-cased title
- &quot;bucket&quot;: one of: C-Suite, VP, Director, Manager, IC, Unknown

No other fields. No markdown. No code fences. Raw JSON only.`</code></pre></div><p class="paragraph" style="text-align:left;">The code strips markdown fences defensively anyway, but the explicit instruction in the prompt is what keeps this from being a recurring issue.</p><h3 class="heading" style="text-align:left;" id="retry-logic">Retry logic</h3><p class="paragraph" style="text-align:left;">Apps Script uses <code>Utilities.sleep()</code> instead of <code>setTimeout()</code>. The retry wrapper handles 429 (rate limit), 500, 502, 503, 504, and 529 (Anthropic overload) with exponential backoff starting at 1 second.</p><h3 class="heading" style="text-align:left;" id="the-feedback-loop-updating-rules-fr">The Feedback Loop: Updating Rules from Corrections</h3><p class="paragraph" style="text-align:left;">This is the part that surprised me when I thought through the design. When Claude can&#39;t classify a title, it writes &quot;Unknown&quot; and highlights the cell yellow. That yellow highlight is a flag — not just a visual reminder, but a functional marker the script reads.</p><p class="paragraph" style="text-align:left;">When you run <b>Update Rules from Corrections</b>, the script scans for cells that are still yellow but whose value is no longer &quot;Unknown&quot; — meaning you&#39;ve manually corrected them. It collects those <code>[title, correctedBucket]</code> pairs, sends them to Claude along with the current ruleset, and asks Claude to update the rules to handle similar titles going forward. The updated ruleset overwrites the Rules tab. Yellow highlights are cleared.</p><p class="paragraph" style="text-align:left;">The result: every correction you make feeds back into the system. The ruleset gets better with use, without you having to manually write new edge case rules every time.</p><h2 class="heading" style="text-align:left;" id="common-issues-and-edge-cases">Common Issues and Edge Cases</h2><p class="paragraph" style="text-align:left;"><b>JSON schema discipline.</b> The user message must specify the exact field names Claude should return. Without <code>&quot;original&quot;</code>, <code>&quot;normalized&quot;</code>, and <code>&quot;bucket&quot;</code> spelled out explicitly, Claude will return plausible-looking JSON with completely different keys — <code>&quot;title&quot;</code>, <code>&quot;level&quot;</code>, <code>&quot;department&quot;</code> — and everything silently comes back as Unknown because the field access returns undefined.</p><p class="paragraph" style="text-align:left;"><b>Apps Script time limit.</b> Google enforces a 6-minute execution limit per run. For large sheets (thousands of rows), you may need to run in batches — add data in chunks and rerun after each batch. The idempotency check means previously processed rows are always skipped.</p><p class="paragraph" style="text-align:left;"><code>muteHttpExceptions: true</code> If you leave this out, a 429 from the Claude API throws a generic Apps Script exception, and you lose the response body. You want to handle rate limits yourself, not let Apps Script handle them.</p><p class="paragraph" style="text-align:left;"><b>Rules tab as a single source of truth.</b> The entire ruleset resides in cell A1 on the Rules tab as a single text block. If you accidentally delete that tab or clear A1, the default rules are re-seeded on the next run. But any customizations you&#39;ve made — including corrections applied by the feedback loop — are gone. Worth treating that tab with care.</p><p class="paragraph" style="text-align:left;"><b>What Claude gets wrong.</b> Startup titles with invented seniority (&quot;Head of Vibes&quot;), dual-role entries (&quot;VP of Marketing & Sales Enablement&quot;), and made-up C-suite variants (&quot;Chief Happiness Officer&quot;) are where the model is most likely to be inconsistent. The fix is the same every time: let the yellow highlight prompt you to correct it, then run Update Rules from Corrections. Don&#39;t fight the model — train the ruleset.</p><p class="paragraph" style="text-align:left;">I built this a few years too late for the job where I needed it most. But the next time someone asks me how many directors are on the list, I can answer in two minutes instead of two hours — and I can back it up.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=65443330-6ab5-4b0c-870a-d768a2d7fea5&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Log Workouts to Google Sheets Using Apple Shortcuts and Apps Script</title>
  <description>Skip the subscription fee. This is how I built a free workout tracker using Apple Shortcuts, Google Apps Script, and Google Sheets — with a POST request, no third-party app required.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/1078dc9a-fca0-40bc-ab8b-ab586f103581/How-to-Log-Workouts-to-Google-Sheets-Using-Apple-Shortcuts-and-Apps-Script.png" length="1190185" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-log-workouts-to-google-sheets-using-apple-shortcuts-and-apps-script</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-log-workouts-to-google-sheets-using-apple-shortcuts-and-apps-script</guid>
  <pubDate>Mon, 09 Mar 2026 21:47:29 +0000</pubDate>
  <atom:published>2026-03-09T21:47:29Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Automation]]></category>
    <category><![CDATA[Apple Shortcuts]]></category>
    <category><![CDATA[Google Sheets]]></category>
    <category><![CDATA[Lifestyle]]></category>
    <category><![CDATA[Google Apps Script]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">I don’t care for workout apps. They charge you a bunch of money to log your sets and tell you which exercises to do. That’s just a database with a subscription fee on top. Instagram Reels and TikTok give me enough gym content for exercise ideas, so what do I need an app for?</p><p class="paragraph" style="text-align:left;">I hate paying for things that make logging something to a database, or God forbid, a Google Sheet, their main attraction. So I canceled the subscription and built my own.</p><p class="paragraph" style="text-align:left;">An Apple Shortcut prompts me for the exercise, weight, and reps. It sends a POST request to a Google Apps Script web app that writes a row to a Google Sheet. Now I own the data and can connect it to Claude Code for insights later.</p><p class="paragraph" style="text-align:left;">This also means that I can share my Shortcut with my training partner, and we can both log to the same spreadsheet. No extra subscription required.</p><h2 class="heading" style="text-align:left;" id="what-youll-need">What You&#39;ll Need</h2><ol start="1"><li><p class="paragraph" style="text-align:left;">Apple Shortcuts to capture exercise data and fire the POST request.</p></li><li><p class="paragraph" style="text-align:left;">Google Apps Script to receive the data and write it to our sheet</p></li><li><p class="paragraph" style="text-align:left;">Google Sheets is free, and I can do whatever I want with the data.</p></li></ol><p class="paragraph" style="text-align:left;"><i>Note: Apple Shortcuts is iOS- and macOS-only. Android users could replicate this with Tasker or a Scriptable widget — the Google Apps Script web app side stays exactly the same.</i></p><h2 class="heading" style="text-align:left;" id="setting-up-the-google-sheet"><b>Setting Up the Google Sheet</b></h2><p class="paragraph" style="text-align:left;">Create a new Google Sheet and name the first tab exactly Workout Log. Your columns should be: Date, Person, Exercise, Set 1, Set 2, Set 3, Set 4. Row 1 is your header, and data starts at row 2.</p><h2 class="heading" style="text-align:left;" id="building-the-apple-shortcut"><b>Building the Apple Shortcut</b></h2><p class="paragraph" style="text-align:left;">The Shortcut does two things: it asks for input, then POSTs it to a URL.</p><p class="paragraph" style="text-align:left;">Three prompts (exercise, weight, reps) are saved to a variable. Use the “Get Contents of URL” to make a POST request to your Google App Script with those variables mapped to JSON. The last step is to notify of whatever the Apps Script returns.</p><div class="image"><img alt="Apple Shortcut workflow showing three text input prompts for exercise, weight, and reps, connected to a Get Contents of URL POST request step targeting a Google Apps Script web app URL" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/d888d834-cf56-4433-92a5-c8ff4e3a4004/Automation-Almanac-Shortcut-Workout-App.png?t=1773089720"/></div><p class="paragraph" style="text-align:left;">The phone number is hardcoded in the shortcut as <code>phone</code> That&#39;s how the script knows who&#39;s logging. Share the shortcut with whoever you want, just make sure they change their phone number in the shortcut.</p><p class="paragraph" style="text-align:left;"><i>Important: Build this on your Mac, not your phone. Shortcuts on iOS is a nightmare to work with. Once it&#39;s built, it syncs to your phone automatically.</i></p><h2 class="heading" style="text-align:left;" id="writing-the-google-apps-script"><b>Writing the Google Apps Script</b></h2><p class="paragraph" style="text-align:left;">This is what connects the Shortcut to your sheet. Deploy it as a web app, and it gives you a URL — that URL goes into the Shortcut.</p><p class="paragraph" style="text-align:left;">The script parses the incoming JSON, determines who&#39;s logging based on the phone number, then finds the appropriate row to write to. It does three checks: does this exercise already exist for today, for this person? If yes, which set are they on? If no, create a new row.</p><p class="paragraph" style="text-align:left;">A few things worth knowing before you set this up:</p><ul><li><p class="paragraph" style="text-align:left;">Your sheet must be named exactly <code>Workout Log</code>. If the name doesn&#39;t match, the script fails silently. You&#39;ll spend 20 minutes wondering why nothing is logging.</p></li><li><p class="paragraph" style="text-align:left;">You&#39;re capped at 4 sets per exercise. If you regularly do more, that&#39;s a one-line fix in the gist.</p></li><li><p class="paragraph" style="text-align:left;"><code>PERSON_1_NAME</code> is the default fallback. Any POST from an unrecognized phone number gets logged under your name.</p></li></ul><p class="paragraph" style="text-align:left;">Once the set is written, the script sends back a confirmation with the exercise name, weight, reps, and set number. The Shortcut notification displays that on your lock screen after every logged set. I threw in a &quot;goooood job&quot; message too, because apparently I need the encouragement.</p><h2 class="heading" style="text-align:left;" id="deploying-the-apps-script-as-a-web-"><b>Deploying the Apps Script as a Web App</b></h2><p class="paragraph" style="text-align:left;">In Apps Script, go to Deploy → New Deployment. Set it to Web App, execute as yourself, and set access to &quot;Anyone.&quot; That last part is what lets the Shortcut POST to it without authentication. Don&#39;t let &#39;Anyone&#39; access spook you — the web app URL contains a long random token. It&#39;s not publicly indexed or guessable; only someone with the exact URL can post to it.</p><p class="paragraph" style="text-align:left;">Copy the web app URL and paste it into the &quot;Get Contents of URL&quot; step in your Shortcut.</p><p class="paragraph" style="text-align:left;">The whole thing took an hour to build and costs nothing to run. My training partner and I have been logging every session to the same sheet for weeks. When I&#39;m ready to actually analyze the data, it&#39;s sitting there waiting — clean, structured, and not locked inside some app&#39;s export flow.</p><p class="paragraph" style="text-align:left;">If you want the script or the full shortcut, subscribe to the newsletter.</p><p class="paragraph" style="text-align:left;">Gist: <a class="link" href="https://gist.github.com/kostimarko/b97beb426b4bb0b9da778e3f091bae1d?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-log-workouts-to-google-sheets-using-apple-shortcuts-and-apps-script" target="_blank" rel="noopener noreferrer nofollow">https://gist.github.com/kostimarko/b97beb426b4bb0b9da778e3f091bae1d</a></p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=f4fcf59c-0aec-4bd5-aa90-40c9f258091c&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Build a Puppeteer Scraper for Authenticated Sites (With Batch CSV and InDesign Output)</title>
  <description>Puppeteer scraper tutorial: handle login, cookie banners, and batch CSV export across 6,000 pages.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/f62479a7-8bdc-4171-a5f5-da549109b6ae/Building-an-Image-Catalog-When-Fixing-the-Website-Takes-Too-Long.png" length="834474" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-build-a-puppeteer-scraper-for-authenticated-sites-with-batch-csv-and-indesign-output</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-build-a-puppeteer-scraper-for-authenticated-sites-with-batch-csv-and-indesign-output</guid>
  <pubDate>Mon, 02 Mar 2026 06:00:00 +0000</pubDate>
  <atom:published>2026-03-02T06:00:00Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Node Js]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">A previous client loved the automation I&#39;d built <a class="link" href="https://automation-almanac.beehiiv.com/p/how-to-batch-export-hundreds-of-illustrator-files-to-svg?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-puppeteer-scraper-for-authenticated-sites-with-batch-csv-and-indesign-output" target="_blank" rel="noopener noreferrer nofollow">to export all their SVG icons</a> and asked me to help build an image catalog for their sales team. The company had a web portal where all 6,000 images lived. Each image had its own title, category, and description. But there was no search functionality, no category browsing, and no index. Salespeople clicked through pages at random, hoping to stumble across the right image. One sales director told me his team was spending 2–3 hours per pitch deck hunting for images.</p><p class="paragraph" style="text-align:left;">They wanted a PDF catalog organized by category—people, restaurants, lifestyle, etc.—with titles, thumbnails, and download links. Something sales could actually search.<i> Why not just fix the website? Getting a giant company to fix its website takes months. I could build the catalog in a weekend.</i> </p><h2 class="heading" style="text-align:left;" id="the-scraping-strategy-working-from-">The Scraping Strategy: Working from Image IDs</h2><p class="paragraph" style="text-align:left;">Each image had a detail page following the URL pattern: <code>/images/[IMAGE_ID].jpg</code>. The images had auto-generated names like <code>fhdyskein87.jpg</code>. With a list of all image IDs, I could scrape each detail page for its metadata. They sent a hard drive with all the image files (for the PDF thumbnails) and a CSV listing every image ID. The metadata only existed on the website, so I still needed to scrape.</p><p class="paragraph" style="text-align:left;">Shoutout to the development team at this monolith of a company for making it easy for me to scrape the data. It took a few attempts to get the scraper working. The site required users to accept a cookie and log in. <a class="link" href="https://pptr.dev/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-puppeteer-scraper-for-authenticated-sites-with-batch-csv-and-indesign-output" target="_blank" rel="noopener noreferrer nofollow">Puppeteer</a> was perfect for this. Running Puppeteer with headless set to false lets me feel like Hackerman.</p><div class="image"><img alt="" class="image__image" style="" src="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/8e0f476e-3cf7-4a14-a69f-05202b8439bc/giphy.gif?t=1771973436"/></div><h3 class="heading" style="text-align:left;" id="setting-up-puppeteer-for-an-authent">Setting Up Puppeteer for an Authenticated Site</h3><p class="paragraph" style="text-align:left;">Scraping a website that requires login with Puppeteer means you need to automate the full browser session — navigate to the login page, fill in credentials, submit the form, and confirm you&#39;re authenticated before touching any content pages. For each image ID, Puppeteer navigates to its detail page, waits for the page to load, then Cheerio parses the HTML to extract the title, category, and description. (Puppeteer handles the browser navigation; Cheerio parses the static HTML snapshot — each tool does what it&#39;s best at.) Save to CSV. Wait 2 seconds, then move to the next ID. Repeat that 6,000 times.</p><h3 class="heading" style="text-align:left;" id="gotcha-1-handling-cookie-banners-be"><b>Gotcha #1: Handling Cookie Banners Before Login</b> </h3><p class="paragraph" style="text-align:left;">The login kept failing. This wasn’t my first go-round with Puppeteer, and entering username and password fields is preeeeeeeeeeetty easy. The cookie banner had to be clicked before anything else would load. When I&#39;d tested manually, I&#39;d clicked it without thinking. The sequence that actually worked:</p><ol start="1"><li><p class="paragraph" style="text-align:left;">Navigate to the site homepage.</p></li><li><p class="paragraph" style="text-align:left;">Wait for the cookie consent banner to appear.</p></li><li><p class="paragraph" style="text-align:left;">Click the &quot;Accept&quot; button to dismiss the banner.</p></li><li><p class="paragraph" style="text-align:left;">Navigate to the login page.</p></li><li><p class="paragraph" style="text-align:left;">Fill in credentials and submit.</p></li></ol><div class="codeblock"><pre><code>  await page.click(&#39;#cookie-banner-accept&#39;);  // accept cookie banner first
  await page.waitForSelector(&#39;#login-form&#39;);
  await page.type(&#39;#username&#39;, process.env.PORTAL_USERNAME);
  await page.type(&#39;#password&#39;, process.env.PORTAL_PASSWORD);
  await page.click(&#39;#login-submit&#39;);
  await page.waitForNavigation();</code></pre></div><h3 class="heading" style="text-align:left;" id="gotcha-2-dealing-with-inconsistent-"><b>Gotcha #2: Dealing with Inconsistent CSS Selectors</b></h3><p class="paragraph" style="text-align:left;">The CSS selectors were a mess. Some pages stored categories in data attributes (<code>data-category=&quot;people&quot;</code>), others in nested divs. Not every page had the same fields—some had descriptions, others didn&#39;t. The conditional logic looked like: check if <code>data-category</code> exists → use that. Otherwise, look for <code>div.category</code> → extract text. If neither exists, mark as &quot;Uncategorized.&quot;</p><h3 class="heading" style="text-align:left;" id="batch-processing-saving-to-csv-in-g">Batch Processing: Saving to CSV in Groups of 100</h3><p class="paragraph" style="text-align:left;">The 2-second delay kept me under the radar—rate limits would alert the webmaster. We use a 2-second delay between requests to avoid triggering rate limits, which adds up to roughly 3.5 hours for 6,000 pages but keeps the traffic pattern looking like a slow human rather than a bot. Batching in sets of 100 saved memory and meant a crash at image 3,500 wouldn&#39;t lose everything. I tested the scraper on 20 images first to verify the selectors were right—easier than debugging after a 6-hour run. Once that worked, I let it run overnight for the full 6,000. The scraper took about 3 hours to write and debug. Running it took 3.5 hours—6,000 pages at 2 seconds each, plus overhead for authentication and error handling.</p><div class="codeblock"><pre><code> for (const imageId of batch) &#123;
    await scrapePage(imageId);
    await page.waitForTimeout(2000); // stay under rate limits
  &#125;</code></pre></div><p class="paragraph" style="text-align:left;"><a class="link" href="https://www.automation-almanac.com/p/how-to-automate-mailchimp-daily-reports-with-firebase?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-puppeteer-scraper-for-authenticated-sites-with-batch-csv-and-indesign-output" target="_blank" rel="noopener noreferrer nofollow">I&#39;ve used the same CSV-as-output pattern before</a> — for the Mailchimp subscriber reporter, where the CSV becomes a list of new readers.</p><h3 class="heading" style="text-align:left;" id="sorting-the-data-for-in-design-data">Sorting the Data for InDesign Data Merge</h3><p class="paragraph" style="text-align:left;">I combined the batch CSVs in Google Sheets and sorted everything by category. <a class="link" href="https://helpx.adobe.com/indesign/using/data-merge.html?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-puppeteer-scraper-for-authenticated-sites-with-batch-csv-and-indesign-output" target="_blank" rel="noopener noreferrer nofollow">InDesign&#39;s data merge</a> populates PDFs in CSV order, so sorting meant the final PDF would have all &quot;People&quot; images grouped together, all &quot;Restaurants&quot; together, etc. Without sorting, it would be 400 pages of random images—a salesperson looking for restaurant photos would have to scan the entire PDF.</p><h3 class="heading" style="text-align:left;" id="making-images-clickable-in-in-desig">Making Images Clickable in InDesign</h3><ol start="1"><li><p class="paragraph" style="text-align:left;">Sort your CSV by category in Google Sheets</p></li><li><p class="paragraph" style="text-align:left;">Open InDesign and set up your data merge template</p></li><li><p class="paragraph" style="text-align:left;">Map the CSV columns to text and image fields</p></li><li><p class="paragraph" style="text-align:left;">Add an invisible box over each image placeholder, linked to the download URL field  </p></li><li><p class="paragraph" style="text-align:left;">Run the data merge — InDesign generates one page per row</p></li></ol><p class="paragraph" style="text-align:left;">InDesign&#39;s data merge is straightforward for text, but adding image thumbnails and clickable links gets messy. I tested layouts to fit as many images as possible on each page. InDesign won&#39;t let you make images clickable directly. The workaround: add an invisible box over each image in the template and link it to the download URL field. When InDesign runs the data merge, it automatically populates 6,000 linked boxes.</p><p class="paragraph" style="text-align:left;">After generating the catalog came the grunt work. Creating section breaks, adding page navigation, and compressing the PDF. I sent the file off, went for a coffee, and got on with my day. </p><h2 class="heading" style="text-align:left;" id="results-from-30-minute-search-to-30">Results: From 30-Minute Search to 30 Seconds</h2><p class="paragraph" style="text-align:left;">The sales team got a 400-page PDF they could search with CMD+F. What used to take 30 minutes of random clicking now took 30 seconds. In the first week, I received thank-you emails from five different salespeople. One guy said he&#39;d been searching for a specific restaurant photo for three days and found it in 10 seconds with the PDF.</p><h2 class="heading" style="text-align:left;" id="want-the-scraper-code">Want the Scraper Code?</h2><p class="paragraph" style="text-align:left;">The scraper is configurable—swap in your selectors, adjust the batch size, and you&#39;re good to go. The repo includes the Puppeteer scraper, CSV batch processor, and configuration examples.</p><p class="paragraph" style="text-align:left;">Github Code: <a class="link" href="https://github.com/kostimarko/Scraper-Image-Library?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-puppeteer-scraper-for-authenticated-sites-with-batch-csv-and-indesign-output" target="_blank" rel="noopener noreferrer nofollow">https://github.com/kostimarko/Scraper-Image-Library</a></p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=85b082e2-0677-4792-bf2d-276ebae7ae83&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Automate Omeda Email Reports to Slack with Firebase</title>
  <description>Build a Firebase scheduled function that pulls Omeda deployment data and posts open rates and click rates to Slack daily.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/ce8db60a-e26a-4f38-b5ce-9260c02d8211/How-to-Automate-Omeda-Newsletter-Reports-to-Slack.png" length="1648492" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-automate-omeda-email-reports-to-slack-with-firebase</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-automate-omeda-email-reports-to-slack-with-firebase</guid>
  <pubDate>Fri, 02 Jan 2026 18:01:03 +0000</pubDate>
  <atom:published>2026-01-02T18:01:03Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Slack]]></category>
    <category><![CDATA[Firebase]]></category>
    <category><![CDATA[Omeda]]></category>
    <category><![CDATA[Node Js]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">I&#39;ve done this before with<a class="link" href="https://automation-almanac.beehiiv.com/p/automated-mailchimp-reporting-that-doesnt-suck?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-omeda-email-reports-to-slack-with-firebase" target="_blank" rel="noopener noreferrer nofollow"> Mailchimp—automated daily newsletter reports</a> that give everyone transparency on how emails performed. But Omeda is a different animal. Omeda is an audience management and email deployment platform used by B2B media companies, and its reporting interface isn&#39;t excellent. Manually looking up newsletter performance meant logging in, finding each deployment, and pulling stats one by one. With multiple newsletters going out daily, that&#39;s a lot of clicking around.</p><p class="paragraph" style="text-align:left;">So I built a bot that does it automatically. Every day at 5 pm, it hits Omeda&#39;s API, grabs all the deployments that went out, and posts a formatted report to our Slack channel. Now the entire company can see exactly how our newsletters performed—open rates, click rates, unsubscribes, the whole picture.</p><p class="paragraph" style="text-align:left;">Here&#39;s what we&#39;ll be using to build this:</p><ol start="1"><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://firebase.google.com/docs/functions?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-omeda-email-reports-to-slack-with-firebase" target="_blank" rel="noopener noreferrer nofollow">Firebase Functions</a>, to run our scheduled job and handle the automation</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://developer.omeda.com/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-omeda-email-reports-to-slack-with-firebase" target="_blank" rel="noopener noreferrer nofollow">Omeda API</a>, to get deployment data</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://slack.dev/node-slack-sdk/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-omeda-email-reports-to-slack-with-firebase" target="_blank" rel="noopener noreferrer nofollow">Slack Web API</a>, to post formatted messages to our channel</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://momentjs.com/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-omeda-email-reports-to-slack-with-firebase" target="_blank" rel="noopener noreferrer nofollow">Moment.js</a> and <a class="link" href="https://momentjs.com/timezone/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-omeda-email-reports-to-slack-with-firebase" target="_blank" rel="noopener noreferrer nofollow">moment-timezone</a>, because timezones suck</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://github.com/axios/axios?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-omeda-email-reports-to-slack-with-firebase" target="_blank" rel="noopener noreferrer nofollow">Axios</a>, to make our HTTP requests</p></li></ol><h2 class="heading" style="text-align:left;" id="setting-up-omeda-api-credentials-sl">Setting Up Omeda API Credentials, Slack, and Firebase</h2><h3 class="heading" style="text-align:left;" id="omeda-api-credentials">Omeda API Credentials</h3><p class="paragraph" style="text-align:left;">First, you&#39;ll need to get your Omeda API key. You have to submit a support ticket to Omeda, wait for their response, and they&#39;ll eventually provide you with an API key. There&#39;s no self-service portal. Plan accordingly.</p><p class="paragraph" style="text-align:left;">Once you have your key, you’ll also need the URL. Store both of these as environment variables; never hardcode API keys. We’re not trying to get hacked.</p><p class="paragraph" style="text-align:left;">One thing Omeda&#39;s documentation won&#39;t tell you upfront: the authentication header is named <code>x-omeda-appid</code>. Here&#39;s the request header configuration you need for every Omeda API call:</p><div class="codeblock"><pre><code>const headers = &#123;
  &quot;x-omeda-appid&quot;: process.env.OMEDA_API_KEY,
  &quot;Content-Type&quot;: &quot;application/json&quot;
&#125;;
</code></pre></div><p class="paragraph" style="text-align:left;">That header name is not in their getting-started guide. I wasted hours on 401 authentication errors before I figured it out. You&#39;re welcome.</p><h3 class="heading" style="text-align:left;" id="slack-bot-configuration">Slack Bot Configuration</h3><p class="paragraph" style="text-align:left;">For Slack, you’ll need to create a Slack App with <code>chat:write</code> permissions and install it in your workspace. Get your bot token from the OAuth section. You’ll also need your channel ID where you want these reports posted.</p><h3 class="heading" style="text-align:left;" id="firebase-setup">Firebase Setup</h3><p class="paragraph" style="text-align:left;">If you haven&#39;t set up Firebase Functions yet, you&#39;ll need to initialize a project and install the dependencies. We&#39;re using Firebase&#39;s v2 scheduler functions because they give us better control over timing and error handling. If you want a gentler introduction to Firebase scheduled functions, I first explored this pattern <a class="link" href="https://automation-almanac.beehiiv.com/p/how-an-automated-email-saved-me-from-getting-parking-tickets?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-omeda-email-reports-to-slack-with-firebase" target="_blank" rel="noopener noreferrer nofollow">in a simpler automation that sends a scheduled email</a> — useful background if you&#39;re new to the pubsub scheduling pattern.</p><h3 class="heading" style="text-align:left;" id="the-core-firebase-scheduled-functio">The Core Firebase Scheduled Function</h3><p class="paragraph" style="text-align:left;">The primary function is a scheduled job that runs every weekday at 5 pm Central. It&#39;s simple in concept: get today&#39;s date, search for emails sent today, pull their deployment data, format it for Slack, and post it.</p><p class="paragraph" style="text-align:left;">I used Firebase&#39;s <code>onSchedule</code> instead of the older pubsub functions, because the error handling is better and the syntax is cleaner. The schedule runs Monday through Friday only—no point checking on weekends when newsletters don&#39;t go out.</p><h3 class="heading" style="text-align:left;" id="searching-for-deployments">Searching for Deployments</h3><p class="paragraph" style="text-align:left;">The first real piece is searching Omeda for deployments sent today. We&#39;re posting to Omeda&#39;s search endpoint with parameters for today&#39;s date and filtering to newsletters that have already been sent. The API returns an array of deployment objects, each with a URL field pointing to the complete deployment data.</p><p class="paragraph" style="text-align:left;">Here&#39;s where Omeda&#39;s documentation gets frustrating. The endpoint structure is clear enough, but there are zero JavaScript examples. You have to figure out the header format yourself. That <code>x-omeda-appid</code> header? Not mentioned in their getting started guide. I wasted hours on authentication errors before I figured out the exact header name they expect.</p><p class="paragraph" style="text-align:left;">The search parameters let you filter by deployment designation (we only want <code>Newsletter</code> types), status (we only want <code>SENT_OR_SENDING</code>), and date range. I set the number of results to 100 to make sure we catch everything, even on busy days.</p><h3 class="heading" style="text-align:left;" id="getting-deployment-stats">Getting Deployment Stats</h3><p class="paragraph" style="text-align:left;">Once we have the URLs for today&#39;s deployments, we need to hit each one to get the actual stats. This is where things get interesting. I deliberately used a sequential loop instead of firing off all the requests at once with <code>Promise.all()</code>. Omeda&#39;s docs don&#39;t specify rate limits, and I didn&#39;t want to risk getting throttled or banned.</p><p class="paragraph" style="text-align:left;">For each deployment, we pull the recipient count, unique opens, unique clicks, and unsubscribes. Then we calculate the rates: open rate (unique opens/recipients), click rate (unique clicks / unique opens), and unsubscribe rate (unsubscribes/recipients).</p><p class="paragraph" style="text-align:left;">The subject line and sender name are buried in something called the <code>Splits</code> array. This makes sense once you know it—Omeda supports A/B testing with split deployments—but it&#39;s not immediately apparent from the API response structure. The subject line you care about is in the first element of that array.</p><h3 class="heading" style="text-align:left;" id="formatting-for-slack">Formatting for Slack</h3><p class="paragraph" style="text-align:left;">Slack&#39;s Block Kit API is how we make the messages look good. Each newsletter gets its own section with all relevant stats formatted for easy reading. The blocks include a header with today&#39;s date, followed by a section for each newsletter with the subject line, sender, send date, and all performance metrics.</p><div class="codeblock"><pre><code> &#123;
    type: &quot;section&quot;,
    text: &#123;
      type: &quot;mrkdwn&quot;,
      text: `*$&#123;subjectLine&#125;*\n*Sender:* $&#123;senderName&#125;\n*Opens:* $&#123;openRate&#125;%  |  *Clicks:* $&#123;clickRate&#125;%  |  *Unsubs:* $&#123;unsubRate&#125;%`,
    &#125;,
  &#125;</code></pre></div><p class="paragraph" style="text-align:left;">The formatting makes it easy to scan and compare performance across different newsletters. We typically send 2-4 newsletters per day, so having them all in one message with consistent formatting is crucial.</p><p class="paragraph" style="text-align:left;">I added validation at every step because Omeda&#39;s API doesn&#39;t always return data in the expected format. We check whether deployments are present in the search response, validate that each deployment has the required data structure, and log warnings when anything looks off. The function continues even if one deployment fails to parse—better to post a partial report than no report at all.</p><h2 class="heading" style="text-align:left;" id="gotchas-what-omedas-api-docs-dont-t">Gotchas: What Omeda&#39;s API Docs Don&#39;t Tell You</h2><p class="paragraph" style="text-align:left;"><b>Omeda&#39;s Documentation</b>: The documentation is clear about what endpoints exist and what parameters they accept. But there are zero JavaScript examples. None. You have to figure out the header format yourself. If you&#39;re working with Omeda&#39;s API, expect to do some trial and error.</p><p class="paragraph" style="text-align:left;"><b>The Splits Array</b>: The subject line and sender name are buried in the first element of the <code>Splits</code> array. This makes sense once you know it (Omeda supports A/B testing with split deployments), but it&#39;s not immediately apparent from the API response structure.</p><p class="paragraph" style="text-align:left;"><b>Rate Limiting</b>: I went with sequential requests rather than concurrent to avoid potential rate-limiting issues. Omeda&#39;s docs don&#39;t specify rate limits, so better safe than sorry.</p><p class="paragraph" style="text-align:left;"><b>Date Formatting</b>: Omeda expects dates in a specific format, and their timezone handling isn&#39;t excellent. Using moment-timezone to handle all date formatting saved me from a bunch of off-by-one-day bugs.</p><h2 class="heading" style="text-align:left;" id="conclusion">Conclusion</h2><p class="paragraph" style="text-align:left;">Now, our entire company receives a Slack message every day at 5 pm with complete transparency into how our newsletters performed. We typically send 2-4 newsletters per day, and everyone can see the open rates, click rates, and engagement without logging into Omeda&#39;s interface.</p><p class="paragraph" style="text-align:left;">The team didn&#39;t know they needed this until they had it. Now they check it every day.</p><h2 class="heading" style="text-align:left;" id="want-the-complete-code">Want the complete code?</h2><p class="paragraph" style="text-align:left;">This post covered the approach and architecture, but the actual implementation has a bunch of nuances—error handling, data validation, Slack formatting, and all the API quirks I figured out the hard way.</p><p class="paragraph" style="text-align:left;">Sign up for the Automation Almanac newsletter and get the complete working code sent to your inbox. You&#39;ll get the full Firebase function, all the utility modules, and the exact Slack Block Kit formatting that makes these reports look great.</p><p class="paragraph" style="text-align:left;">Github Repo: <a class="link" href="https://github.com/kostimarko/omeda-newsletter-reporter?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-omeda-email-reports-to-slack-with-firebase" target="_blank" rel="noopener noreferrer nofollow">https://github.com/kostimarko/omeda-newsletter-reporter</a></p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=b436c769-0c4b-47fb-99d2-18afcce18742&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Automate Mailchimp Daily Reports with Firebase</title>
  <description>Build a Firebase function that emails your team a daily Mailchimp report — open rate, click rate, new subscribers, and a CSV export.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/fa40b4d9-4e39-4da2-a2f1-833e5cadde07/How-to-Automate-Mailchimp-Daily-Reports-with-Firebase.png" length="1381941" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-automate-mailchimp-daily-reports-with-firebase</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-automate-mailchimp-daily-reports-with-firebase</guid>
  <pubDate>Tue, 16 Dec 2025 06:00:00 +0000</pubDate>
  <atom:published>2025-12-16T06:00:00Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Mailchimp]]></category>
    <category><![CDATA[Firebase]]></category>
    <category><![CDATA[Node Js]]></category>
    <category><![CDATA[Nodemailer]]></category>
    <category><![CDATA[Email Automation]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">A few years ago, my previous boss forwarded me an email that said:</p><p class="paragraph" style="text-align:left;">&quot;This daily audience email Mailchimp sends out sucks. Can you make it better?&quot;</p><p class="paragraph" style="text-align:left;">That question led me down a long and weird path of playing with the Mailchimp API and some Firebase functions to create a daily wrap-up email that examined each of our Mailchimp lists and their segments to track growth.</p><p class="paragraph" style="text-align:left;">We looked at a few daily KPIs:</p><ul><li><p class="paragraph" style="text-align:left;">New readers in 24 hours</p></li><li><p class="paragraph" style="text-align:left;">New unsubscribes in 24 hours</p></li><li><p class="paragraph" style="text-align:left;">Total Subscribers</p><ul><li><p class="paragraph" style="text-align:left;">Readers subscribed to the daily newsletter</p></li></ul></li><li><p class="paragraph" style="text-align:left;">The daily newsletter email</p><ul><li><p class="paragraph" style="text-align:left;">Open rate</p></li><li><p class="paragraph" style="text-align:left;">Click Rate</p></li><li><p class="paragraph" style="text-align:left;">Subject Line</p></li><li><p class="paragraph" style="text-align:left;">A link to the archived email</p></li></ul></li></ul><p class="paragraph" style="text-align:left;"><b>What this automation does:</b></p><ul><li><p class="paragraph" style="text-align:left;">Runs every weekday at 5 PM via Firebase scheduled function</p></li><li><p class="paragraph" style="text-align:left;">Pulls today&#39;s Mailchimp campaign stats (open rate, click rate, unsubscribes)</p></li><li><p class="paragraph" style="text-align:left;">Generates a CSV of new subscribers from the past 24 hours</p></li><li><p class="paragraph" style="text-align:left;">Emails a formatted report to your team automatically</p></li></ul><h2 class="heading" style="text-align:left;" id="setting-up-mailchimp-api-segments-a">Setting Up Mailchimp API Segments and Firebase</h2><h3 class="heading" style="text-align:left;" id="mailchimp-segments">Mailchimp Segments</h3><p class="paragraph" style="text-align:left;">The first part of the automation is setting up our reporting segments. Mailchimp&#39;s marketing API has access to Mailchimp&#39;s regular segmentation, so <b>your advanced segments will NOT be available to the API</b>. This is frustrating because advanced segments are usually more helpful, but we have to work with what&#39;s accessible.</p><p class="paragraph" style="text-align:left;">You&#39;ll need to create a few regular segments:</p><p class="paragraph" style="text-align:left;"><b>New Readers in 24 Hours</b> - This segment should include readers who joined in the last 24 hours and have an email marketing status of subscribed.</p><p class="paragraph" style="text-align:left;"><b>New Unsubscribes in 24 Hours</b> - This segment should include readers who are email marketing unsubscribed and have had information change in the 24 hours.</p><p class="paragraph" style="text-align:left;"><b>Daily Subscribers</b> - This segment should include readers who have a GDPR setting for daily subscribers (or whatever segmentation makes sense for your main newsletter list).</p><p class="paragraph" style="text-align:left;">We&#39;ll be using the node mailchimp package for ease of use. There are a few gotchas and hiccups with the npm package that I&#39;ll call out.</p><h3 class="heading" style="text-align:left;" id="firebase-functions">Firebase Functions</h3><p class="paragraph" style="text-align:left;">We&#39;ll use Firebase&#39;s PubSub functions to send this email whenever you want. The beauty of pubsub is you can set it to run on a schedule—weekdays at 5 pm works perfectly since newsletters go out in the morning and subscribers have had time to open and click by late afternoon.</p><div class="codeblock"><pre><code>exports.dailyMailchimpReport = functions.pubsub
    .schedule(&quot;0 17 * * 1-5&quot;) // 5 PM CT, Monday–Friday
    .timeZone(&quot;America/Chicago&quot;)
    .onRun(async (context) =&gt; &#123; ... &#125;);</code></pre></div><h2 class="heading" style="text-align:left;" id="building-the-firebase-scheduled-fun">Building the Firebase Scheduled Function</h2><p class="paragraph" style="text-align:left;">The primary function runs every weekday at 5 pm Central. Since we send emails early in the morning (5-7 am), users have enough time to open and click them before we pull the data. The function orchestrates everything: pulling campaign data, retrieving segment counts, parsing new subscribers into a CSV file, and sending the email.</p><h3 class="heading" style="text-align:left;" id="getting-campaign-data">Getting Campaign Data</h3><p class="paragraph" style="text-align:left;">The first significant piece is a function that pulls today&#39;s newsletter performance data from Mailchimp. It takes a list ID as a parameter, which makes it reusable across multiple lists if you&#39;re running more than one newsletter.</p><div class="codeblock"><pre><code> const response = await mailchimp.campaigns.list(&#123;
    count: 1,
    listId: LIST_ID,
    sinceSendTime: &quot;2025-12-16T05:00:00+00:00&quot;,
    beforeSendTime: &quot;2025-12-16T07:00:00+00:00&quot;,
  &#125;);</code></pre></div><p class="paragraph" style="text-align:left;">Here&#39;s where Mailchimp&#39;s documentation gets annoying. The parameter casing is wrong in their docs. The documentation shows snake_case (<code>before_send_time</code> and <code>since_send_time</code>), but the actual API expects camelCase (<code>beforeSendTime</code> and <code>sinceSendTime</code>). I spent a ton of time debugging authentication errors before I figured out the docs were just wrong.</p><div class="codeblock"><pre><code> //Wrong — matches the docs but doesn&#39;t work
  &#123; before_send_time: &quot;2025-12-16T07:00:00+00:00&quot;, since_send_time: &quot;2025-12-16T05:00:00+00:00&quot; &#125;

  //Correct — camelCase is what the node package actually expects
  &#123; beforeSendTime: &quot;2025-12-16T07:00:00+00:00&quot;, sinceSendTime: &quot;2025-12-16T05:00:00+00:00&quot; &#125;</code></pre></div><p class="paragraph" style="text-align:left;">We hardcode the send time window (5-7 am) since our newsletters always go out during that window. This lets us query for campaigns sent today and assume we&#39;ll get only one result. We pull the campaign ID from that response, then use it to get the whole campaign report and the archive URL.</p><p class="paragraph" style="text-align:left;">The function returns all the key metrics: unsubscribes, hard bounces, subject line, campaign title, open rate, click rate, and the archive URL so editors can click through to see which newsletter we&#39;re reporting on.</p><h3 class="heading" style="text-align:left;" id="pulling-segment-data">Pulling Segment Data</h3><p class="paragraph" style="text-align:left;">Next, we query each segment we created earlier to obtain counts. This is straightforward—Mailchimp&#39;s segment API returns a <code>member_count</code> field that tells us exactly how many people are in each segment.</p><p class="paragraph" style="text-align:left;">We also pull the complete list of new subscribers from the &quot;New Readers in 24 Hours&quot; segment. For each subscriber, we collect their email address, first name, last name, company, title, and UTM parameters (source and medium). This gives the editorial team context on where subscribers came from.</p><p class="paragraph" style="text-align:left;">The UTM data is beneficial—it shows which marketing channels are driving signups. If you&#39;re not tracking UTM parameters in Mailchimp, you should be.</p><h3 class="heading" style="text-align:left;" id="generating-the-csv">Generating the CSV</h3><p class="paragraph" style="text-align:left;">We loop through the new subscribers and build an array of objects with their contact info. Then we pass that array to a CSV parser. The parser converts the array into a proper CSV file that we can attach to the email.</p><p class="paragraph" style="text-align:left;">The CSV includes columns for email, first name, last name, company, title, UTM source, and UTM medium. This way, the editorial team can import it into a spreadsheet or CRM to reach out to specific subscribers.</p><h3 class="heading" style="text-align:left;" id="sending-the-email">Sending the Email</h3><p class="paragraph" style="text-align:left;">The final piece is using nodemailer to send an email to Gmail with all the data. We set up an SMTP transport with Gmail credentials (you&#39;ll need to enable &quot;less secure apps&quot; or use an app-specific password), then construct an email containing all the metrics in plain text.</p><p class="paragraph" style="text-align:left;">The email includes:</p><ul><li><p class="paragraph" style="text-align:left;">New subscribers count</p></li><li><p class="paragraph" style="text-align:left;">Unsubscribes count</p></li><li><p class="paragraph" style="text-align:left;">Total subscribers</p></li><li><p class="paragraph" style="text-align:left;">Daily newsletter subscribers</p></li><li><p class="paragraph" style="text-align:left;">Today&#39;s newsletter stats (subject line, open rate, click rate, with a link to the archived email)</p></li><li><p class="paragraph" style="text-align:left;">CSV attachment of new subscribers</p></li></ul><p class="paragraph" style="text-align:left;">We also wrap the entire send operation in error handling so the function doesn&#39;t crash if Gmail has issues.</p><h3 class="heading" style="text-align:left;" id="scaling-to-multiple-lists">Scaling to Multiple Lists</h3><p class="paragraph" style="text-align:left;">Since the campaign data function takes a list ID parameter, you can efficiently run this for multiple newsletters. Just call the function multiple times with different list IDs, then use <code>Promise.all()</code> at the end to make sure all the reporting functions are complete before the pubsub function exits. This is the same Mailchimp open rate report automation pattern whether you&#39;re tracking one list or ten.</p><p class="paragraph" style="text-align:left;">If you want to see how the same Firebase pubsub scheduling approach works for a different use case, I first built this pattern as a much simpler project — <a class="link" href="https://automation-almanac.beehiiv.com/p/how-automated-email-saved-me-from-getting-parking-tickets?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-mailchimp-daily-reports-with-firebase" target="_blank" rel="noopener noreferrer nofollow">an automated email that saved me from getting parking tickets</a> — which is a gentler introduction to the whole pattern before adding Mailchimp API complexity on top.</p><h2 class="heading" style="text-align:left;" id="mailchimp-api-gotchas-you-wont-find">Mailchimp API Gotchas You Won&#39;t Find in the Docs</h2><p class="paragraph" style="text-align:left;"><b>Mailchimp API Casing</b>: The documentation shows snake_case parameters, but the node package expects camelCase—this wasted hours of my life. Always check the actual npm package implementation, not just the API docs.</p><p class="paragraph" style="text-align:left;"><b>Advanced Segments</b>: You cannot access advanced segments via the API. Only regular segments work. If you need complex segmentation logic, build it as a regular segment, not an advanced one.</p><p class="paragraph" style="text-align:left;"><b>Gmail Authentication</b>: You&#39;ll encounter authentication issues with Nodemailer and Gmail. You have to allow &quot;less secure apps&quot; in your Google account settings, or better yet, generate an app-specific password. Never hardcode your Gmail password—use environment variables.</p><p class="paragraph" style="text-align:left;"><b>CSV Parsing</b>: Make sure your CSV parser handles empty fields gracefully. Not every subscriber will have a company or title filled in, and you don&#39;t want the parser to choke on missing data.</p><p class="paragraph" style="text-align:left;"><b>Timing</b>: We run this at 5 pm because newsletters go out in the morning. If you send newsletters at different times, adjust the schedule accordingly. You want to give subscribers enough time to open and click before pulling stats.</p><p class="paragraph" style="text-align:left;"><b>Mailchimp API Rate Limits</b>: The Mailchimp v3 API enforces a rate limit of 10 concurrent connections per account. For a single daily scheduled function, this will never be an issue, but if you scale to pulling stats across many lists in parallel, throttle your requests or use sequential calls rather than unbounded <code>Promise.all()</code>.</p><h2 class="heading" style="text-align:left;" id="conclusion">Conclusion</h2><p class="paragraph" style="text-align:left;">Deploy your code to Firebase and wait for the team to give you the congratulations you deserve. Our editorial team loved these emails so much that they looked forward to them every day. It also really helped that we provided a CSV of new subscribers, allowing the editorial team to review potential interviewees.</p><p class="paragraph" style="text-align:left;">The best part? Zero manual work. Every day at 5 pm, everyone on the team gets complete transparency on newsletter performance without logging into Mailchimp.</p><hr class="content_break"><h2 class="heading" style="text-align:left;" id="want-the-complete-code">Want the complete code?</h2><p class="paragraph" style="text-align:left;">This post covered the architecture and approach, but the actual implementation has nuance—handling edge cases in the Mailchimp API, proper CSV formatting, Gmail authentication setup, and all the parameter casing issues I figured out the hard way.</p><p class="paragraph" style="text-align:left;"><b>Sign up for the Automation Almanac newsletter</b> and get the complete working code sent to your inbox. You&#39;ll get the full Firebase function, segment queries, CSV parsing logic, and email formatting—everything you need to deploy this today.</p><p class="paragraph" style="text-align:left;">Github Repo: <a class="link" href="https://github.com/kostimarko/mailchimp-email-reporter?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-automate-mailchimp-daily-reports-with-firebase" target="_blank" rel="noopener noreferrer nofollow">https://github.com/kostimarko/mailchimp-email-reporter</a></p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=9e681db0-d896-4b93-97f1-4aafa140b6c2&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Batch Export Illustrator Layers to SVG with a Script</title>
  <description>Automatically export every Illustrator layer as an individual SVG file with JavaScript. Handles multiple .ai files in a single run. Full code walkthrough and GitHub link included.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/45fb12fa-7ea7-44a9-85dd-a854cfb3028f/How-to-Batch-Export-Hundreds-of-Illustrator-Files-to-SVG.png" length="1228562" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-batch-export-illustrator-layers-to-svg-with-a-script</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-batch-export-illustrator-layers-to-svg-with-a-script</guid>
  <pubDate>Tue, 02 Dec 2025 06:00:00 +0000</pubDate>
  <atom:published>2025-12-02T06:00:00Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Automation]]></category>
    <category><![CDATA[Illustrator]]></category>
    <category><![CDATA[Javascript]]></category>
    <category><![CDATA[Design Tools]]></category>
    <category><![CDATA[Svg]]></category>
    <category><![CDATA[Business]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;"><span style="color:#0d0d0d;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;font-size:16px;">If you’ve ever designed icons in multiple colors and had a developer tell you they look great, the development team needs them as SVGs. You might get off that Zoom call and ask yourself how long it will take to convert your Illustrator files to SVGs. You created over 100 icons with multiple color layers.</span></p><p class="paragraph" style="text-align:left;">If you hire an intern, you might get all those icons exported as SVGs in a few days, but that’s not worth an intern’s time. I wrote an Illustrator script that will do this for us over a coffee run.</p><p class="paragraph" style="text-align:left;"><b>Compatibility note:</b> This script works with Adobe Illustrator CC and later versions. If you&#39;re on an older version, you may hit syntax differences, but CC onward should be fine.</p><p class="paragraph" style="text-align:left;"><b>Layers vs. artboards:</b> This script exports each <b>layer</b> as a separate SVG file. If your icons are set up as artboards rather than layers, this isn&#39;t the script for you — Adobe has a separate built-in export path for artboards under File &gt; Export &gt; Export for Screens.</p><h2 class="heading" style="text-align:left;" id="what-youll-need">What You&#39;ll Need</h2><ul><li><p class="paragraph" style="text-align:left;">Adobe Illustrator CC (any recent version)</p></li><li><p class="paragraph" style="text-align:left;">A folder of <code>.ai</code> files where each color variant of an icon lives on its own named layer</p></li><li><p class="paragraph" style="text-align:left;">Basic comfort navigating to a folder on your machine — no coding required to run the script</p></li></ul><p class="paragraph" style="text-align:left;"><b>Important:</b><span style="color:#0d0d0d;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:16px;"> Ensure your file names conclude with an underscore (e.g., </span><code>name_of_icon_.ai</code><span style="color:#0d0d0d;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, &quot;Segoe UI&quot;, Roboto, Ubuntu, Cantarell, &quot;Noto Sans&quot;, sans-serif, &quot;Helvetica Neue&quot;, Arial, &quot;Apple Color Emoji&quot;, &quot;Segoe UI Emoji&quot;, &quot;Segoe UI Symbol&quot;, &quot;Noto Color Emoji&quot;;font-size:16px;">). The significance of this naming convention will be explained further on.</span></p><p class="paragraph" style="text-align:left;"><b>Quick Links:</b></p><ul><li><p class="paragraph" style="text-align:left;">GitHub Repository: <a class="link" href="https://github.com/kostimarko/Adobe-Scripts/blob/master/Illustrator/Layers_To_SVG.js?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-batch-export-illustrator-layers-to-svg-with-a-script" target="_blank" rel="noopener noreferrer nofollow">https://github.com/kostimarko/Adobe-Scripts/blob/master/Illustrator/Layers_To_SVG.js</a></p></li><li><p class="paragraph" style="text-align:left;">Adobe Illustrator Scripting Guide: <a class="link" href="https://ai-scripting.docsforadobe.dev/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-batch-export-illustrator-layers-to-svg-with-a-script" target="_blank" rel="noopener noreferrer nofollow">https://ai-scripting.docsforadobe.dev/</a></p></li></ul><h2 class="heading" style="text-align:left;" id="how-it-works-5-steps">How It Works (5 Steps)</h2><ol start="1"><li><p class="paragraph" style="text-align:left;">You point the script at a source folder containing your <code>.ai</code> files</p></li><li><p class="paragraph" style="text-align:left;">The script opens each file in Illustrator automatically</p></li><li><p class="paragraph" style="text-align:left;">All layers in the file are hidden at once</p></li><li><p class="paragraph" style="text-align:left;">Each layer is made visible one at a time and exported as its own SVG file</p></li><li><p class="paragraph" style="text-align:left;">The file closes without saving, and the script moves to the next <code>.ai</code> file in the folder</p></li></ol><p class="paragraph" style="text-align:left;">That&#39;s the whole loop. Now here&#39;s how each piece is built.</p><h2 class="heading" style="text-align:left;" id="shut-up-and-code">How the Batch SVG Export Script Works</h2><h3 class="heading" style="text-align:left;" id="declaring-variables-and-selecting-t">Declaring Variables and Selecting the Source Folder</h3><p class="paragraph" style="text-align:start;"><span style="color:#0d0d0d;font-family:Söhne, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif, Helvetica Neue, Arial, Apple Color Emoji, Segoe UI Emoji, Segoe UI Symbol, Noto Color Emoji;font-size:16px;">Firstly, declare global variables necessary for the script’s operations:</span></p><div class="codeblock"><pre><code>var destFolder, sourceFolder, files, fileType, sourceDoc, svgSaveOpts, doc, layers;</code></pre></div><p class="paragraph" style="text-align:start;">The following Illustrator script dialog allows the user to select the source folder containing the .ai files to export</p><div class="codeblock"><pre><code>sourceFolder = Folder.selectDialog( &#39;Select the folder with Illustrator files you want to convert to SVG&#39;, &#39;~&#39; );</code></pre></div><h3 class="heading" style="text-align:left;" id="iterating-through-illustrator-files">Iterating Through Illustrator Files</h3><p class="paragraph" style="text-align:left;">The <code>init()</code> houses the rest of the functions to launch after you’ve selected where your files live.</p><div class="codeblock"><pre><code>// Function that sets up the exporting process
function init()&#123;

	// Check to see if sourceFolder has any files in it
	if(sourceFolder != null)&#123;
		
		// Create new array for files to be stored
		files =  new Array();

		// Only use file types that are illustrator files
		fileType = &quot;*.ai&quot;;

		// Files get save with all of the files in the sourceFolder
		files = sourceFolder.getFiles(fileType);

		// Check to see if there are any files in the folder
		if(files.length &gt; 0)&#123;

			// Ask for a destination folder
			destFolder = Folder.selectDialog(&#39;Select the folder you want to export files to&#39;, &#39;~&#39;);

			// Loop through files
			for(var i = 0; i &lt; files.length; i++)&#123;

				// Save the open file and properties to sourceDoc
				sourceDoc = app.open(files[i])

				doc = app.activeDocument;

				hideAllLayers();
				exportLayers();
				sourceDoc.close(SaveOptions.DONOTSAVECHANGES);
			&#125;
		&#125; else &#123;
			alert(&#39;There is nothing here&#39;)
		&#125;


	&#125; else &#123;
		alert(&#39;There are no files here&#39;)
	&#125;

&#125;</code></pre></div><p class="paragraph" style="text-align:left;">We need to check that the folder contains files, confirm they’re Illustrator files, and then ask where to save them. The script then opens Illustrator to a file, runs <code>hideAllLayers()</code> THEN <code>exportLayers()</code> only to finally close the file without saving changes.</p><p class="paragraph" style="text-align:left;"></p><h3 class="heading" style="text-align:left;" id="hiding-and-exporting-layers-one-at-">Hiding and Exporting Layers One at a Time</h3><div class="codeblock"><pre><code>function hideAllLayers()&#123;
	// Loop through doc layers and turn them off
	for(var l = 0; l &lt; doc.layers.length; l++)&#123;
		doc.layers[l].visible = false;
	&#125;
&#125;</code></pre></div><p class="paragraph" style="text-align:left;">We have to turn off all layers so that, as we iterate through them, we can export each one before the script closes.</p><div class="codeblock"><pre><code>function exportLayers()&#123;
	for(var e = 0; e&lt; doc.layers.length; e++)&#123;
		
		// Set the selected layer on
		doc.layers[e].visible = true;
		// Store layername
		var layerName = doc.layers[e].name;
		
		// Function returns a new file name
		 var targetFile = getNewName(layerName);
		 
		// Function returns SVG save options
		svgSaveOpts = getSVGOptions();

		// Save SVG
		doc.exportFile(targetFile,ExportType.SVG,svgSaveOpts);

		// Turn selected layer off
		doc.layers[e].visible = false;
	&#125;
&#125;</code></pre></div><p class="paragraph" style="text-align:left;">We iterate through the file’s layers, making each visible, creating a new file name, setting the SVG save options, and then exporting the file as an SVG. We then turn off the current layer and iterate through the remaining layers.</p><h3 class="heading" style="text-align:left;" id="generating-file-names-from-layer-na">Generating File Names from Layer Names</h3><div class="codeblock"><pre><code>function getNewName(layerName)&#123;
	// Local Variables
	var docName;

	// Set docName to the source doc name
	docName = sourceDoc.name;

	// Set newName to empty string
	var newName = &quot;&quot;;

	// Get the last underscore in the document name
	var underscore = docName.lastIndexOf(&#39;_&#39;);

	// Set newName to the docName from the first char to the last underscore
	newName += docName.substring(0,underscore);
	
	// Set newName to underscore + layerName
	newName += &#39;_&#39; + layerName;

	// Save in file at destFolder and newName
	saveInFile = new File(destFolder + &#39;/&#39; + newName);
	
	// Return saveInFile that creates file at folder path
	return saveInFile;

&#125;</code></pre></div><p class="paragraph" style="text-align:left;">The <code>getNewName()</code> creates a new file name based on the layer name and the current document name. Some magic is at play here; I’m not sure why it works or is needed, but without creating a new substring for your SVG icon, you’ll end up overwriting document names.</p><h3 class="heading" style="text-align:left;" id="setting-svg-export-options">Setting SVG Export Options</h3><div class="codeblock"><pre><code>function getSVGOptions()&#123;
	var exportOpts =  new ExportOptionsSVG();

	return exportOpts;
&#125;</code></pre></div><p class="paragraph" style="text-align:left;">I don’t use that many SVG export options, but I set this up just in case I need to update them for a different project. A client who&#39;d used this script later asked me to <a class="link" href="https://www.automation-almanac.com/p/building-an-image-catalog-when-fixing-the-website-takes-too-long?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-batch-export-illustrator-layers-to-svg-with-a-script" target="_blank" rel="noopener noreferrer nofollow">build something similar for a web portal</a>.</p><p class="paragraph" style="text-align:left;">To save all that time, you’ll need to add the script to your Illustrator scripts and run it. If you’ve never run an Illustrator script, read more here: <a class="link" href="https://ai-scripting.docsforadobe.dev/introduction/executingScripts.html?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-batch-export-illustrator-layers-to-svg-with-a-script" target="_blank" rel="noopener noreferrer nofollow">https://ai-scripting.docsforadobe.dev/introduction/executingScripts.html</a>. </p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=e5e963f8-cb72-489a-8132-9593f1256381&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

      <item>
  <title>How to Build a Firebase Scheduled Email Bot (My Parking Ticket Story)</title>
  <description>Build a Firebase scheduled function that calls an external API and sends a conditional automated email using Nodemailer. Node.js code walkthrough included.</description>
      <enclosure url="https://media.beehiiv.com/cdn-cgi/image/fit=scale-down,format=auto,onerror=redirect,quality=80/uploads/asset/file/29632ab9-dc32-40ac-9460-57a6d28bd6c3/How-an-automated-email-saved-me-from-getting-parking-tickets.png" length="1001352" type="image/png"/>
  <link>https://www.automation-almanac.com/p/how-to-build-a-firebase-scheduled-email-bot</link>
  <guid isPermaLink="true">https://www.automation-almanac.com/p/how-to-build-a-firebase-scheduled-email-bot</guid>
  <pubDate>Tue, 09 Dec 2025 06:00:00 +0000</pubDate>
  <atom:published>2025-12-09T06:00:00Z</atom:published>
    <dc:creator>Kosti Marko</dc:creator>
    <category><![CDATA[Firebase]]></category>
    <category><![CDATA[Lifestyle]]></category>
    <category><![CDATA[Node Js]]></category>
    <category><![CDATA[Nodemailer]]></category>
    <category><![CDATA[Email Automation]]></category>
  <content:encoded><![CDATA[
    <div class='beehiiv'><style>
  .bh__table, .bh__table_header, .bh__table_cell { border: 1px solid #C0C0C0; }
  .bh__table_cell { padding: 5px; background-color: #FFFFFF; }
  .bh__table_cell p { color: #2D2D2D; font-family: 'Helvetica',Arial,sans-serif !important; overflow-wrap: break-word; }
  .bh__table_header { padding: 5px; background-color:#F1F1F1; }
  .bh__table_header p { color: #2A2A2A; font-family:'Trebuchet MS','Lucida Grande',Tahoma,sans-serif !important; overflow-wrap: break-word; }
</style><div class='beehiiv__body'><p class="paragraph" style="text-align:left;">My office is within walking distance of Wrigley Field, the <a class="link" href="https://www.mlb.com/cubs/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">Cubs&#39;</span></a> stadium. Most street parking is permitted after 5 pm during night games. This leaves me in a predicament: I have to move my car before 5 pm on night games so I don’t get a ticket. Last year, someone in the office racked up $300 in parking tickets.</p><p class="paragraph" style="text-align:start;">The first thing I thought of was adding all the night games to my calendar, but there are tons of them, and I was lazy, so the manual wasn’t gonna work. I could have scripted it to capture all the night games and populate my calendar, but I ran into many Google Calendar authentication issues.</p><p class="paragraph" style="text-align:start;">So, I decided to write a cron job to check an API to see whether there was a night game; if there were, I would send an automated email in the morning to remind myself not to park there.</p><p class="paragraph" style="text-align:start;">Here is whatwe&#39;lll be using to build this automated email system.</p><ol start="1"><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://firebase.google.com/docs/functions?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">Firebase Functions</span></a> to run a daily cron job to check for games.</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://www.mysportsfeeds.com/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">MySportsFeeds</span></a> is a free service to get all of our Cubs data from.</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://momentjs.com/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">Moment.js</span></a> and <a class="link" href="https://momentjs.com/timezone/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">moment-timezone</span></a>, because timezones suck.</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://github.com/axios/axios?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">Axios</span></a>, to make our HTTP request to MySportsFeeds.</p></li><li><p class="paragraph" style="text-align:left;"><a class="link" href="https://nodemailer.com/about/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">Nodemailer</span></a> to send our emails.</p></li></ol><p class="paragraph" style="text-align:left;">Gist: <a class="link" href="https://gist.github.com/kostimarko/659f073a903133a4c6f29bbc493c3bda?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">https://gist.github.com/kostimarko/659f073a903133a4c6f29bbc493c3bda</span></a></p><h2 class="heading" style="text-align:start;" id="what-youll-need"><b>What You&#39;ll Need</b></h2><p class="paragraph" style="text-align:start;">Before diving in, make sure you have the following set up:</p><ul><li><p class="paragraph" style="text-align:start;"><b>Node.js</b> is installed on your machine</p></li><li><p class="paragraph" style="text-align:left;">A <b>Firebase project</b> — you can create one for free at <a class="link" href="https://console.firebase.google.com/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow">console.firebase.google.com</a></p></li><li><p class="paragraph" style="text-align:left;">A <b>MySportsFeeds account</b> (free tier covers this use case) — register at <a class="link" href="https://www.mysportsfeeds.com/?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow">mysportsfeeds.com</a></p></li><li><p class="paragraph" style="text-align:left;">A <b>Gmail account</b> to send from (more on the authentication quirks below)</p></li><li><p class="paragraph" style="text-align:left;">The <b>Firebase CLI</b> is installed: <code>npm install -g firebase-tools</code></p></li></ul><p class="paragraph" style="text-align:left;">This entire setup runs within Firebase&#39;s free tier — no billing required for a daily scheduled function at this frequency.</p><h2 class="heading" style="text-align:left;" id="setting-up-firebase-functions">Setting Up Firebase Functions</h2><p class="paragraph" style="text-align:start;">Create a new directory and initialize our Firebase project</p><div class="codeblock"><pre><code>mkdir cubs-automation
cd cubs-automation
firebase init</code></pre></div><p class="paragraph" style="text-align:start;">Go through the project setup and choose functions for the time being</p><p class="paragraph" style="text-align:start;">Next, we’ll need to install a bunch of packages to use all this goodness.</p><p class="paragraph" style="text-align:start;"><code>cd functions</code></p><p class="paragraph" style="text-align:start;"><code>npm install axios moment moment-timezone nodemailer --save</code></p><p class="paragraph" style="text-align:start;">At the top of your <code>index.js</code> file, you’ll need to load your dependencies</p><p class="paragraph" style="text-align:start;">The following block loads all of our dependencies at the top of the <code>index.js</code> file:</p><div class="codeblock"><pre><code>const functions = require(&quot;firebase-functions&quot;);
const nodemailer = require(&quot;nodemailer&quot;);
const axios = require(&quot;axios&quot;);
const moment = require(&quot;moment&quot;);
const momentTZ = require(&quot;moment-timezone&quot;);</code></pre></div><h2 class="heading" style="text-align:left;" id="scheduling-the-function-with-pub-su">Scheduling the Function with PubSub</h2><p class="paragraph" style="text-align:left;">Firebase pubsub scheduled functions work by triggering a Cloud Pub/Sub topic on a cron-style schedule you define. The function wakes up at the specified time, runs your code, and goes back to sleep — no server to manage.</p><p class="paragraph" style="text-align:left;">Because I needed the function to run daily, I created a <i>pubsub</i> function that runs every day at 6:45 am.</p><div class="codeblock"><pre><code>exports.sendEmail = functions.pubsub
  .schedule(&quot;every monday, tuesday, wednesday, thursday, friday 06:45&quot;)
  .timeZone(&quot;America/Chicago&quot;)
  .onRun(async context =&gt; &#123;
  
  
  &#125;)</code></pre></div><p class="paragraph" style="text-align:left;">We can use the <i>pubsub</i> cron jobs to do a check every weekday. You can read more about it <a class="link" href="https://firebase.googleblog.com/2019/04/schedule-cloud-functions-firebase-cron.html?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">here</span></a> and <a class="link" href="https://cloud.google.com/scheduler/docs/tut-pub-sub?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow"><span style="text-decoration:underline;">here</span></a>.</p><p class="paragraph" style="text-align:start;">I’m in Chicago, so I chose that time zone.</p><p class="paragraph" style="text-align:start;">The following block grabs the current date and sets up the Nodemailer transporter with our Gmail credentials:</p><div class="codeblock"><pre><code>const now = moment().format(&quot;YYYYMMDD&quot;);
    const mailList = [
     &quot;yourEmailAddress@gmail.com&quot;
    ];
    const transporter = nodemailer.createTransport(&#123;
      service: &quot;gmail&quot;,
      auth: &#123;
        user: &quot;********&quot;,
        pass: &quot;********&quot;
      &#125;
    &#125;);</code></pre></div><p class="paragraph" style="text-align:left;">We get the current date and other options for <i>nodemailer</i> to send us an email.</p><h2 class="heading" style="text-align:left;" id="calling-the-my-sports-feeds-api">Calling the MySportsFeeds API</h2><p class="paragraph" style="text-align:left;">The following <code>try/catch</code> block calls the MySportsFeeds API for today&#39;s Cubs schedule, extracts the game time and venue, and checks whether a home night game is happening:</p><div class="codeblock"><pre><code>try&#123;
const GameData = await axios.get(
        `https://api.mysportsfeeds.com/v2.1/pull/mlb/2019-regular/games.json?date=$&#123;now&#125;&amp;team=chicago-cubs`,
        &#123;
          auth: &#123;
            username: &quot;*********&quot;,
            password: &quot;*********&quot;
          &#125;
        &#125;
      );
      
      const &#123; startTime &#125; = GameData.data.games[0].schedule;
      const &#123; id &#125; = GameData.data.games[0].schedule.venue;
      const gameTime = momentTZ(startTime)
        .tz(&quot;America/Chicago&quot;)
        .format(&quot;HHmm&quot;);
      console.log(gameTime);
      const timeCheck = 1500;
      console.log(startTime);
      if (id === 133) &#123;
        if (gameTime &gt; timeCheck) &#123;
        const mailOptions = &#123;
            from: &quot;yourEmailAddress@gmail.com&quot;,
            to: mailList,
            subject: &quot;CUBS EVENING GAME - PARK CAREFULLY!&quot;,
            html:&#39;&lt;p&gt;dont park here&lt;/p&gt;&#39;
        &#125;
        const mailSent = await transporter.sendMail(mailOptions);
          console.log(mailSent);
        &#125;
        &#125;
&#125; catch(error) &#123;
  console.log(error)
&#125;
return true;
&#125;)</code></pre></div><h2 class="heading" style="text-align:left;" id="sending-the-email-with-nodemailer">Sending the Email with Nodemailer</h2><p class="paragraph" style="text-align:left;">To send an email from a Firebase Function, you pass a <code>mailOptions</code> object — containing <code>from</code>, <code>to</code>, <code>subject</code>, and <code>html</code> — to Nodemailer&#39;s <code>transporter.sendMail()</code> method. The transporter handles the SMTP connection to Gmail on your behalf.</p><p class="paragraph" style="text-align:left;">We’ll use a try/catch because no one likes promise hell. You’ll have to get your own API key from MySportsFeeds. Notice that I’m using v2 of the API; v1 has different data types that won’t work with this code. We only really need the startTime and the game and venue IDs. The startTime v2 comes in as UTC, which we have to format for our time zone. We define a constant timeCheck for the earliest possible start time of an evening game. We create intTime so we can easily compare timeCheck to the gameTime. We’ll use parseInt to do so. We need to check whether the game is at home. In this case, Wrigley Field has an id of 133. We then await the transporter function to send out the email.</p><h2 class="heading" style="text-align:start;" id="gotchas-and-lessons-learned">Gotchas and Lessons Learned</h2><p class="paragraph" style="text-align:start;"><b>Note</b>: In a production application, the worst thing you could do is store all your authentication data in plain text, as I have here. The thing you should do is save those as config variables. You can read more about that here.</p><p class="paragraph" style="text-align:left;"><b>Another note</b>: You will run into issues with Gmail. You’ll have to allow your email to use insecure applications, more on that here and <a class="link" href="https://firebase.google.com/docs/functions/config-env?utm_campaign=how-an-automated-email-saved-me-from-getting-parking-tickets&utm_medium=referral&utm_source=automation-almanac.beehiiv.com" target="_blank" rel="noopener noreferrer nofollow">here</a>.</p><p class="paragraph" style="text-align:left;"><b><i>Also</i></b><i>: Use MySportsFeeds v2 of the API, not v1. The data structures are different enough that this code will break on v1. Verify the API is still available and active before building on it — the free tier has been reliable, but it&#39;s a third-party dependency.</i></p><p class="paragraph" style="text-align:start;">This has saved me from so many tickets. I wake up and instantly know where not to park.</p><p class="paragraph" style="text-align:start;">I used the same Firebase pubsub + Nodemailer foundation later when I built my <a class="link" href="https://automation-almanac.beehiiv.com/p/how-to-automate-mailchimp-daily-reports-with-firebase?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow">Mailchimp daily email reporter</a> — same scheduled-function pattern, different API and output. And I used it again for the <a class="link" href="https://automation-almanac.beehiiv.com/p/automated-omeda-reporting-that-actually-works?utm_source=www.automation-almanac.com&utm_medium=newsletter&utm_campaign=how-to-build-a-firebase-scheduled-email-bot-my-parking-ticket-story" target="_blank" rel="noopener noreferrer nofollow">Omeda Slack reporter</a>, swapping the email output for Slack Block Kit messages.</p><h1 class="heading" style="text-align:start;" id="conclusion"><b>Conclusion</b></h1><p class="paragraph" style="text-align:start;">I added everyone in the office to the list, and the parking tickets went to 0. So, don’t remember stuff; automate it to have more time to drink mimosas while you nurse a hangover.</p></div><div class='beehiiv__footer'><br class='beehiiv__footer__break'><hr class='beehiiv__footer__line'><a target="_blank" class="beehiiv__footer_link" style="text-align: center;" href="https://www.beehiiv.com/powered-by?publication_logo=https%3A%2F%2Fmedia.beehiiv.com%2Fcdn-cgi%2Fimage%2Ffit%3Dscale-down%2Cformat%3Dauto%2Conerror%3Dredirect%2Cquality%3D80%2Fuploads%2Fpublication%2Flogo%2F53b3298b-ac01-49d2-bb12-bd4daa428adb%2FAutomation-Almanac_Logo.png%3Fv%3D1780196761&publication_name=Automation+Almanac&utm_campaign=04a8e067-b30c-4c4a-8ac9-90b2eecca417&utm_medium=post_rss&utm_source=automation_almanac">Powered by beehiiv</a></div></div>
  ]]></content:encoded>
</item>

  </channel>
</rss>
