0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

XO プラットフォームからメール送信方法

Last updated at Posted at 2023-10-28

XOプラットフォームからサードパーテイのAPIを使用してメール送信ができます。
以下SendGrid APIを使用してメール送信を紹介します。

Step1:SendGridの無償アカウントを作成します

Step2:SendGridのWeb API選択

以下のURLをアクセスしてWeb APIを選択します。

image.png

Step3: cURLを選択

image.png

Step4:画面上でMy First API Key Nameの項目にAPIキーの名前を設定します

image.png

例えば TestAPI1を入力してCreate Keyボタンを押します

image.png

ボタン押してから以下画面上でAPIキーが作成されます

image.png

次 I have executed the codeのチェックボックスを選択して Verified Integrationボタン押します
image.png

XOプラットフォームにログインして、SendEmail名前のタスクボットを作成します。
ボットアクション「sendEm」を追加します。
sendEm ボットアクション内にスクリプトノードを追加します。

image.png

スクリプトノードを以下のように設定します

Script.rb
context.entities.EmailMsg = "お客様の予約内容が以下になります。" + context.session.BotUserSession.name + "様、" + context.session.BotUserSession.address + "、"+context.session.BotUserSession.address+ "、" + "、" + "。";
puts 'code block.'

EmailMsg Entityノード追加します。
image.png

最後に新しいボットアクションノードを追加して、Serviceノード設定します。

image.png

ヘッダーは以下のように設定します
image.png

ボデイの場合は、application/jsonを選択し、以下のコードを設定して保存します。
image.png

title.rb
{
  "personalizations": [
    {
      "to": [
        {
          "email": "sandeep.s@z.com"
        }
      ]
    }
  ],
  "from": {
    "email": "sand.s@p.com"
  },
  "subject": "予約メール",
  "content": [
    {
      "type": "text/plain",
      "value": "{{context.entities.EmailMsg}}"
    }
  ]
}
puts 'code block.'

image.png

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?