|
|
@ -61,10 +61,15 @@ public class FlightReservation { |
|
|
|
status = Confirmed; |
|
|
|
} |
|
|
|
|
|
|
|
public boolean notifyUser(String type, String email, String content) { |
|
|
|
public boolean notifyUser(String type, String to, String content) { |
|
|
|
Notification notification = null; |
|
|
|
switch (type) { |
|
|
|
case "email": notification = new EmailNotification(email, content); |
|
|
|
case "email": |
|
|
|
notification = new EmailNotification(to, content); |
|
|
|
break; |
|
|
|
case "sms": |
|
|
|
notification = new SmsNotification(to, content); |
|
|
|
break; |
|
|
|
} |
|
|
|
return notification.sendNotification(); |
|
|
|
} |
|
|
|