FR: Newsletter format
Thanks for this project, as someone who is new to go it is very readable and well structured. It looks really interesting to me as a way to manage rss as email: calmly catch up on my terms.
To that end I wondered if you would be interested in a feature that sends out a single email containing all the new links, like a “Newsletter”, instead of one per feed item.
If that sounds interesting I might have a go (ha!) at it? It might separate nicely as a new command option?
Thanks!
I think I wouldn't be averse to such a feature, but I suspect that it would require a lot of changes to the code. Specifically because the way we process right now is very much:
- For each feed ..
- For each item in the feed ..
- If this is new, send the email.
- For each item in the feed ..
I can imagine a per-feed summary pretty easily:
- For each feed ..
- For each item ..
- If this item is new, save it to a temporary place.
- Now send the per-feed summary.
- For each item ..
But of course the devil is in the details, right now the template used for generating the email assumes only a single entry. I guess trivial changes are possible, such as changing:
Subject: [rss2email] {{.Subject}}
To something like:
Subject: [rss2email] Summary from $feed-title
The hidden headers would need to be dropped too, I guess, since they point to single entries:
X-RSS-Link: {{.Link}}
X-RSS-Feed: {{.Feed}}
X-RSS-GUID: {{.RSSItem.GUID}}
But dealing with the bodies, and working out how to handle them would be hard.
A simple case might be just:
To ..
From ..
Subject: feed summary for https://...
The following new itmes arrived:
* http://...
* https://...
But otherwise trying to join the bodies, and the links is going to look pretty messy.
I've no personal interest in such a thing, but if it could be done in a reasonably clean fashion - almost certainly using a new template, to avoid forcing people to change their (possibly modified) local copies, with a new sub-command I'd accept it.
TLDR; I'd merge a PR it if it were clean and didn't involve too much repetition. But I'd not work on it myself.