Further note: Twitter link goes sideways if you have a custom excerpt with HTML and don’t remove it from the metabox. (code shows up on the rendered page – not the Twitter icon)
Email leaves out the link if you have a custom excerpt in the metabox, with or without HTML. You can see this second issue on this page: https://leasideresidents.ca/mid-rise-consultations/ – no linky-link in the email. The only way to get it there is to remove everything from the metabox.
First one, email text.
You can rewrite that function in code snippets, you may need to deactivate the plugin, add the snippet, and then reactivate.
It will see function exists and use yours
function gp_social_email_body() {
$email_body = __('Check out this important article', 'gp-social');
$email_body .= $url;
}
Secondly Twitter
If using html in the excerpt, I can make it strip out all the html, alternatively posts have a custom meta field to change the twitter content instead of using the excerpt
So I installed the code snippet – and now it leaves out everything in the email body. Plus it opens a small window in the browser when you click on the email icon (similar to what it does with Twitter or FB – but those are useable windows). It says “untitled” at the top, then a mailto: with the subject line – otherwise blank.
Tried uninstalling the plugin and reinstalling – no difference. Still no email content. Try it at https://urbanneighbourhoods.ca/phasing-out-ontarios-gas-fired-power-plants/ to see this behaviour.
And – I had a look at another site where I haven’t made any modifications, and discovered the email function isn’t working there either; in that case it does put a short text excerpt (first line from the post) in the email body, but there is no link. And it, for whatever reason, doesn’t say “check out this awesome post” – it has no additional text (which is what I’d prefer to have!!), even though it’s in the PHP when I look. Both of these sites are using v. 2.2 – so it’s rather odd that they’re outputting different results, especially as I didn’t make any changes in the second site. https://leasideresidents.ca/canadian-tire-on-lake-leaside/
On a third site, it creates the extra little window in the browser, adds the “awesome” bit (not as bad on a camp website…) adds the author name (not wanted at all – same as other site, it’s hidden on the posts) and adds the link in the email.
https://camphurontario.com/2021/03/18/registration-update/
—————-
On the second issue, given that the Twitter link doesn’t work if there is HTML inserted in Twitter meta field, then yes – it should strip out the HTML. There is no point in leaving it if it breaks it. And for those of us who use custom excerpts, it’s nice not to have yet another thing to remember to do.
Hey Paddy, how did you fixed the missing text+link from the email body?