Download & Extend

Add comment variables to send email action

Project:Drupal core
Version:7.x-dev
Component:base system
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs work
Issue tags:DrupalWTF

Issue Summary

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

AttachmentSizeStatusTest resultOperations
system-email-comment-body.patch2.13 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch system-email-comment-body.patch.View details | Re-test

Comments

#1

Excellent - works for me.

Thank you

#2

Version:6.3» 7.x-dev

Feature request go to HEAD and then ported.

AttachmentSizeStatusTest resultOperations
system-email-comment-body-HEAD.patch2.22 KBIdleFailed: Failed to apply patch.View details | Re-test

#3

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 request» bug report

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.

AttachmentSizeStatusTest resultOperations
hidden_or_missing_variables_system.module.patch3.86 KBIdleFailed: Failed to apply patch.View details | Re-test

#4

Assigned to:llinde» Anonymous

#5

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 report» feature request
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.

#6

#7

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.

#8

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

#9

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

#10

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

#11

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.

#12

Status:needs work» needs review

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.

<?php
 
// 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

AttachmentSizeStatusTest resultOperations
287315.patch4.04 KBIdleFailed: Failed to install HEAD.View details | Re-test

#13

Status:needs review» needs work

The last submitted patch failed testing.

#14

Status:needs work» needs review

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

I rerolled the patch.

Please read #12

pp

AttachmentSizeStatusTest resultOperations
287315-2.patch4.04 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch 287315-2.patch.View details | Re-test

#15

Status:needs review» needs work

The last submitted patch failed testing.

#18

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.

#19

Status:needs work» postponed

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

#20

Title:Add Comment Variables to Send Email Action» Add comment variables to send email action

#22

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.

#23

#24

Status:needs work» needs review

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

#25

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

#26

Status:needs review» needs work

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

#29

subscribe

nobody click here