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
| Comment | File | Size | Author |
|---|---|---|---|
| #14 | 287315-2.patch | 4.04 KB | pp |
| #12 | 287315.patch | 4.04 KB | pp |
| #3 | hidden_or_missing_variables_system.module.patch | 3.86 KB | pp |
| #2 | system-email-comment-body-HEAD.patch | 2.22 KB | lilou |
| system-email-comment-body.patch | 2.13 KB | llinde |
Comments
Comment #1
mrfelton commentedExcellent - works for me.
Thank you
Comment #2
lilou commentedFeature request go to HEAD and then ported.
Comment #3
pp commentedIt 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.
Comment #4
pp commentedComment #5
Anonymous (not verified) commented@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.
Comment #6
pp commentedI do it.
http://drupal.org/node/323325
pp
Comment #7
gábor hojtsyWell, 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.
Comment #8
mitchell commentedJust ran across this issue while searching. Bumping cause it's old.
Comment #9
avpadernoIt seems there is not anymore interest in this feature, or it has already covered by another report.
Comment #10
mrfelton commentedI still have interest in it! - I have to re-patch my Drupal installs every time a new version comes out.
Comment #11
daemonstorm commentedI 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.
Comment #12
pp commentedPlease 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.
But I think the code is nicer with it. You can use $params['comment'] instead of $params['context']['comment'].
pp
Comment #14
pp commentedIt work's fine, but I saw 5 "Hunk message"s.
I rerolled the patch.
Please read #12
pp
Comment #18
avpadernoShould 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.
Comment #19
pp commentedOK. It is postponed until #113614: Add centralized token/placeholder substitution to core is in the core.
Comment #20
avpadernoComment #22
toddgee commentedthe 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.
Comment #23
pp commentedUse BlogAid (http://ftp.drupal.org/files/projects/blogaid-6.x-2.x-dev.tar.gz) or mini module http://drupal.org/node/323325#comment-1417786
pp
Comment #24
llinde commentedsystem-email-comment-body.patch queued for re-testing.
Comment #25
klausi#14: 287315-2.patch queued for re-testing.
Comment #29
mcurry commentedsubscribe