문서로 건너뛰기
Java

client.outOfOffice()

이 네임스페이스의 모든 메서드: 시그니처, 매개변수, 반환값과 예시.

메서드

The automatic reply an address sends while its owner is away: read the replies saved in the workspace, set one for an address or a catch-all with its dates, subject and message, and remove it.

outOfOffice().list

Read out of office replies

범위settings:read
시그니처
List<Map<String, Object>> list(RequestOptions options)

Returns every out of office reply saved in the workspace, by address. With address the list holds exactly one row, the reply of that address, which has enabled set to false and empty text when none was ever saved.

active says whether the reply is going out right now: it is on, the start has passed and the end has not. An address is one address, such as [email protected], or *@example.com for the catch-all of a domain.

매개변수

options.addressString

One address, such as [email protected], or *@example.com for the catch-all of a domain. Left out, every reply saved in the workspace.

options.apiKeyString

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

반환값

A list of maps, each with object set to out_of_office, address, enabled, active, startsAt, endsAt, subject, message, contactsOnly and updatedAt. startsAt and updatedAt are null on an address that never saved a reply, and a null endsAt keeps the reply on until it is switched off.

예시

List<Map<String, Object>> replies = client.outOfOffice().list(); for (Map<String, Object> outOfOffice : replies) {    System.out.println(outOfOffice.get("subject") + " " + outOfOffice.get("address"));}

참고

  • A key or an app limited to particular addresses or domains lists only the replies of the addresses it holds, and of a catch-all only when it holds the domain whole. Naming an address it does not hold is a 422 capability_unsupported.

  • A whole domain, written @example.com, is a 422 invalid_parameter on address, because a reply is set on one address or on a catch-all.

  • Read only, so the SDK retries it after a network failure like any other read.

다른 사용처

API
GET /out-of-office
TypeScript
outOfOffice.list()
Python
out_of_office.list()
Ruby
out_of_office.list
PHP
outOfOffice->list
Go
OutOfOffice.List
C#
OutOfOffice.ListAsync
CLI
openemail out-of-office list

outOfOffice().set

Set an out of office reply

범위settings:write
시그니처
Map<String, Object> set(String address, Map<String, Object> body, RequestOptions options)

Saves the out of office reply of one address, or of a catch-all with *@example.com, replacing whatever was saved. While it is active, each person who writes to the address gets the message once for the whole away period, as a reply in the same thread. Mail that would not alert anyone gets no reply: spam, mail a rule filed away, newsletters and other bulk mail, automatic mail, bounces, blocked senders and the workspace's own addresses. With contactsOnly, only people in the contacts, or people the workspace has written to, are answered.

Leave startsAt out to start now, and endsAt out or null to keep it on until it is switched off. Both take an Instant or an ISO 8601 string with an offset, and the SDK sends an Instant as an ISO 8601 instant in UTC. An address with a reply of its own is never answered by the catch-all. Replies count toward the monthly sends, carry no tracking, and still go out on muted threads.

매개변수

addressString필수

One address, such as [email protected], or *@example.com for the catch-all of a domain. A key or an app limited to particular addresses or domains reaches only the addresses it holds, and a catch-all only when it holds the domain whole.

body.messageString필수

The reply, as plain text, 1 to 10,000 characters once trimmed. Line breaks are kept.

body.subjectString

The subject of the reply, at most 255 characters. Left out or empty, the reply answers with Re: and the subject received.

body.enabledboolean

Whether the reply is switched on. Left out, true. false keeps the text and pauses the reply.

body.startsAtInstant or String or null

When the reply starts. Left out or null, now.

body.endsAtInstant or String or null

When it stops, later than startsAt. Left out or null, it stays on until it is switched off.

body.contactsOnlyboolean

Answer only contacts and people the workspace has written to. Left out, false.

options.apiKeyString

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

반환값

A map, the reply read back as it is stored, with object set to out_of_office, address, enabled, active, startsAt, endsAt, subject, message, contactsOnly and updatedAt. active says whether mail arriving now is answered.

예시

Map<String, Object> reply = client.outOfOffice().set("[email protected]", Body.of(    "startsAt", "2026-12-22T00:00:00.000Z",    "endsAt", "2027-01-04T08:00:00.000Z",    "subject", "Away until 4 January",    "message", "I am away until 4 January and will answer when I am back.",    "contactsOnly", true)); System.out.println(reply.get("address") + " " + reply.get("active") + " " + reply.get("endsAt"));

참고

  • It replaces the whole reply, so a field left out goes back to its default instead of keeping what was saved. Send the full reply each time.

  • An address that is not in the workspace or names a whole domain, an empty message, and an endsAt that is not after startsAt or is already in the past are each a 422 invalid_parameter. A key or an app that does not hold the address gets a 422 capability_unsupported.

  • The SDK retries this call after a network failure, which is safe because saving the same reply twice leaves the same reply.

다른 사용처

API
PUT /out-of-office
TypeScript
outOfOffice.set()
Python
out_of_office.set()
Ruby
out_of_office.set
PHP
outOfOffice->set
Go
OutOfOffice.Set
C#
OutOfOffice.SetAsync
CLI
openemail out-of-office set

outOfOffice().clear

Remove an out of office reply

범위settings:write
시그니처
Map<String, Object> clear(String address, RequestOptions options)

Removes the saved reply of one address or catch-all, so nothing is answered from it any more. Removing a reply that was never saved changes nothing, which is why the SDK retries this call.

To pause a reply and keep its text, save it with "enabled", false through set instead.

매개변수

addressString필수

One address, such as [email protected], or *@example.com for the catch-all of a domain. A key or an app limited to particular addresses or domains reaches only the addresses it holds, and a catch-all only when it holds the domain whole.

options.apiKeyString

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

반환값

A map with object set to out_of_office, address and deleted set to true.

예시

Map<String, Object> removed = client.outOfOffice().clear("[email protected]"); System.out.println(removed.get("address") + " " + removed.get("deleted"));

참고

  • A whole domain, written @example.com, is a 422 invalid_parameter on address. A key or an app that does not hold the address gets a 422 capability_unsupported.

  • Removing the reply of a catch-all leaves the replies of single addresses on that domain as they are.

다른 사용처

API
DELETE /out-of-office
TypeScript
outOfOffice.clear()
Python
out_of_office.clear()
Ruby
out_of_office.clear
PHP
outOfOffice->clear
Go
OutOfOffice.Clear
C#
OutOfOffice.ClearAsync
CLI
openemail out-of-office clear