Skip to content

Instantly share code, notes, and snippets.

@alancoleman
Last active December 24, 2015 09:39
Show Gist options
  • Save alancoleman/6779129 to your computer and use it in GitHub Desktop.
Save alancoleman/6779129 to your computer and use it in GitHub Desktop.
Send a simple mail from Drupal 6 using drupal_mail hook
<?php
drupal_mail( 'control_centre_feed', 'feed', '[email protected]', language_default(), $params, '[email protected]');
function control_centre_feed_mail ($key, &$message, $params) {
switch ($key) {
case 'feed':
$message['subject'] = t($params['filename']);
$message['body'][] = t($params['filepath']);
break;
}
drupal_set_message( $params['filename'] );
drupal_set_message( 'Email sent to:' . $message['to'] . '' );
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment