Quick Overview
This workflow runs hourly to find due newsletters in WordPress (AIS Newsletter Manager), pulls articles from Reddit, Google News, Yahoo Sports, NCAA.com, and BBC Sport, uses OpenAI to summarize content and generate a feature image, then emails a branded HTML newsletter via SMTP and marks it as sent.
How it works
- Runs every hour and calls your WordPress AIS Newsletter Manager
/due endpoint to retrieve newsletters scheduled to send.
- For each due newsletter, fetches fresh items from five sources (Reddit RSS, Google News RSS, Yahoo Sports RSS, NCAA.com RSS, and BBC Sport RSS) and normalizes them into a consistent article format.
- Filters and randomly selects a configured number of recent articles (last 10 days) with representation across sources.
- Uses OpenAI (chat model) to generate an intro and per-article summaries in a strict JSON structure.
- Uses OpenAI image generation to create a feature image from the first article and uploads it to WordPress via the plugin’s media endpoint.
- Builds a branded HTML email using the WordPress newsletter settings (colors, title, logo, and unsubscribe link), retrieves the active recipients list from WordPress, and sends the issue via SMTP in BCC batches.
- Notifies WordPress that the newsletter is sent by posting to the plugin’s
/sent endpoint, then continues to the next due newsletter.
Setup
- Install and configure the AIS Newsletter Manager WordPress plugin and ensure its REST endpoints are reachable (including
/due, /media, recipients, and /sent).
- Create an HTTP Header Auth credential that sends the plugin token as
X-AIS-Token for the WordPress API requests.
- Add an OpenAI API credential for the chat summarization and image generation steps.
- Add an SMTP credential and set your sender/from address,
wpBaseUrl, and BCC batch size in the workflow’s site configuration values.
- In WordPress, create at least one newsletter with topic/branding settings and subscriber recipients so the workflow has content and a list to email.