> For the complete documentation index, see [llms.txt](https://docs.fieldmotion.com/fieldmotion-api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fieldmotion.com/fieldmotion-api-docs/jobtype/_setnotificationemail.md).

# \_setNotificationEmail

Sets the Email for Notifications of a Job Type.

### Parameters

#### id

The ID of the Job Type.

#### val

A string with the Email that Notifications related to this Job Type will be sent to, must be in a valid email address format.\
(e.g <test@gmail.com>, <mail@address.ie>, <ab.cd.ef@gh.ij>)

### Example

```
FM_api(
    'JobType_setNotificationEmail',[
        'id' => '152047',
        'val' => 'test@gmail.com'
    ]
);
```

#### On Success

```
{"ok":1}
```

#### On Failure

If there's no chosen ID or the chosen ID is less than 1

```
{"error":"missing or invalid parameter: id"}
```

If the "val" parameter is not set:

```
{"error":"missing parameter: val"}
```

If the "val" parameter does not have a valid email format:

```
{"error":"invalid parameter: val"}
```

If the "id" parameter does not match the ID of an existing Job Type:

```
{"error":"job type does not exist"}
```
