Class ModeratorNotificationService

java.lang.Object
edu.ucsb.cs156.dining.services.ModeratorNotificationService

@Service public class ModeratorNotificationService extends Object
Emails all moderators when a review needs moderation. The email is sent through the Gmail API from the account of the logged-in user who submitted the review, using their OAuth token (this requires the gmail.send scope).

Sending is best effort: any failure is logged and never stops the review from being saved.

  • Field Details

  • Constructor Details

    • ModeratorNotificationService

      public ModeratorNotificationService(org.springframework.security.oauth2.client.OAuth2AuthorizedClientService authorizedClientService, ModeratorRepository moderatorRepository, org.springframework.boot.web.client.RestTemplateBuilder restTemplateBuilder)
  • Method Details

    • notifyModerators

      public void notifyModerators(Review review)
      Emails all moderators that a review needs moderation. Never throws.
      Parameters:
      review - the review that was just submitted