CLI
オートメーションとイベント
オートメーション、その参加者、それを動かすイベントに関するすべてのコマンドと実例。
全体の仕組み
オートメーションは、トリガーとステップのツリーでできています。下書きと公開中のバージョンを持ち、update は下書きと設定を変更し、publish は下書きを確定してオートメーションを有効にします。読み取りには automations:read、変更には automations:write が必要です。publish、resume、send-test は、オートメーションにメールを送信させるため、emails:send も必要です。
openemail automations create --name "Welcome series" --starter welcome-seriesopenemail automations update aut_5c1e9a7b3d2f48e6a0b4c7d1 --data @welcome.jsonopenemail automations publish aut_5c1e9a7b3d2f48e6a0b4c7d1openemail automations stats aut_5c1e9a7b3d2f48e6a0b4c7d1定義は JSON なので、ファイルに書いて --data @file で渡します。openemail automations get <id> --json で現在の定義を表示でき、その problems に、公開をまだ妨げているものが並びます。
オートメーション
| コマンド | 機能 |
|---|---|
| openemail automations list | オートメーションを最近変更されたものから順に 1 ページ分返します。--status で draft、live、paused、archived のいずれかに絞り込めます |
| openemail automations create --name <value> | --starter から、--data の定義から、または空の状態で下書きを作成します |
| openemail automations get <id> | オートメーション 1 件と、その下書き、公開中のバージョン、設定、下書きの問題点 |
| openemail automations update <id> | 名前、設定、または下書きの定義を変更します。--expected-updated-at を指定すると、読み込んだあとに加えられた変更の上書きを拒否します |
| openemail automations publish <id> | 下書きを次のバージョンとして確定し、オートメーションを有効にします |
| openemail automations pause <id> | 公開中のオートメーションを止めます。参加中の人は全員その場で待機します |
| openemail automations resume <id> | 一時停止中のオートメーションを、実行していたバージョンのまま再び有効にします |
| openemail automations archive <id> | オートメーションを完全に終了し、履歴は残します。参加中の人は全員退出します |
| openemail automations duplicate <id> | 参加者や数値は含めずに、オートメーションを新しい下書きにコピーします |
| openemail automations delete <id> | 確認後にオートメーションとその履歴を削除します。ブラウザでのサインインでは確認コードも求められます |
| openemail automations list-starters | 新しいオートメーションの出発点になるひな形 |
テスト、バージョン、数値
| コマンド | 機能 |
|---|---|
| openemail automations send-test <id> --step-key <value> | 下書きのメールステップ 1 つを、サンプル値を入れて自分宛て、または --to 宛てに送信します。誰も追加されません |
| openemail automations list-versions <id> | 公開されたすべてのバージョンを新しい順に |
| openemail automations restore-version <id> <version> | 以前のバージョンを下書きにコピーし直します。実行するには公開します |
| openemail automations stats <id> | 合計、ステップごとの行、日ごとの点を返します。--since で期間の開始位置を指定でき、既定は過去 30 日間です |
オートメーションに参加中の人
| コマンド | 機能 |
|---|---|
| openemail automations list-enrollments <id> | 入った人を新しい順に、それぞれが今いるステップとともに返します。--status と --step-key で絞り込め、--all ですべてのページを読みます |
| openemail automations get-enrollment <id> <enrollment-id> | 1 人分の実行内容。実行した各ステップと、各送信で作られたメールを含みます |
| openemail automations enroll <id> --email <value> | 連絡先を公開中のオートメーションの最初のステップに入れます。--contact-id を使うと、連絡先を id で指定できます |
| openemail automations exit-enrollment <id> <enrollment-id> | 完了する前に人を外す |
openemail automations list-enrollments aut_5c1e9a7b3d2f48e6a0b4c7d1 --status active --all --json | jq -r '.items[] | .contact.email + " " + (.stepKey // "")'予定
イベントは、連絡先があなたのプロダクトで何かをしたことを伝えます。トリガーでそのイベントを指定しているすべての公開中のオートメーションを開始し、それを待っていた人を先へ進めます。送信には contacts:write が必要です。
| コマンド | 機能 |
|---|---|
| openemail events send --name <value> --email <value> | 連絡先のイベントを 1 件記録します。--create-contact を指定すると、そのアドレスの連絡先がまだない場合に追加し、--idempotency-key を指定すると再試行が安全になります |
| openemail events send-batch <events> | JSON ファイルから最大 100 件のイベントを記録し、受理されたものと拒否されたものを表示します |
| openemail events list-names | ワークスペースが送信したイベント名。トリガーで選ぶためのものです |
| openemail contacts list-events <email> | 連絡先 1 件が行ったイベントを新しい順に。--name で 1 種類のイベントに絞り込みます |
openemail events send --data '{"name":"order.placed","email":"[email protected]","properties":{"orderId":"AC-4192"}}' --idempotency-key order:AC-4192:placedopenemail events send-batch @events.jsonopenemail contacts list-events [email protected] --name order.placedプロパティは JSON ボディに入れるため、プロパティのあるイベントは --data で送信します。イベントは 90 日間保持されます。