The "Send email..." advanced action is missing some variables related to comments. Popular blogging software (e.g., Movable Type) sends information about the commenter, comment text, and alteration URLs in comment notification emails. Drupal 6 cannot.

The attached patch to system.module allows Drupal 6 admins to create emails similar to those expected by converts from other blog software. It adds the following variables to the "Send email..." action:

%comment_subject - the comment's subject.
%comment_body - the body text of the subject
%comment_username - the name of the user who submitted the comment
%comment_edit_url - URL to edit the comment
%comment_delete_url - URL to delete the comment

Comments

mrfelton’s picture

Excellent - works for me.

Thank you

lilou’s picture

Version: 6.3 » 7.x-dev
StatusFileSize
new2.22 KB

Feature request go to HEAD and then ported.

pp’s picture

Title: Add More Comment Variables to Send Email Action » Hidden or missing variables in the system's send email and messge action
Version: 7.x-dev » 6.x-dev
Category: feature » bug
StatusFileSize
new3.86 KB

It is a bug report, not a feature request.

First of all: The system_mail function includes some taxonomy variables but the action settings form's description does not present these. (%term_name, %term_description, %term_id, %vocabulary_name, %vocabulary_description, %vocabulary_id) These are the hidden variables.

Next: The system_send_email_action function gives the comment's data(in the context) but doesn't use it(just the cid, to load the node). It's a bug. When I make a trigger for new comment, I can't make informative email which contains the comment data. I just make a simple message which contains node data. When anybody comments my blog I read 'You got a new comment'. This is unusable! I want to make a more informative mail that contains the comment body itself. Drupal 6 has this feature but I can't use it because the system module has this bug.

System message is the same.

pp’s picture

Assigned: llinde » Unassigned
Anonymous’s picture

Title: Hidden or missing variables in the system's send email and messge action » Add Comment Variables to Send Email Action
Version: 6.x-dev » 7.x-dev
Category: bug » feature
Priority: Minor » Normal

@pp: Please open another issue for the bug and don't hijack this feature request. Note that your patch should only fix the bug you've identified and not add the feature request associated to this issue.

That makes the current patch associated with this issue the one in #2 which needs tested.

pp’s picture

gábor hojtsy’s picture

Status: Needs review » Needs work

Well, to me it looks like pp's comment includes #2 and expands on that with related bug fixes. Also, #2 includes testing code (error_log()), so that is not up for consideration as-is.

mitchell’s picture

Just ran across this issue while searching. Bumping cause it's old.

avpaderno’s picture

It seems there is not anymore interest in this feature, or it has already covered by another report.

mrfelton’s picture

I still have interest in it! - I have to re-patch my Drupal installs every time a new version comes out.

daemonstorm’s picture

I would love this, or a feature like this, to be included in Drupal as I'd like to be able to read the comment text without having to login to my site to see that the comment was spam or not for approval.

pp’s picture

Status: Needs work » Needs review
StatusFileSize
new4.04 KB

Please review this patch! I am afraid it's not a perfect patch, but it works.

1, Let's talk about which variables are necessary and which aren't.
2, If you see my little module that resolves this problem ( http://drupal.org/node/323325#comment-1417786 ) you see the following three lines are unnecessary because the $params['context'] included the comment data.

  // Include comment info if this is a comment
  if (isset($comment)) {
    $params['comment'] = $comment;
  }

But I think the code is nicer with it. You can use $params['comment'] instead of $params['context']['comment'].

pp

Status: Needs review » Needs work

The last submitted patch failed testing.

pp’s picture

Status: Needs work » Needs review
StatusFileSize
new4.04 KB

It work's fine, but I saw 5 "Hunk message"s.

I rerolled the patch.

Please read #12

pp

Status: Needs review » Needs work

The last submitted patch failed testing.

avpaderno’s picture

Should not it better to wait until token.module is ported into Drupal, before to proceed with this one? if Token get ported in Drupal, as it seems it is happening, this patch should be updated, and applied again.

pp’s picture

Status: Needs work » Postponed

OK. It is postponed until #113614: Add centralized token/placeholder substitution to core is in the core.

avpaderno’s picture

Title: Add Comment Variables to Send Email Action » Add comment variables to send email action
toddgee’s picture

Status: Postponed » Needs work

the item this was postponed on is complete.

I wonder how it can be ported back now that the idea is to make it dependent on 7.x feature.

Is there no way we can get this functionality back-ported to 6.x w/o doing it ourselves every time we want it? I guess we could dupe the system module email action and create one that offers the comment variables but that seems sorta' silly.

pp’s picture

llinde’s picture

Status: Needs work » Needs review

system-email-comment-body.patch queued for re-testing.

klausi’s picture

#14: 287315-2.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, 287315-2.patch, failed testing.

mcurry’s picture

Issue tags: +DrupalWTF

subscribe

Status: Needs work » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.