I am using Drupal-5.7; i have created one custom module; on creation of a node one mail will be thrown to the admin user as a notification. i have used drupal_mail() function for throwing mail; but i am not able to send the URL's (HTML link).
Following is my code:
function custom_nodeapi(&$node, $op, $a3 = NULL, $a4 = NULL) {
switch ($op) {
case 'insert':
case 'update':
if ($node->type == 'page') {
custom_email($node);
}
break;
}
}
function custom_email($node){
$headers['Content-Type'] = "text/html; charset=utf-8";
$to = 'admin@mysite.com';
$subject = 'new content has been posted';
$from = 'tech@mysite.com'
// Send the e-mail to the recipients:
$node_url = l($node->title,'node/'.$node->nid);
$body = variable_get('New Content !node_url has been arrived to your site', '');
drupal_mail('custom_email_form',$to, $subject, t($body, array('!node_url' => $node_url)),$from,$headers);
}
**************************************
But this is not working;
Out-put i have received:
New Content First Page [1] has been arrived to your site.
[1] http://www.abc.com/First-page
**************************************
result should be like this:
New Content First Page has been arrived to your site.
"First Page" should be URL and point to http://www.abc.com/First-page
Help would be appreciated.
Thanks.