WebsiteBaker 2.13.9 is now available!
R.I.P Dietmar (luisehahne) and thank you for all your valuable work for WBhttps://forum.websitebaker.org/index.php/topic,32355.0.html
$mail_to = 'address@tosendmail.to'; $mail_subject = 'A comment has been made'; $mail_message = 'One newsitem has been commented on this page: <a href="'.$wb->page_link($page['link']).'">'.$wb->page_link($page['link']).'</a> Comment: '.$comment.'' ; $wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message);
Cool to know I can still make working code without testing
PS Will be incoörporated in articles.
Works right away John, thank you very much! I'll post a reference in the other topic.I have edited the snippet to contain a working link and the comment itself: Code: [Select] $mail_to = 'address@tosendmail.to'; $mail_subject = 'A comment has been made'; $mail_message = 'One newsitem has been commented on this page: <a href="'.$wb->page_link($page['link']).'">'.$wb->page_link($page['link']).'</a> Comment: '.$comment.'' ; $wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message);
$mail_to = 'mail1@tosendmail.to' . ', ';$mail_to .= 'mail2@tosendmail.to'; $mail_subject = 'A comment has been made'; $mail_message = '<b> One item has been commented on this page: </b> <a href="'.$wb->page_link($page['link']).'">'.$wb->page_link($page['link']).'</a> <b> Title: </b> '.$title.' <b> Comment: </b> '.$comment.'' ; $wb->mail(SERVER_EMAIL,$mail_to,$mail_subject,$mail_message);
So what must be changed to sent a notification mail to 2 email addresses?
$mail_subject = 'A comment has been made'; $mail_message = '<b> One item has been commented on this page: </b> <a href="'.$wb->page_link($page['link']).'">'.$wb->page_link($page['link']).'</a> <b> Title: </b> '.$title.' <b> Comment: </b> '.$comment.'' ; $wb->mail(SERVER_EMAIL,'mail1@tosendmail.to',$mail_subject,$mail_message); $wb->mail(SERVER_EMAIL,'mail2@tosendmail.to',$mail_subject,$mail_message);
$myMail->AddAddress($toaddress);
$toaddresses = explode(', ',$toaddress); foreach($toaddresses as $to) $myMail->AddAddress($to);
<a href="'.$wb->page_link($page['link']).'">'.$wb->page_link($page['link']).'</a>