Guestbook notify email - using multiple addresses?

Hi, when someone posts a comment using the guestbook block we want the notifications to go to multiple email addresses. I've tried comma delimiting, and comma+space delimiting but the mails are never sent. Sending to a single email address works fine. Any advice on how to fix this?

View Replies:
Lemonbrain replied on at Permalink Reply
Unfortunatly it's not so easy possible. You need to customize the block for this functionality.

Actual it looks like this in the controller.php on line 169

if( $stringsHelper->email($this->notifyEmail) ){
   $c = Page::getCurrentPage(); 
      $ui = UserInfo::getByID($uID);
   $mh = Loader::helper('mail');
   $mh->to( $this->notifyEmail ); 
   $mh->addParameter('guestbookURL', Loader::helper('navigation')->getLinkToCollection($c, true)); 
   $mh->addParameter('comment',  $_POST['commentText'] );

first save the mailaddresses with a separator, for example ','. then split the address with this separator:
$mailaddresses = explode(",", $this->notifyEmail);

Now you can use the whole code from the beginning in a foreach and call it for every emailaddress
foreach($mailaddresses as $mailaddress){
  //Code from the beginning (use $mailaddress instead of $this->notifyEmail)

it would also be possible to use more then one
$mh->to( $this->notifyEmail );
for one mail object. But I think so it will be easier, then you need just a few adaptations.

I hope you understand what I mean, otherwise don't hesitate to ask further questions.
GrowingOld replied on at Permalink Reply
This is exactly what I am trying to do. I have tried using the code but I can't seem to get it working. I think I have the foreach loop in the wrong place. Where would that code go?
Thanks for your help

I had the end bracket in the wrong place. I now have it working.
mnakalay replied on at Permalink Reply

Are you aware that, if you modified the block directly, you will lose your modifications next time you upgrade Concrete5?

The proper way of doing it is to override the block's controller by putting a copy in blocks\guestbook and modify that one.