Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is it possible to extract item title and modify it? #223

Open
EchoDev opened this issue Sep 2, 2022 · 1 comment
Open

Is it possible to extract item title and modify it? #223

EchoDev opened this issue Sep 2, 2022 · 1 comment

Comments

@EchoDev
Copy link

EchoDev commented Sep 2, 2022

Example RSS

<rss version="2.0">
<channel>
<title>My RSS Today</title>
<link>http://www.example.com/</link>
<image>
<url>http://www.example.com/img/myepisodes_logo.jpg</url>
<title>www.example.com</title>
<link>http://www.example.com/</link>
</image>
<description>
This is my RSS example!
</description>
<language>en-us</language>
<item>
<guid isPermaLink="false">123456</guid>
<title>
[ rss2email ][ 123 - some more text ][ More text ][ 02-Sep-2022 ]
</title>
<link>
https://www.example.com/weirdsite
</link>
<description>
This is a description for my example
</description>
</item>
<item>
<guid isPermaLink="false">123456</guid>
<title>
[ thisisnotrss2email ][ 5689 - blabla ][blabla ][ 02-Sep-2022 ]
</title>
<link>
https://www.example.com/nicesite
</link>
<description>
More description!
</description>
</item>
</channel>
</rss>

I would like to extract "rss2email" and "thisisnotrss2email" from the item title and put it the name-format line. Is it possible to capture/split this and put this in the name?

If this is not possible, would it be possible to put the whole item title (not feed title) as the name?

@auouymous
Copy link
Contributor

You can use the subject-format setting to alter the layout of the subject line in emails, but can not change the content of the pre-defined fields it supports. subject-format = [{feed-title}] would put brackets around the subject of all emails sent by r2e.

If you know python, you can use post-processing hooks to alter any text in the email header or body. It would be simple to match and replace parts of the string in message['Subject'], or remove matched parts and insert them into the message['From'] string.

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

No branches or pull requests

2 participants