Only "may_email_receipt == true" if the email address is valid
authorMike Rylander <mrylander@gmail.com>
Fri, 5 Aug 2016 16:19:43 +0000 (12:19 -0400)
committerMike Rylander <mrylander@gmail.com>
Fri, 5 Aug 2016 16:19:43 +0000 (12:19 -0400)
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Open-ILS/web/js/ui/default/staff/circ/patron/checkout.js

index 765f25f..b7f9490 100644 (file)
@@ -52,10 +52,13 @@ function($scope , $q , $routeParams , egCore , egUser , patronSvc ,
     }
 
     $scope.may_email_receipt = function() {
-        return setting_value(
-            patronSvc.current,
-            'circ.send_email_checkout_receipts'
-        ) == 'true';
+        return (
+            $scope.has_email_address() &&
+            setting_value(
+                patronSvc.current,
+                'circ.send_email_checkout_receipts'
+            ) == 'true'
+        );
     }
 
     $scope.using_hatch = egCore.hatch.usingHatch();