Wp-calypso: More block: no longer displaying in email

Created on 29 Jul 2020  Â·  66Comments  Â·  Source: Automattic/wp-calypso

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.

Steps to reproduce

  1. Go to your "Followed SItes" at https://wordpress.com/read. Toggle Followed Sites open.
  2. Select one of your followed sites. It should load in the main panel on the right hand side.
  3. Click "Settings" as per the screenshot below.
    Screen Shot 2020-08-26 at 13 03 42
  4. Toggle the control which reads Email me new posts.
  5. Once toggled click the button which says Instantly (this will appear once you have toggled the control to "on").
  6. On the site you just subscribed to publish a post with a More block in it.

Screen Shot 2020-07-29 at 3 36 12 PM

  1. Subscription email that is sent out to subscribers does not show a Read More link. Instead, the full text of the post shows in the email.

Screen Shot 2020-07-29 at 3 36 55 PM

What I Expected:

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.

Context / Source

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

Fix

Please see diff at D48681-code

Blocks [Pri] High [Type] Bug

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.

All 66 comments

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:

  1. If "hide teaser" is on, emails will display the post minus whatever was added before the more block.
  2. If "hide teaser" is off, we will display the whole post in the email

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.

3186846-zen

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 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

23162439-hc

Reported on # 21786294-hc

3201987-zen

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.

23485835-hc - provided Feed excerpt 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

Update

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.

Useful info

Analysis

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:

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.

Testing content

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 -->

Output

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 -->

Solutions

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

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.

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.

image

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

Was this page helpful?
0 / 5 - 0 ratings