Skip to content

Instantly share code, notes, and snippets.

@oskarcalvo
Last active October 27, 2016 10:17
Show Gist options
  • Save oskarcalvo/d3b43b5a39c7bd751b1e4b21b449d3c9 to your computer and use it in GitHub Desktop.
Save oskarcalvo/d3b43b5a39c7bd751b1e4b21b449d3c9 to your computer and use it in GitHub Desktop.
<?php
/**
* Implement hook_action_info
* @return array array with the new actions
*/
function module_name_action_info() {
return [
'name_of_callback' => [
'label' => t('Notify after comment'),
'type' => 'comment',
'configurable' => FALSE,
'triggers' => array('comment_insert'),
],
];
}
/**
* @param object $comment
* @param array $context
* Array with components:
* - 'keywords': Keywords to look for. If the comment contains at least one
* of the keywords, it is unpublished.
*/
function name_of_callback($comment) {
//Here be dragons
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment