Update: we have a potential fix here D48681-code. The testing instructions are in the diff and _not_ on this Issue.
When a More block is inserted into a post and the post is published, the feed subscription email goes out to subscribers. In the email that subscribers receive, the More block does not show up in the email.
Email me new posts
.Instantly
(this will appear once you have toggled the control to "on").The More block should show a link in the email for readers to click and read the rest of the post. This is referenced in the WordPress.com documentation here.
I tested this on three different sites, with three different themes - Blink, Barnsbury, and Tortuga. All three sites are WordPress.com Premium plan sites.
Issue was originally reported in #23002093-hc
Please see diff at D48681-code
Another report here with a user in the Classic Editor. I have tested with the Classic Editor as well as the Block Editor and both are ignoring the More option when sending out emails.
Reference: 3184489-zen
Similar issue here: #3183870-zen
Just tested on my simple site and reproduced it as well. There are two different scenarios depending on your choice for the "Hide teaser" toggle:
The only workaround I see for now is to force the excerpt via Manage > Settings > Writing by enabling Limit feed to excerpt only
Report of the same issue. User was using the Classic block in the Editor with the More block and subscriber emails were not truncated.
Same issue. Block & classic editor respectively.
23024555-hc
16014105-hc
Report of the same issue in the block editor, but they are using the classic block with the more tag inside of the classic block.
3188433-zen
Another report via Twitter, and also in the forums: https://wordpress.com/forums/topic/read-more-tag-doesnt-work-in-email-notification
Another report in 21432386-hc, only using block editor.
Another user reported this issue -- it was actually first reported in 22997863-hc, but user returned when our workaround to use the Limit feed to excerpt only
started to hide image blocks from the email notification -- which _isn't_ the case when More blocks work as expected.
Currently following up with them them in 3195264-zen, which has links to the screenshots that the user took to confirm the limitations with this workaround for displaying image blocks
21805617-hc
Another here: #3188901-zen
One more 23053157-hc
Another one: #3187719-zen
Reported on # 21786294-hc
Another report #3201141-zen
Workaround: They can turn on the Summary option from WP Admin -> Settings -> Reading -> For each post in a feed, include
User with Classic Editor and Read More tags shows missing link in email: hc-118990
Another report in 3206853-zen
Provided workaround, although it appears they already have it set to Summary under "For each post in a feed, include" already.
3211087-zen
Another report here: #22096532-hc
3200907-zen
3179509-zen
3253084-zen
Noting we've seen a handful of these in the forums as well. We'll track under the read-more tag.
Another in #23330194-hc
Another report in #23340591-hc, provided Summary settings workaround.
Another report in #23406454-hc. The user mentioned that the Limit feed to excerpt only
setting did not help them.
9893824-hc
Another report in #21757151-hc, provided Summary settings workaround.
I’ve taken a look into the cause of this issue. When the subscription email is being generated (in Subscription_Mailer::convert_html_to_email()
) and the rss_use_excerpt
blog option is not turned on, it leverages get_the_content()
to determine the email body content.
This function does take into account a possible more block or quick tag. The problem is that it relies on WP_Query::generate_postdata()
which forces full post content when on an RSS feed. At the time we are creating the email WP_Query::is_feed()
returns true
. The end result is this causes get_the_content()
to re-append the content that occurs after the more block to the returned content.
Excerpts are intended to be a plain text alternative to the more block or quick tag and as such don’t take them into account.
One possible solution when the rss_use_excerpt
setting is not turned on, would be to check for the presence of a more tag before generating the body content. If it is present, manually process the post content to get only that prior to the more block. Then pass that through any required filter and append the read more link to the end.
I’ve run out of time to find a better approach or work up a solution for this, so happy for someone else to pick this one up.
Another report in 3219268-zen
Also 3246117-zen
Another one: 3239300-zen
Another instance where the user's expressing frustration about this here: 3218891-zen
Another: 3227815-zen
Another user report in: 20784053-hc
3252046-zen, provided the workaround of selecting Summary
in WP Admin > Settings > Reading
3252717-zen
I've now tested this and confirmed the issue. I'm going to be looking into it picking up where @aaronrobertshaw left off.
I also updated the testing instructions to allow folks to replicate more easily.
get_the_content
does handle the More block.generate_postdata
- more
conditional. This function is called by get_the_content
here.The following explains what happens when the email is being built. The following is all Open Source WP.org code and not specific to WP.com:
get_the_content
is called from the email builder function in the Dotcom codebase to get the content for the email.get_the_content
is called with is_feed
set to true which alters the output to suite an RSS feed style - not explictly for email so this is an issue in and of itself!get_the_content
calls out to generate_postdata
. generate_postdata
will set it's $more
value to be truthy because is_feed()
is true (note: WP.com forces is_feed
to true for the email in question). This value is then returned to the caller (ie: get_the_content
) as $elements['more']
(more on this later!).get_the_content
_does_ detect the More
block and correctly splits the post content into two halves (pre / post More block).generate_postdata()
set the $elements['more']
to be truthy, two things now happen:<span>
is appended to the final email output as a "More" replacement.$elements['more']
being truthy and the conditional which re-appends the unwanted second half of the content.The question now is _why_ does the conditional for $elements['more']
exist at all? What is its purpose?
The answer is in the comments of the WP.org codebase:
Force full post content when viewing the permalink for the $post, or when on an RSS feed. Otherwise respect the 'more' tag.
So effectively the full post content is being forced within the email (ie: even if there is More block detected) because the post content for the email is being generated on Dotcom in a context where is_feed()
is true.
I'm using the following content in the editor to test this:
<!-- wp:paragraph -->
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
<!-- /wp:paragraph -->
<!-- wp:more -->
<!--more-->
<!-- /wp:more -->
<!-- wp:paragraph -->
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<!-- /wp:paragraph -->
Notice how the _raw_ output of get_the_content
_prior_ to applying the the_content
filters does _not_ include the more block. It has already been replaced with a <span>
:
<!-- wp:paragraph -->
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. </p>
<!-- /wp:paragraph -->
<span id="more-382"></span>
<!-- wp:paragraph -->
<p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<!-- /wp:paragraph -->
<!-- wp:paragraph -->
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
<!-- /wp:paragraph -->
Here is a initial attempt to fix this D48681-code.
Another report in #23502645-hc
Diff now available at D48681-code
Another report here 3262019-zen (regarding the read more block not being applied to the email and also text justification)
3259675-zd
Also 23341772-hc
Also 23628359-hc
Another report in 23667465-hc
One more: 3262667-zen
one more: 3244371-zen
Another case: 13893399-hc
Follow Up: 3265883-zen
3259865-zen
21702201-hc
22104473-hc
3277980-zen
Provided workaround under wp-admin --> Settings --> Reading --> Summary
Fix deployed as of r213058-wpcom. I have tested on Production and it works as expected.
Any HEs seeing this please test and confirm. Much appreciated.
@serabi Pinging you as the creator of this Issue.
I tested this & the more block seems to be working as expected for me now in the email notification. Thank you for working on this!
@getdave Hi Dave! We've noticed that all new post emails coming from P2 have the "Read more of this post" link at the end, even when the More block hasn't been used. It's confirmed happening in emails both using the P2020 (the new P2) and the old P2 template.
I assume it's related to r213058-wpcom, could you take a look in case it's easily fixable?
Fix here D49025-code ~currently being tested~ now deployed here r213115-wpcom.
I've tested this in Production using the More _block_ and the Classic Block with the More _tag_ and it works in both scenarios.
Also both scenarios now covered by automated tests in r213118-wpcom.
This fix just mimics the "excerpt" feature and does not allow for photos which the more tag did previously.
@getdave In 3286183-zen the Read More now appears, but not in the place they placed it. Not sure if it's related but they also can't access the blog by clicking [...]
Previously whatever was placed before the more tag was in the email (photos incl). Now it appears it's just the text.
@Digger444 I tested the more block and it worked correctly in the email I received from my site. Please check your Writing settings to see if the feed is set to send full posts.
Where do I find this setting for “full posts”
/wp-admin/options-writing.php
@Digger444 Sorry, it's "Writing" settings in the WordPress.com dashboard (https://wordpress.com/settings/writing/)
It's Settings > Reading in WP Admin
Okay, cleared that and will assume that fixes the problem. Thank you.
Forgive me for being such a pain. Is there something that actually says “send full posts” or do I just uncheck the “excerpt only”?
@Digger444 In WordPress.com settings just uncheck "excerpt" setting
Most helpful comment
Updated
Fix deployed as of r213058-wpcom. I have tested on Production and it works as expected.
Any HEs seeing this please test and confirm. Much appreciated.
@serabi Pinging you as the creator of this Issue.