コンテンツにスキップ

このイベントのメールを標準か専用に切り替える

PUT
/api/v1/events/{id}/emails/mode
curl --request PUT \
--url https://app.goyoka.com/api/v1/events/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/emails/mode \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "kind": "BOOKING_CONFIRMATION", "mode": "STANDARD", "recopy_from_standard": true }'

種類ごとに「お店の標準のとおり(STANDARD)」と「このイベント専用(CUSTOM)」を切り替えます。管理画面のイベントの「メール」と同じ処理です。対象は予約確認(BOOKING_CONFIRMATION)・リマインド(BOOKING_REMINDER)・サンクスメール(THANK_YOU)・フォローアップ(FOLLOW_UP)の4種類です。キャンセルや入金のお知らせなどの手続きのメールは、どのイベントも標準で送ります。

はじめて CUSTOM にすると、その時点の標準の文面をこのイベント専用に写します(前に作った専用の文面が残っていればそれを使います)。写したあとに標準を直しても、専用には届きません。STANDARD に戻しても専用の文面は消えません。

recopy_from_standard:true は専用の文面を標準で上書きし直すので、専用で直した文面が失われます。

切り替えたあとの4種類の状態を返します。専用の文面は custom[].id を email_templates_update に渡して直します。アーカイブ済み・他店・不明なイベントは404、recopy_from_standard を mode:STANDARD と一緒に送ると422 VALIDATION⁠です。

必要な範囲: events:write

id
必須
string 形式: uuid

ヘッダーのパラメータ

「ヘッダーのパラメータ」の節へ
Idempotency-Key
string

同じ内容の再送に同じ値を使います。異なる内容との再利用や処理中の再送は409 IDEMPOTENCY_KEY_REUSED⁠です。

メディアタイプapplication/json
object
kind
必須
string
取りうる値: BOOKING_CONFIRMATION BOOKING_REMINDER THANK_YOU FOLLOW_UP
mode
必須
string
取りうる値: STANDARD CUSTOM
recopy_from_standard

mode:CUSTOM のときだけ。true で、専用の文面をいまの標準の文面と送る時刻で上書きし直します(専用で直した文面は失われます)。

boolean

このイベントのメールを標準か専用に切り替える

メディアタイプapplication/json
object
data
必須
Array<object>
object
kind
必須
string
取りうる値: BOOKING_CONFIRMATION BOOKING_REMINDER THANK_YOU FOLLOW_UP
mode
必須

STANDARD はお店の標準の文面(設定のメール)で送り、CUSTOM はこのイベント専用の文面(custom)で送ります。

string
取りうる値: STANDARD CUSTOM
standard
必須

お店の標準のイベント用の文面。直すとすべてのイベントに効きます。

Array<object>
object
id
必須
string 形式: uuid
kind
必須
string
scope
必須
string
booking_kind
必須
string
subject
必須
string
body
必須
string
enabled
必須
boolean
anchor
必須
string
offset_minutes
必須
number
send_at_local_time
必須
string | null
target_service_ids
必須
Array<string>
is_custom
必須
boolean
sort_order
必須
number
tab
必須
string
取りうる値: session event inquiry
created_at
必須
string 形式: date-time
updated_at
必須
string 形式: date-time
custom
必須

このイベント専用の文面。STANDARD に戻しても残り、もう一度 CUSTOM にするとこの文面に戻ります。

Array<object>
object
id
必須
string 形式: uuid
kind
必須
string
scope
必須
string
booking_kind
必須
string
subject
必須
string
body
必須
string
enabled
必須
boolean
anchor
必須
string
offset_minutes
必須
number
send_at_local_time
必須
string | null
target_service_ids
必須
Array<string>
is_custom
必須
boolean
sort_order
必須
number
tab
必須
string
取りうる値: session event inquiry
created_at
必須
string 形式: date-time
updated_at
必須
string 形式: date-time
例
{
"data": [
{
"kind": "BOOKING_CONFIRMATION",
"mode": "STANDARD",
"standard": [
{
"tab": "session"
}
],
"custom": [
{
"tab": "session"
}
]
}
]
}

利用できないヘッダ

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

鍵が無い・無効

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

範囲不足

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

見つからない

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

予約・冪等キーの競合

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

本文が1 MiB⁠を超えている

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

入力の検証失敗

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}

回数の上限

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}
RateLimit-Limit
integer
>= 1

固定窓内の回数上限

RateLimit-Remaining
integer

固定窓内の残り回数

RateLimit-Reset
integer

窓終了までの秒数

Retry-After
integer
>= 1

再試行までの待機秒数

内部エラー

メディアタイプapplication/json
object
error
必須
object
code
必須
string
message
必須
string
details
object
任意のキー
追加の項目
request_id
必須
string
例自動生成
{
"error": {
"code": "example",
"message": "example",
"details": {
"additionalProperty": "example"
},
"request_id": "example"
}
}