strip messaging subjects from mail2web comment titles

Ian Ward - May 6, 2008 - 18:09
Project:Mail Comment
Version:5.x-1.0-beta3
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

hey Jose, this patch is about improved title handling for comment subjects when using mail2web. When you reply to a post via mail2web now, unless you change the subject of the email to something custom, the subject will be "RE: {text from notifications alert}" which only works well if ou set notifications subject to be just [title]. Usually this is like: "RE: Comment for Post Name". This patch will look at what the parent comment title was, and use "RE: {parent comment title}" and if it has no parent comment, it will use "RE: {title of node}" The handling is not so robust if you look at the code, so maybe there's a better way, like looking at the variable setting in notifications, etc.

AttachmentSize
notifications_mail2web_titles.patch1.91 KB

#1

jmiccolis - June 10, 2008 - 16:41

Hey Gents,

Instead of adding "RE: Parent title" as the default for when titles aren't altered could we use the normal Drupal behavior of grabbing the first few words from the comment/email and using that as the title?

This would preserve a common formatting for comments posted on the web and though email. (Additionally if comment titles aren't allowed we could respect that too).

Thoughts?

#2

jmiccolis - June 10, 2008 - 18:15

As a start attached is a small patch that simply generates a title for the comment from the body.

In the future then we can add check here that compares the title with what would have been sent out to determine if it's been customized. We'd need to regenerate that title from the original node and the title token pattern which is used for the kind of notification that it was.

AttachmentSize
mail2web-title.diff 793 bytes

#3

Jose Reyero - August 8, 2008 - 18:21
Project:Notifications» Mail to Web
Version:5.x-1.x-dev» 5.x-1.0-beta1

The patch looks good, but for the variable enclosed in t()

t('RE: '.mail2web_get_pid_subject($node->pid))

Maybe it should be

t('RE: ') .mail2web_get_pid_subject($node->pid)

Anyway, maybe we shouldn't make any assumption on the client's default language and try a regexp with different combinations, like upper and lower case 'Re:', t('Re:'), etc...

However, I'm not the maintainer anymore of this one :-)

#4

Ian Ward - November 16, 2009 - 17:56
Project:Mail to Web» Mail Comment
Version:5.x-1.0-beta1» 5.x-1.0-beta3

Switch to mailcomment project. Mail2web is now known as "mailcomment" due to a trademark issue with the name mail2web.

 
 

Drupal is a registered trademark of Dries Buytaert.