home / skills / openclaw / skills / email-news-digest

email-news-digest skill

/skills/matthewxfz3/email-news-digest

This skill generates a daily email digest by summarizing recent messages, creating a themed image, and delivering a polished HTML report.

npx playbooks add skill openclaw/skills --skill email-news-digest

Review the files below or copy the command above to add this skill to your agents.

Files (6)
SKILL.md
3.7 KB
---
name: email-news-digest
description: Summarize recent emails, generate a thematic image, and send a formatted HTML email report with the summary and image. Use for daily news digests, project updates, or any email-based reporting that needs visual enhancement and rich formatting.
---

# Email News Digest

This skill automates the process of creating an AI-powered news digest from your recent emails, generating a relevant image, and sending a formatted HTML report.

## Usage

To use this skill, run the `process_and_send.sh` script with the required parameters:

```bash
skills/email-news-digest/scripts/process_and_send.sh \
    --recipients "[email protected],[email protected]" \
    --email-query "newer_than:2d subject:news" \
    --image-prompt "A sharp, modern western style image representing AI growth, fierce competition, and diverse applications."
```

### Parameters

*   `--recipients`: Comma-separated list of email addresses to send the digest to.
*   `--email-query`: Gmail search query to filter recent emails (e.g., "newer_than:2d subject:AI"). See [email-filters.md](references/email-filters.md) for more examples.
*   `--image-prompt`: A descriptive prompt for the AI image generation.

## How it Works

1.  **Email Retrieval:** Fetches the most recent email matching your query.
2.  **Content Summarization:** Extracts content and generates a structured summary (TL;DR, main title, and sections) using an internal Python script. (Note: The summarization script currently uses a placeholder summary; future enhancements will integrate a full LLM for dynamic summarization.)
3.  **Image Generation:** Creates a thematic image using the `nano-banana-pro` skill based on your `image-prompt`.
4.  **HTML Report Assembly:** Constructs a dynamic HTML email body using a template, incorporating the summary and a reference to the generated image.
5.  **Email Dispatch:** Sends the formatted HTML email with the image as an attachment using `gog gmail send`, employing a robust Base64 encoding/decoding method to handle complex HTML content safely.

## Summarization Standards

To ensure high-quality output, the summarization process within this skill adheres to the following standards:

*   **Key Insights & Trends:** Prioritize extracting major announcements, significant developments, and overarching trends rather than mere factual recitations.
*   **Conciseness:** The TL;DR should be 3-4 sentences, providing a quick overview. Detailed sections should elaborate succinctly.
*   **Accuracy & Fidelity:** Summaries must faithfully represent the original content without introducing new information or distorting facts.
*   **Clarity & Professionalism:** Use clear, straightforward, and professional language. Avoid jargon where simpler terms suffice.
*   **Bias Neutrality:** Summaries should be objective, presenting information as-is without injecting personal opinions or biases.

## Implementation Standards (Summarization Component)

*   **Modularity:** The summarization logic resides in `scripts/summarize_content.py` to ensure it's self-contained and easily upgradable.
*   **Input/Output:** The script should accept raw email content (or extracted text) as input and output a structured JSON object containing the TL;DR, main title, and markdown-formatted sections.
*   **Future LLM Integration:** The current Python script uses a placeholder. Future development will focus on integrating a robust Large Language Model (LLM) API (e.g., Gemini) to perform dynamic, context-aware summarization based on these standards.

## References

*   [email-filters.md](references/email-filters.md): Provides examples of Gmail search operators.
*   [html-template.html](references/html-template.html): The HTML structure used for the email report.

Overview

This skill automates creation of an AI-powered email news digest: it summarizes recent emails, generates a thematic image, and sends a polished HTML report with the summary and embedded image. It is designed for routines like daily digests or project updates where visual enhancement and rich formatting improve readability. The output is a concise TL;DR plus structured sections and a generated image attached to the email.

How this skill works

The skill fetches recent emails matching a configurable query and extracts their text content. It runs a summarization component to produce a TL;DR, main title, and markdown-formatted sections, then calls an image generator using a user-provided prompt to create a thematic visual. Finally, it assembles a dynamic HTML email incorporating the summary and image and sends it to the specified recipients with robust encoding to preserve complex HTML.

When to use it

  • Daily or weekly news digests compiled from a selected mailbox or label.
  • Project status summaries derived from recent email discussions.
  • Executive summaries for stakeholders who prefer concise updates with visuals.
  • Monitoring key announcement threads or press-releases delivered by email.
  • Email-based reporting workflows that need a shareable HTML snapshot.

Best practices

  • Use precise email search queries (e.g., time ranges, subject filters) to limit noise and focus summaries.
  • Provide a clear, descriptive image prompt to produce relevant visuals that match the digest tone.
  • Review generated summaries before broad distribution for sensitive or high-stakes content.
  • Keep TL;DR to 3–4 sentences and use short section headings for scannability.
  • Rotate image prompts or styles regularly to keep digests visually fresh.

Example use cases

  • A product manager runs a daily digest of user feedback emails to surface trends and triage issues.
  • A PR team compiles recent press and media mentions into a visually branded email report.
  • An engineering lead summarizes critical incident email threads for an on-call handoff report.
  • A research group daily-captures relevant literature alerts and sends a short thematic briefing.
  • A small business owner receives a compact weekly revenue and update summary with a themed banner image.

FAQ

How do I control which emails are summarized?

Specify a search query to filter messages by date range, subject, sender, or labels so the skill processes only relevant emails.

Can I customize the visual style of the generated image?

Yes. Provide a tailored image prompt describing style, color palette, and themes; the generator uses that prompt to create the thematic image.