Closed
Merge Request #939 · created by Ayush Jain


Implemented three condition in email sending


From EmailPopupIssue into Develop

Closed by Ayush Jain

Changes were not merged into target branch

2 participants


400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js
... ... @@ -1328,6 +1328,11 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1328 1328  
1329 1329 }
1330 1330 $scope.reportCopyStatus = false;
  1331 + $scope.reportEmailTitle = "Email Your Performance Report";
  1332 + $scope.notificationMsgWithCopy = "Your report has been sent. A copy has been emailed to you for your records.";
  1333 + $scope.sentReportMsg = "Your report has been sent.";
  1334 + $scope.invalidEmailId = "Invalid email Id";
  1335 + $scope.invalidEmailTitle = "Alert";
1331 1336 $scope.SendLabEXMailToUser = function (User) {
1332 1337  
1333 1338 var reportHtml = '';
... ... @@ -1360,7 +1365,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1360 1365 $scope.senderEmails = $("#emailTo").val();
1361 1366  
1362 1367  
1363   - LabExerciseService.LabExerciseReport(User, $scope.reportImage, $scope.reportTitle, $scope.reportCopyStatus, $scope.senderEmails).then(
  1368 + LabExerciseService.LabExerciseReport(User, $scope.reportImage, $scope.reportTitle, $scope.reportCopyStatus, $scope.senderEmails, $scope.reportEmailTitle, $scope.notificationMsgWithCopy, $scope.sentReportMsg, $scope.invalidEmailId, $scope.invalidEmailTitle).then(
1364 1369  
1365 1370 function (result) {
1366 1371 console.log(result);
... ... @@ -1372,7 +1377,7 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter,
1372 1377 // for closing email popup
1373 1378 $rootScope.closeLabExEmailModel();
1374 1379  
1375   - document.getElementById('labExEmailSentModalID').style.display = "block";
  1380 + //document.getElementById('labExEmailSentModalID').style.display = "block";
1376 1381 document.getElementById('labExModalbackground').style.display = "block";
1377 1382 }
1378 1383 $rootScope.closeLabExEmailModel = function () {
... ...
400-SOURCECODE/AIAHTML5.Web/app/services/LabExerciseService.js
... ... @@ -51,7 +51,7 @@
51 51 },
52 52  
53 53 // code of email report
54   - LabExerciseReport: function (User, reportImage, reportTitle, reportCopyStatus, senderEmail) {
  54 + LabExerciseReport: function (User, reportImage, reportTitle, reportCopyStatus, senderEmail, emailReportTitle, notiMsgWithCopy, sendMessage, invalidId, invalidIdTitle) {
55 55 User.reportImage = reportImage;
56 56 User.reportTitle = reportTitle;
57 57 User.ReportCheck = reportCopyStatus;
... ... @@ -68,11 +68,22 @@
68 68  
69 69 .success(function (data, status, headers, config) {
70 70  
71   - console.log('success')
  71 + console.log('success');
  72 +
  73 + document.getElementById('notificationTitle').innerText = emailReportTitle;
  74 + if (reportCopyStatus == true) {
  75 + document.getElementById('notificationMessage').innerText = notiMsgWithCopy;
  76 + }
  77 + else {
  78 + document.getElementById('notificationMessage').innerText = sendMessage;
  79 + }
  80 + document.getElementById('labExEmailSentModalID').style.display = "block";
72 81 deferred.resolve(data);
73 82 }).error(function (data, status, headers, config) {
74   -
75   - console.log('error')
  83 + console.log('error');
  84 + document.getElementById('notificationTitle').innerText = invalidIdTitle;
  85 + document.getElementById('notificationMessage').innerText = invalidId;
  86 + document.getElementById('labExEmailSentModalID').style.display = "block";
76 87 deferred.reject(data);
77 88 });
78 89 return deferred.promise;
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/LabExerc/lab-exercises-detail.html
... ... @@ -132,11 +132,11 @@
132 132 <div class="modal-content">
133 133 <div class="modal-header">
134 134  
135   - <h4 class="modal-title" id="myModalLabel">Email Your Performance Report</h4>
  135 + <h4 class="modal-title" id="notificationTitle"></h4>
136 136 </div>
137 137 <div class="modal-body ">
138   - <div class="modal-body" style="padding:10px;font-size:15px;">
139   - Your report has been sent. A copy has been emailed to you for your records.
  138 + <div class="modal-body" id="notificationMessage" style="padding:10px;font-size:15px;">
  139 +
140 140 </div>
141 141 </div>
142 142 <div class="modal-footer">
... ...