Reply via email (mailto link) in RSS feed at the end of each post
I came across this post https://ethanmarcotte.com/wrote/replyin/ where author says he added Reply via email link at the end of each post in RSS feed so people have this option to respond via email
In his feed (XML format) it looks like this
pa href=mailto:[email protected]?subject=Reply%20to:%20“Bookiversary.”Reply via email/a/p
I am using Underscores and it has several default feed templates that come with WP install. I checked WP Codex https://codex.wordpress.org/Customizing_Feeds and didn't find anything specific on how to modify templates to add this feature.
Question: is this done by modifying RSS templates? If so, which one and how?
Update: Based on @birgire suggestion to use the_content_feed filter, the following code adds email address at the end of my RSS feed (as per XML view)
// add custom content to all feeds
function add_content_to_all_feeds($content) {
$after = 'pa href=mailto:[email protected] via email/a/p';
if (is_feed()) {
return $content . $after;
} else {
return $content;
}
}
add_filter('the_content_feed', 'add_content_to_all_feeds');