public boolean updateEmailsOnPush ( Integer projectId , String emailAddress ) throws IOException { GitlabServiceEmailOnPush emailOnPush = this . getEmailsOnPush ( projectId ) ; GitlabEmailonPushProperties properties = emailOnPush . getProperties ( ) ; String appendedRecipients = properties . getRecipients ( ) ; if ( appendedRecipients != "" ) { if ( appendedRecipients . contains ( emailAddress ) ) return true ; appendedRecipients = appendedRecipients + " " + emailAddress ; } else appendedRecipients = emailAddress ; Query query = new Query ( ) . appendIf ( "active" , true ) . appendIf ( "recipients" , appendedRecipients ) ; String tailUrl = GitlabProject . URL + "/" + projectId + GitlabServiceEmailOnPush . URL + query . toString ( ) ; return retrieve ( ) . method ( PUT ) . to ( tailUrl , Boolean . class ) ; }
Update recipients for email - on - push service for a projectId .