post
https://api.sendios.io/v1/unsub//source/
API endpoint to unsubscribe the user from receiving emails.
Recent Requests
Log in to see full request history
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Loading…
Relevant for those products that have an unsubscribe page. If the user no longer wants to receive emails, they can be unsubscribed via the API endpoint, where source_id can be:
- 8 – if the user was unsubscribed due to account blocking or deletion;
- 9 – if the user unsubscribed from the product settings on their own.
Please note that it is impossible to unsubscribe from system emails.
Also, the following methods to unsubscribe can be used:
- addBySettings – if the user unsubscribed on your product's settings page;
- addByClient – if, for some reason, you unsubscribed the user in your system.
$projectId = 1;
$user = $sendios->user->getByEmail('[email protected]', $projectId);
$unsub = $sendios->unsub->addBySettings($user);
//$unsub = $sendios->unsub->addByClient($user);