開発者向け機能:サーバスクリプト:notification.Send
## 概要
生成、設置情報を取得した通知のオブジェクトを用いて、任意のタイミングで通知を送信します。
## 構文
```
notification.Send()
```
## 戻り値
通知を送信できたらtrue、送信できなかったfalseを返却します。
## 使用例
#### メール
以下の例ではxxxxx@example.comへ通知テスト(Title)、サーバスクリプトから通知しています。(Body)の通知を送信します。
##### JavaScript
```javascript
let notification = notifications.New();
notification.Address = 'xxxxx@example.com';
notification.Title = '通知テスト';
notification.Body = 'サーバスクリプトから通知しています。';
notification.Send();
```
#### Teams
以下の例ではTeamsへ通知を送信します。(Teamsへの通知には事前に設定が必要です。下例の"notification.Address"についてはマニュアル「[Microsoft Teamsに通知できるように設定する](/manual/teams)」の"アドレス"欄の設定を参照ください。)
##### JavaScript
```javascript
let notification = notifications.New();
notification.Type = 6; //通知先Teamsの指定
notification.Address = 'https://***/***'; //通知先Teamsのwebhook urlを指定
notification.Title = '通知テスト';
notification.Body = 'サーバスクリプトから通知しています。';
notification.Send();
```
#### Slack
以下の例ではSlackへ通知を送信します。(Slackへの通知には事前に設定が必要です。下例の"notification.Address"についてはマニュアル「[Slackに通知できるように設定する](/manual/slack)」の"アドレス"欄の設定を参照ください。)
##### JavaScript
```javascript
let notification = notifications.New();
notification.Type = 2; //通知先Slackの指定
notification.Address = 'https://hooks.slack.com/***';
notification.Title = '通知テスト';
notification.Body = 'サーバスクリプトから通知しています。';
notification.Send();
```
#### Chatwork
以下の例ではChatworkへ通知を送信します。(Chatworkへの通知には事前に設定が必要です。下例の"notification.Address"、"notification.Token"についてはマニュアル「[Chatworkに通知できるように設定する](/manual/chatwork)」の"アドレス"欄、"トークン"欄の設定を参照ください。)
##### JavaScript
```javascript
let notification = notifications.New();
notification.Type = 3 //通知先Chatworkの指定
notification.Token = '***';
notification.Address = 'https://api.chatwork.com/***';
notification.Title = '通知テスト';
notification.Body = 'サーバスクリプトから通知しています。';
notification.Send();
```
## 注意事項
こちらは「[サーバスクリプト](/manual/table-management-server-script)」で使用するメソッドです。「[スクリプト](/manual/table-management-script)」では使用できません。
## 関連情報
・[テーブルの管理:サーバスクリプト](/manual/table-management-server-script)
・[オブジェクトごとの実行タイミング](/manual/server-script-conditions)
・[notificationsオブジェクト](/manual/server-script-notifications)
・[notificationオブジェクト](/manual/server-script-notification)
・[notifications.Newメソッド](/manual/server-script-notifications-new)
・[notifications.Getメソッド](/manual/server-script-notifications-get)