diff --git a/src/endpoints/email.ts b/src/endpoints/email.ts index fc94ebe..b756ed2 100644 --- a/src/endpoints/email.ts +++ b/src/endpoints/email.ts @@ -338,11 +338,11 @@ export class EmailEndpoint extends Endpoint { ? { headers: { 'Idempotency-Key': this.idempotencyKeyValue } } : undefined; - const response = await this.httpClient.post('/send', this.payload, config); - - this.reset(); - - return response; + try { + return await this.httpClient.post('/send', this.payload, config); + } finally { + this.reset(); + } } /**