Hey everyone,
I'm working on building an action that fires off an email to interested users (editors) based on taxonomy of a post whenever that post gets commented on. The email would alert the editor that there is a new comment in the comment queue that needs to be approved/edited/deleted etc. I was wondering if there was a simple way to include the approve link into an email.

The set up of the approval link, I've noticed, is http://www.mysite.site/comment/118/approve?token=(token), but I can't figure out a way to get the token for this link. It appears to be a consistent token for each link (so comment 188's token remains constant, but is different from comment 155), but using drupal_get_token("comment/".commentID."/approve") dosn't seem to work.

Any help anyone could give would be, well, helpful.

Comments

dzescsd’s picture

suscribe

jjma’s picture

Any luck with this?

Jance’s picture

No, I ended up making a link that would send a user to the comment where they could then approve/disapprove it. The link would also detect if the user was logged in or not, if they were not it would redirect them to a log in screen, and then back to the comment once approved.

To do that I used the menu hook.

geerlingguy’s picture

I also wanted to figure out a simple way to do this, but since drupal_get_token() uses session_id() internally as part of its token generation scheme, the token is specific to the user posting the comment. In this case, since you're not approving your own comments, the token will never be correct for your user account.

__________________
Personal site: www.jeffgeerling.com