[**Documentation**](../../../README)

***

[Documentation](../../../README) / [@zerotal/notifications](../README) / Notifiable

# Interface: Notifiable

Defined in: [notifications/src/Notifiable.ts:50](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/Notifiable.ts#L50)

A model composed with the [Notifiable](../functions/Notifiable) mixin. Declared here so `Notifiable` is both a
value (the mixin) and a type (the contract) — it merges with the function above. Extends the
base notifiable contract, so instances pass anywhere a notifiable is expected.

## Extends

- `Notifiable`

## Properties

### id

> **id**: `string` \| `number`

Defined in: [notifications/src/types.ts:3](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/types.ts#L3)

#### Inherited from

`NotifiableContract.id`

***

### email?

> `optional` **email?**: `string`

Defined in: [notifications/src/types.ts:4](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/types.ts#L4)

#### Inherited from

`NotifiableContract.email`

***

### name?

> `optional` **name?**: `string`

Defined in: [notifications/src/types.ts:5](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/types.ts#L5)

#### Inherited from

`NotifiableContract.name`

***

### phone?

> `optional` **phone?**: `string`

Defined in: [notifications/src/types.ts:7](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/types.ts#L7)

Phone number in E.164 format, required when using the sms channel.

#### Inherited from

`NotifiableContract.phone`

## Methods

### receivesBroadcastNotificationsOn()?

> `optional` **receivesBroadcastNotificationsOn**(): `string`

Defined in: [notifications/src/types.ts:12](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/types.ts#L12)

Override the channel this notifiable receives broadcast notifications on.
Default: `notifications.{id}` (broadcast as a private channel). Used by the 'broadcast' channel.

#### Returns

`string`

#### Inherited from

`NotifiableContract.receivesBroadcastNotificationsOn`

***

### routeNotificationFor()?

> `optional` **routeNotificationFor**(`channel`): `string` \| `undefined`

Defined in: [notifications/src/types.ts:26](https://github.com/zerotaldev/zerotal/blob/1d6fb26b05b18ba077de1bfaeb46c42131cd8b70/packages/notifications/src/types.ts#L26)

Per-channel destination override, consulted before the default field.

Return the address a channel should deliver to — an email for `"mail"`, an
E.164 number for `"sms"`, a webhook URL for `"slack"` — or `undefined` to
fall back. Lets one model route differently per channel without every
notification having to know how.

#### Parameters

##### channel

`string`

#### Returns

`string` \| `undefined`

#### Example

```ts
routeNotificationFor(channel: string) {
  return channel === "mail" ? this.billingEmail : undefined;
}
```

#### Inherited from

`NotifiableContract.routeNotificationFor`
