Skip to content

Commit

Permalink
Issue 435 - Customer note notification : Dont send notification email…
Browse files Browse the repository at this point in the history
… if customer has no email (#436)

* [IM] - Customer note notification : Dont send notification email if customer has no email - fixes #435

* [IM] - Customer note notification : Dont send notification email if customer has no email - fixes #435

* [IM] - Customer note notification : Dont send notification email if customer has no email - fixes #435
  • Loading branch information
yannrobin authored and barryo committed Jul 13, 2018
1 parent ead1e81 commit 5183753
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Listeners/Customer/Note/EmailOnChange.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,10 @@ public function handle( $e )
continue;
}

if( !$user->getContact()->getEmail() || filter_var( $user->getContact()->getEmail() , FILTER_VALIDATE_EMAIL ) === false ) {
continue;
}

if( !$user->getPreference( "customer-notes.notify" ) || $user->getPreference( "customer-notes.notify" ) == "default" || $user->getPreference( "customer-notes.notify" ) == "all" ) {
$to[] = [ 'name' => $user->getContact()->getName(), 'email' => $user->getContact()->getEmail() ];
continue;
Expand Down

0 comments on commit 5183753

Please sign in to comment.