Skip to content

Conversation

@ayushshivani
Copy link
Contributor

Implemented two new Gmail tools for managing newsletter subscriptions:

  1. fetch_newsletter_subscriptions
  2. unsubscribe_from_newsletter

Implemented two new Gmail tools for managing newsletter subscriptions:

1. fetch_newsletter_subscriptions
   - Scans Gmail inbox for emails with List-Unsubscribe headers
   - Identifies newsletters and marketing emails (CAN-SPAM compliant)
   - Returns unique newsletter senders with unsubscribe information
   - Supports pagination and filtering by sender email
   - Extracts HTTP URLs, mailto links, and one-click unsubscribe support

2. unsubscribe_from_newsletter
   - Automatically unsubscribes using RFC 8058 one-click method when supported
   - Falls back to providing HTTP URL or mailto instructions
   - Safe URL validation and error handling
   - Detailed status reporting (success, manual action required, or error)

Features:
- Pydantic models for input validation
- Secure OAuth token management via worker_context
- Comprehensive error handling and logging
- Respects anti-spam standards (CAN-SPAM, RFC 8058)
- User-friendly responses with sender information

Use cases:
- Bulk discovery of newsletter subscriptions
- Automated cleanup of unwanted newsletters
- Email inbox management
- Subscription audit and management
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants