Project

General

Profile

Actions

Bug #5039

closed

Email notification does not match post content

Added by Raffi Khatchadourian over 8 years ago. Updated over 8 years ago.

Status:
Resolved
Priority name:
High
Assignee:
Category name:
Email Notifications
Target version:
Start date:
2015-12-16
Due date:
% Done:

0%

Estimated time:
Deployment actions:

Description

I recently created a post at http://commons.gc.cuny.edu/groups/lms-blackboard-and-alternatives/forum/topic/suggestions-for-first-steps-in-evaluating-and-reviewing-alternative-lmss/#post-45428. I then received an email notification with my post. It doesn't match what I wrote:

The post content:

Hi all,

Despite the news from @spowers, I have added a few more suggestions to the google doc. They mainly focus on Blackboar Organizations, content collection, and mobile notifications (which I find quite useful). Please let me know if you have any feedback.

Thanks!

Raffi

The email content:

Hi all,

Despite the news from google doc [https://docs.google.com/document/d/1D-oMT4eeaakG9OpIiQZ561lXfx-PoYbTP93rLmCaAC0/edit?pli=1] . They mainly focus on Blackboar Organizations, content collection, and mobile notifications (which I find quite useful). Please let me know if you have any feedback.

Thanks!

Raffi

Ok, I spelled Blackboard wrong, but even still, readers won't be able to make sense of what I am saying in the post if they only read the email notification. And, in fact, from my understanding, that is the way many people read posts on the commons.

Actions #1

Updated by Boone Gorges over 8 years ago

  • Status changed from New to Resolved
  • Assignee set to Boone Gorges
  • Target version set to 1.9.2

Thanks for the report, Raffi, and sorry for the mangling.

When sending emails, we convert anchor tags to the format "link text [link url]" to maximize compatibility with email clients that might not parse HTML. Your message contained more than one anchor tag (the @-mention and the Google Doc link), and the regular expression had an overly greedy quantifier in it, so that the entire content between the first <a> and the final </a> was captured.

I've fixed the problem in https://github.com/cuny-academic-commons/cac/commit/c9d788a14696225ff45d203b4c41cd0f008e9fc4. Here's the new regex, if you're interested and want to check my work :-D

    $regex = '|<a[^>]+href=["\']([^"\']+)["\'][^>]*>([^<]+)</a>|';
    $text = preg_replace( $regex, '$2 [$1] ', $activity->content );
Actions #2

Updated by Raffi Khatchadourian over 8 years ago

Boone Gorges wrote:

Thanks for the report, Raffi, and sorry for the mangling.

When sending emails, we convert anchor tags to the format "link text [link url]" to maximize compatibility with email clients that might not parse HTML. Your message contained more than one anchor tag (the @-mention and the Google Doc link), and the regular expression had an overly greedy quantifier in it, so that the entire content between the first <a> and the final </a> was captured.

I've fixed the problem in https://github.com/cuny-academic-commons/cac/commit/c9d788a14696225ff45d203b4c41cd0f008e9fc4. Here's the new regex, if you're interested and want to check my work :-D

[...]

Thanks, Boone. I can't actually see that commit in GitHub. I'm actually not very good at regular expressions, so if you'd like to add my email as a regression test, that would suffice with me :).

Actions #3

Updated by Boone Gorges over 8 years ago

Yeah, our Github repo is private, for some lame legacy reasons.

Actions #4

Updated by Raffi Khatchadourian over 8 years ago

Boone Gorges wrote:

Yeah, our Github repo is private, for some lame legacy reasons.

Ah, gotcha.

Actions

Also available in: Atom PDF