Skip to content

Commit 66112dc

Browse files
committed
feat(send): clear payload and idempotency key after sending
After sending an email, the payload and idempotency key are now cleared to prevent unintended reuse in subsequent requests.
1 parent cb49365 commit 66112dc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/Endpoints/EmailEndpoint.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,11 @@ public function send(): array
217217
$headers['Idempotency-Key'] = $this->idempotencyKey;
218218
}
219219

220-
return $this->httpClient->post('/v1/send', $this->payload, $headers);
220+
$result = $this->httpClient->post('/v1/send', $this->payload, $headers);
221+
222+
$this->payload = [];
223+
$this->idempotencyKey = null;
224+
225+
return $result;
221226
}
222227
}

0 commit comments

Comments
 (0)