@@ -12,6 +12,7 @@ import {BackendUserCreate} from "./BackendUserCreate";
1212import { BackendUserUpdate } from "./BackendUserUpdate" ;
1313import { CommonMessage } from "./CommonMessage" ;
1414import { CommonMessageException } from "./CommonMessageException" ;
15+ import { Passthru } from "./Passthru" ;
1516
1617export class BackendUserTag extends TagAbstract {
1718 /**
@@ -153,6 +154,42 @@ export class BackendUserTag extends TagAbstract {
153154
154155 throw new UnknownStatusCodeException ( 'The server returned an unknown status code: ' + statusCode ) ;
155156 }
157+ /**
158+ * Resend the activation mail to the provided user
159+ *
160+ * @returns {Promise<CommonMessage> }
161+ * @throws {CommonMessageException }
162+ * @throws {ClientException }
163+ */
164+ public async resend ( userId : string , payload : Passthru ) : Promise < CommonMessage > {
165+ const url = this . parser . url ( '/backend/user/$user_id<[0-9]+|^~>/resend' , {
166+ 'user_id' : userId ,
167+ } ) ;
168+
169+ let request : HttpRequest = {
170+ url : url ,
171+ method : 'POST' ,
172+ headers : {
173+ 'Content-Type' : 'application/json' ,
174+ } ,
175+ params : this . parser . query ( {
176+ } , [
177+ ] ) ,
178+ data : payload
179+ } ;
180+
181+ const response = await this . httpClient . request ( request ) ;
182+ if ( response . ok ) {
183+ return await response . json ( ) as CommonMessage ;
184+ }
185+
186+ const statusCode = response . status ;
187+ if ( statusCode >= 0 && statusCode <= 999 ) {
188+ throw new CommonMessageException ( await response . json ( ) as CommonMessage ) ;
189+ }
190+
191+ throw new UnknownStatusCodeException ( 'The server returned an unknown status code: ' + statusCode ) ;
192+ }
156193 /**
157194 * Updates an existing user
158195 *
0 commit comments