buddypress-group-email-subscription icon indicating copy to clipboard operation
buddypress-group-email-subscription copied to clipboard

Links getting mangled in immediate emails (All Mail setting)

Open x2764tech opened this issue 7 years ago • 4 comments

When an message is sent out immediately, the content is wrapped in quote marks, eg:

Test posted an update in the group Testing Group

"Content of message"

This is hard-coded at https://github.com/boonebgorges/buddypress-group-email-subscription/blob/master/bp-activity-subscription-functions.php#L216

The problem we are having is that, when the message ends with a link, the closing double-quote is appearing as part of the link:

"a link https://clandestinecakeclub.co.uk/ccc-events/cheshire-south-fall-winter/"

And when someone clicks on the link, they are getting a 404 error.

I've temporarily fixed this but putting an extra space in (most users don't notice), but I'm wondering if anyone else has had this issue, and if there is a better solution for it?

x2764tech avatar Oct 27 '17 09:10 x2764tech

Ah, sounds like the email client is being a bit fussy.

How about if we add a line break before the close quote?

boonebgorges avatar Oct 27 '17 13:10 boonebgorges

@boonebgorges well, SparkPost's engagement tracking to be exact, but I've had similar issues with other email providers...

If you add a link break before the close quote, would it make sense to add one after the open quote too?

" Content of Message "

I'm not sure, but having some whitespace would fix the problem. Looks like there's lots of whitespace, but most of it outside the (extended)-ASCII range.

x2764tech avatar Oct 27 '17 14:10 x2764tech

If the specific issue is with URL parsing, it's unlilkely that a line break before the message would make a difference - I assume that parsers can figure out "https://.... That said, it's maybe more aesthetically pleasing to be symmetrical.

@r-a-y you have more experience with provider email parsing than I do - any objections to adding the line breaks?

boonebgorges avatar Oct 27 '17 14:10 boonebgorges

@x2764tech - You should be able to edit the email content from the "Emails" admin dashboard to remove the quotations: https://github.com/boonebgorges/buddypress-group-email-subscription/wiki/Email-Tokens

You'll want to edit the "A member created a group activity entry" post and modify the "Plain text email content" field.

@boonebgorges - This is only pertinent for plain-text emails. We could just remove the quotations if they are a bother.

r-a-y avatar Oct 30 '17 19:10 r-a-y