Belgelere geç
PHP

$client->sending

Bu ad alanındaki her yöntem: imzası, parametreleri, döndürdüğü değer ve bir örnek.

Yöntemler

How mail leaves the workspace: the two lanes it travels in, transactional for app mail and broadcast for newsletters, each with its bounce and complaint numbers, the switch that resumes a paused lane, and the dedicated IPs of a workspace that bought one.

sending->listStreams

List the sending lanes

Kapsamlaremails:read
İmza
listStreams(?string $apiKey = null): array

Returns the two lanes mail travels in, transactional for app mail such as password resets, receipts and codes, and broadcast for newsletters, each with its state and its numbers for the last 7 days: recipients, bounced and complained, the two rates, and the limits the broadcast lane is held to. The lanes have their own queues and their own reputation, so a newsletter never holds up or harms app mail.

The broadcast lane pauses itself when more than 4% of its recipients bounced or more than 0.2% reported the mail as spam over those 7 days, once it reached enough recipients to judge. A paused lane says when and why in pausedAt and pausedReason, and app mail keeps going out. The count starts again when a lane is resumed, which resumedAt gives.

Parametreler

apiKeystring

Overrides the client's API key for this call only.

Döndürür

An array with one array per lane in data: stream, status, pausedAt, pausedReason, resumedAt, window and limits.

Örnek

$lanes = $client->sending->listStreams(); foreach ($lanes['data'] as $lane) {    echo $lane['stream'], ' ', $lane['status'], ' ', $lane['window']['bounceRate'], ' ', $lane['window']['complaintRate'], PHP_EOL;}

Notlar

  • Only the broadcast lane pauses. The transactional lane is always active. The values are in OpenEmail\Constants\SendStreams and OpenEmail\Constants\SendingStreamStatuses.

  • A GET is retried automatically on network failure and on 408, 429, 500, 502, 503 and 504 responses, up to the client's maxRetries.

Şurada da var

API
GET /sending/streams
TypeScript
sending.listStreams()
Python
sending.list_streams()
Ruby
sending.list_streams
Go
Sending.ListStreams
Java
sending().listStreams
C#
Sending.ListStreamsAsync
CLI
openemail sending list-streams

sending->resumeStream

Resume a paused lane

Kapsamlardomains:write
İmza
resumeStream(string $stream, ?string $apiKey = null): array

Resumes the broadcast lane after it was paused for too many bounces or complaints, as Resume does on the Analytics page of the app. Broadcasts and messages that were on hold continue at once, and the 7 day count starts again from now, so clean the audience first: a lane resumed onto the same list pauses again.

Only the workspace owner may do it: an API key acts for the owner, and an access token that acts for a member is 403 owner_only.

Parametreler

streamstringZorunlu

The lane to resume, broadcast, as in OpenEmail\Constants\SendStreams. The transactional lane never pauses.

apiKeystring

Overrides the client's API key for this call only.

Döndürür

An array with the lane, now with status active and resumedAt set.

Örnek

use OpenEmail\Constants\SendStreams; $lane = $client->sending->resumeStream(SendStreams::BROADCAST); echo $lane['status'], ' since ', $lane['resumedAt'], PHP_EOL;

Notlar

  • With an OAuth access token it asks for a verification code: until the app has verified one, it is refused with 403 step_up_required. An API key is never asked.

  • A lane that is not paused is 409 stream_not_paused.

  • The SDK does not retry it.

Şurada da var

API
POST /sending/streams/{stream}/resume
TypeScript
sending.resumeStream()
Python
sending.resume_stream()
Ruby
sending.resume_stream
Go
Sending.ResumeStream
Java
sending().resumeStream
C#
Sending.ResumeStreamAsync
CLI
openemail sending resume-stream

sending->listDedicatedIps

List dedicated IPs

Kapsamlardomains:read
İmza
listDedicatedIps(?string $apiKey = null): array

Returns the dedicated sending IPs of the workspace, bought as an add-on with billing->startAddOnCheckout. A new IP is warmed up over several weeks: warmupPercent says how far it is, and until it reaches 100 part of the mail still leaves through the shared IPs, so nothing is held back while it warms. status is warming until then and ready after.

A workspace without the add-on gets an empty data list and sends through the shared IPs.

Parametreler

apiKeystring

Overrides the client's API key for this call only.

Döndürür

An array with one array per IP in data: ip, status, pool, poolStatus, warmupPercent, assignedAt, readyAt and checkedAt.

Örnek

$addresses = $client->sending->listDedicatedIps(); foreach ($addresses['data'] as $address) {    echo $address['ip'], ' ', $address['status'], ' ', $address['warmupPercent'], '%', PHP_EOL;}

Notlar

  • The warm-up is read from the sending service every few minutes, and checkedAt says when.

  • A GET is retried automatically on network failure and on 408, 429, 500, 502, 503 and 504 responses, up to the client's maxRetries.

Şurada da var

API
GET /sending/dedicated-ips
TypeScript
sending.listDedicatedIps()
Python
sending.list_dedicated_ips()
Ruby
sending.list_dedicated_ips
Go
Sending.ListDedicatedIPs
Java
sending().listDedicatedIps
C#
Sending.ListDedicatedIpsAsync
CLI
openemail sending list-dedicated-ips

sending->getDedicatedIp

Read a dedicated IP

Kapsamlardomains:read
İmza
getDedicatedIp(string $ip, ?string $apiKey = null): array

Returns one dedicated IP of the workspace with its status and how far its warm-up has come.

Parametreler

ipstringZorunlu

The IP address, as listDedicatedIps returns it, such as 203.0.113.24.

apiKeystring

Overrides the client's API key for this call only.

Döndürür

An array with ip, status, pool, poolStatus, warmupPercent, assignedAt, readyAt and checkedAt.

Örnek

$address = $client->sending->getDedicatedIp('203.0.113.24'); echo $address['status'], ' ', $address['warmupPercent'], '%', PHP_EOL;

Notlar

  • An IP that does not belong to the workspace is a 404 resource_not_found.

  • A GET is retried automatically on network failure and on 408, 429, 500, 502, 503 and 504 responses, up to the client's maxRetries.

Şurada da var

API
GET /sending/dedicated-ips/{ip}
TypeScript
sending.getDedicatedIp()
Python
sending.get_dedicated_ip()
Ruby
sending.get_dedicated_ip
Go
Sending.GetDedicatedIP
Java
sending().getDedicatedIp
C#
Sending.GetDedicatedIpAsync
CLI
openemail sending get-dedicated-ip