Skip to content

Commit

Permalink
Added html formatting to klass subscription unsubscribe endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
Joergen committed Jun 21, 2024
1 parent fb81a6a commit 44e0035
Showing 1 changed file with 24 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -533,22 +533,35 @@ public ResponseEntity<String> removeTracking(@PathVariable Long classificationId
} catch (ClientException e) {
throw new RestClientException(e.getMessage());
}
return ResponseEntity.ok("Subscription is deleted.");
}

@RequestMapping(value = "/classifications/verifyTracking/{email}/{token}", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public ResponseEntity<String> verifyTracking(@PathVariable String email, @PathVariable String token) {
try {
subscriberService.verifyTracking(email, token);
} catch (ClientException e) {
throw new RestClientException(e.getMessage());
}
return ResponseEntity.ok("""
<!DOCTYPE html>
<html>
<head><title>Klass subscription</title></head>
<body>
<header>
<h2>Klass subscription</h2>
</header>
<p>Subscription is deleted.</p>
</body>
</html>
""");
}

@RequestMapping(value = "/classifications/verifyTracking/{email}/{token}", method = RequestMethod.GET, produces = MediaType.TEXT_HTML_VALUE)
public ResponseEntity<String> verifyTracking(@PathVariable String email, @PathVariable String token) {
try {
subscriberService.verifyTracking(email, token);
} catch (ClientException e) {
throw new RestClientException(e.getMessage());
}
return ResponseEntity.ok("""
<!DOCTYPE html>
<html>
<head><title>Klass subscription</title></head>
<body>
<h2>Klass subscription</h2>
<header>
<h2>Klass subscription</h2>
</header>
<p>Subscription is verified.</p>
</body>
</html>
Expand Down

0 comments on commit 44e0035

Please sign in to comment.