-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotificationApp.java
27 lines (27 loc) · 1.14 KB
/
NotificationApp.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
public class NotificationApp {
private Notification notification;
/**
* Initialises Notification application (to allow for notification of successful course allocation for a student)
* @param notification
*/
public NotificationApp(Notification notification) {
this.notification=notification;
}
/**
* Notification message created to notify student when a course gets allocated to him/her
* @param student
* @param indexNum
*/
public void courseAllocated(Student student,int indexNum){
ClassIndex classIndex = UniDataBase.findClassIndex(indexNum);
String messageSubject = "Course Allocated";
String messageContent = "Name:"+student.getName() +
"\nMatric No.: " + student.getMatricNo() +
"\nWe are pleased to inform you that you have been allocated the following course: "+
"\nCourse Code: " + classIndex.getCourseCode() +
"\nCourse Name: " + classIndex.getCourseName() +
"\nCourse Index: " + classIndex.getIndexNum() +
"\n\nRegards\nAdmin of MySTARS\n\nThis is a computer-generated document, no signature is required.";
notification.sendNotification(student, messageSubject, messageContent);
}
}