Commit 351ab87a29b47b006c1e0c41da4b3a41acfca11f
1 parent
f86d3f3d
implemented multiple email functionality
Showing
3 changed files
with
24 additions
and
16 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... | ... | @@ -1290,7 +1290,8 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
1290 | 1290 | } |
1291 | 1291 | $scope.reportCopyStatus = false; |
1292 | 1292 | $scope.SendLabEXMailToUser = function (User) { |
1293 | - console.log(User); | |
1293 | + | |
1294 | + | |
1294 | 1295 | // html2canvas($("#submitResultHtml"), { |
1295 | 1296 | // onrendered: function (canvas) { |
1296 | 1297 | // var dataURL = canvas.toDataURL("image/jpeg"); |
... | ... | @@ -1316,10 +1317,12 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, |
1316 | 1317 | htm += '</tbody></table>'; |
1317 | 1318 | $scope.reportImage = "<table style='width:100%;'><tr><td style='padding:15px;'><strong>"+$("#submitResultHtml .panel-heading .row div:nth-child(1)").text()+"</strong></td><td style='padding:15px;'>Performance Report</td><td style='padding:15px;text-align:right;'><span>" + $("#submitResultHtml .panel-heading .row div:nth-child(3)").text() + "</span></td></tr></table><table style='width:100%;'><thead><th style='text-align:center;padding:15px;border:1px solid #cccccc;'><strong>Total Question</strong></th><th style='border:1px solid #cccccc;text-align:center;padding:15px;'><strong>Correct Answers</strong></th><th style='border:1px solid #cccccc;padding:15px;text-align:center;'><strong>Incorrect Answers</strong></th></thead><tr><td style='border:1px solid #cccccc;padding:15px;text-align:center;'><span>" + $("#questionStatus tbody tr td:nth-child(1)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(2)").text() + "</span></td><td style='text-align:center;border:1px solid #cccccc;padding:15px;'><span>" + $("#questionStatus tbody tr td:nth-child(3)").text() + "</span></td></tr></table><br/><br/>" + htm + ""; |
1318 | 1319 | $scope.reportTitle = "Lab Exercise Report for " + $("#submitResultHtml .panel-heading .row div:nth-child(1)").text(); |
1319 | - // } | |
1320 | + $scope.senderEmails = $("#emailTo").val(); | |
1321 | + | |
1322 | + // } | |
1320 | 1323 | // }); |
1321 | 1324 | |
1322 | - LabExerciseService.LabExerciseReport(User, $scope.reportImage, $scope.reportTitle, $scope.reportCopyStatus).then( | |
1325 | + LabExerciseService.LabExerciseReport(User, $scope.reportImage, $scope.reportTitle, $scope.reportCopyStatus, $scope.senderEmails).then( | |
1323 | 1326 | |
1324 | 1327 | function (result) { |
1325 | 1328 | console.log(result); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js
... | ... | @@ -51,10 +51,11 @@ |
51 | 51 | }, |
52 | 52 | |
53 | 53 | // code of email report |
54 | - LabExerciseReport: function (User, reportImage, reportTitle, reportCopyStatus) { | |
54 | + LabExerciseReport: function (User, reportImage, reportTitle, reportCopyStatus, senderEmail) { | |
55 | 55 | User.reportImage = reportImage; |
56 | 56 | User.reportTitle = reportTitle; |
57 | 57 | User.ReportCheck = reportCopyStatus; |
58 | + User.EmailTo = senderEmail; | |
58 | 59 | var deferred = $q.defer(); |
59 | 60 | // var jsonData = { 'EmailTo': User.EmailTo, 'EmailAdd': User.EmailAdd }; |
60 | 61 | $http.post('http://192.168.90.19:91/API/api/LabExercise/SendEmail', JSON.stringify(User), { |
... | ... | @@ -66,11 +67,11 @@ |
66 | 67 | }) |
67 | 68 | |
68 | 69 | .success(function (data, status, headers, config) { |
69 | - debugger; | |
70 | + | |
70 | 71 | console.log('success') |
71 | 72 | deferred.resolve(data); |
72 | 73 | }).error(function (data, status, headers, config) { |
73 | - debugger; | |
74 | + | |
74 | 75 | console.log('error') |
75 | 76 | deferred.reject(data); |
76 | 77 | }); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html
... | ... | @@ -30,24 +30,26 @@ |
30 | 30 | <div class="modal-body paddTop15"> |
31 | 31 | <div class="modal-body paddTop15"> |
32 | 32 | |
33 | - <form class="form-horizontal" name="LabExForm" id="LabExerciseForm" ng-submit="LabExForm.$valid && SendLabEXMailToUser(User)"> | |
33 | + <form class="form-horizontal" name="LabExForm" id="LabExerciseForm" ng-submit="SendLabEXMailToUser(User)"> | |
34 | 34 | <div class="form-group"> |
35 | 35 | <div class="col-sm-5 control-label"> |
36 | 36 | <label>*Email To: (Email address)</label> |
37 | 37 | </div> |
38 | - <div class="col-sm-7"> | |
39 | - <input type="text" class="form-control" name="senderEmail" ng-model="User.EmailTo" ng-pattern="/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/" required="required" /> | |
40 | - <div class="help-block">*Use ';' to separate multiple email ids. </div> | |
41 | - <div class="help-block" style="color:red;" ng-if="LabExForm.senderEmail.$error.pattern">Please Enter valid Email Address</div> | |
38 | + | |
39 | + <div class="col-sm-7"> | |
40 | + <!--<input type="email" class="form-control" name="senderEmail" ng-model="User.EmailTo" required="required" />--> | |
41 | + <input type="email" name="usremail" class="form-control" required="required" id="emailTo" multiple /> | |
42 | + <div class="help-block">*Use ',' to separate multiple email ids. </div> | |
43 | + <!--<div class="help-block" style="color:red;" ng-if="LabExForm.senderEmail.$error.pattern">Please Enter valid Email Address</div>--> | |
44 | + </div> | |
42 | 45 | </div> |
43 | - </div> | |
44 | 46 | |
45 | 47 | <div class="form-group"> |
46 | 48 | <div class="col-sm-5 control-label"> |
47 | 49 | <label>*Your name:</label> |
48 | 50 | </div> |
49 | 51 | <div class="col-sm-7"> |
50 | - <input type="text" name="name" class="form-control" ng-model="User.Name" ng-pattern="/^[a-zA-Z]+$/" required="required" /> | |
52 | + <input type="text" name="name" class="form-control" ng-model="User.Name" ng-pattern="/^([a-zA-Z]+\s?)*$/" required="required" /> | |
51 | 53 | <div class="help-block" style="color:red;" ng-if="LabExForm.name.$error.pattern"> Please enter your Name</div> |
52 | 54 | <!--<div class="help-block" style="color:red;" id="nameHelpBlock"> Please Enter your Name </div>--> |
53 | 55 | </div> |
... | ... | @@ -58,9 +60,11 @@ |
58 | 60 | <label for="">*Your Email Address:</label> |
59 | 61 | </div> |
60 | 62 | <div class="col-sm-7"> |
61 | - <input type="text" class="form-control" name="receiverEmail" ng-model="User.EmailAdd" ng-pattern="/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/" required="required" /> | |
63 | + <!--<input type="text" class="form-control" name="receiverEmail" ng-model="User.EmailAdd" ng-pattern="/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/" required="required" />--> | |
64 | + <input type="email" class="form-control" name="receiverEmail" ng-model="User.EmailAdd" required="required" /> | |
65 | + | |
62 | 66 | <!--<div class="help-block" style="color:red;" id="emailHelpBlock"> Please Enter your Email Address </div>--> |
63 | - <div class="help-block" style="color:red;" ng-if="LabExForm.receiverEmail.$error.pattern"> Please Enter valid Email Address</div> | |
67 | + <!--<div class="help-block" style="color:red;" ng-if="LabExForm.receiverEmail.$error.pattern"> Please Enter valid Email Address</div>--> | |
64 | 68 | </div> |
65 | 69 | </div> |
66 | 70 | |
... | ... | @@ -69,7 +73,7 @@ |
69 | 73 | <label for="">Send me a copy of the report</label> |
70 | 74 | </div> |
71 | 75 | <div class="col-sm-7"> |
72 | - <input type="checkbox" style="margin-top: 12px;" ng-model="User.ReportCheck" ng-init="User.ReportCheck = false" /> | |
76 | + <input type="checkbox" style="margin-top: 12px;" ng-model="reportCopyStatus" /> | |
73 | 77 | </div> |
74 | 78 | </div> |
75 | 79 | ... | ... |