# NOTIFICATION SUBSCRIPTIONS

AyaNova has dozens of different types of notifications that can be subscribed to for events of interest.
They can be delivered via email / SMS or directly in application or both.

This form is used to control notification subscriptions.

## Notification subscription list

The list form shows all the notifications you are currently subscribed to.  You can open a subscription to edit it by clicking on it's ID value.


## Notification subscription edit form

Depending on the event type selected you will see different form fields as appropriate to that event.

### Notification event
This is where you select the type of event you are subscribing to.  All event types are listed below. 

### Type
Some events are related to core AyaNova business object operations, for example when an object is created or deleted or modified.  This is the field where you select the type of object you are interested in such as a Customer or Work order etc.  All core AyaNova business object types are available here. 

### Notify before event
For age and time based events, this is where you set a time duration of how far in advance of the event date you want to be notified.  For example if you are creating subscription for when a service contract expires and you want to be notified 2 weeks in advance of the expiration date you would select 14 days here.  You can select days hours and minutes as appropriate.  Remember this controls when you are notified *in advance* of the actual date of the event whatever that might be.

As you can subscribe to the same event more than once you can use this feature to create an escalating notification system for some events by setting a longer advance notice and having it deliver to a less immediate location, for example In application and then another identical subscription but with a shorter time frame to a more immediately noticeable location such as direct SMS or an alternate address to another user to catch critical events in case they might get missed.

### Status
Events tied to Status settings on other objects such as a Workorder status or Quote status require a selection of the desired status.  In those cases a Status field is available to choose the exact status of interest.

### Decimal value
Some events are related to monetary or other numeric amounts or thresholds, for example a workorder total price exceeded or meter count exceeded, this field will be presented in those cases to enter the numeric amount related to the event that you want to be notified.

### Report
In the case of an event that can have a report associated with it, you can select a report to be automatically sent with the event (in the case of email delivery) or linked to (in the case of in application delivery).

### Delivery method
Currently you can choose between In application which will deliver to the [notifications](form-home-notifications.md) form and alert via the bell icon at the top of the AyaNova application window and email / SMS delivery via SMTP.

### Deliver to Address
If email / SMS delivery method is chosen this field is where you enter the address for delivery.  If it is to your SMS / MMS device then you must set the address provided by your cellular provider for their [SMS / MMS gateway](https://www.wikihow.com/Send-a-Text-from-Email) 

By default AyaNova will fill this field in with your email address set in your [User settings](form-home-user-settings.md) form however you can change it to any value you wish.  

### Tags
Here you can select one or more [Tags](ay-start-form-tags.md) (if the event is related to a taggable object) to act as a filter to include or exclude specific objects.  For example, you could create a subscription to the Object Created event, select the type as Customer and the Tag as "residential".  That way any Customer created and saved with the Tag "residential" will trigger a notification to you but if a Customer is created without the tag "residential" you will not be alerted.

**All** the tags selected in the subscription are required to be on the object at the moment it is saved / updated / deleted in order to match the subscription requirements and trigger notification. If other tags are on the object besides the ones related to this filter they have no effect on the notification filter.

If no tags are selected then tags are not considered at all when processing notifications.


## Events are triggered when...

### Business object edited
When a new or updated AyaNova core business object is saved or deleted it triggers notification processing.

In other words if you create a new subscription, only objects saved *after* you created that subscription will trigger notifications to you.

In the case of time delayed notifications they are still created at the moment of saving the object but with a delayed delivery date.
For example, if you create a subscription to be notified a year after a Customer record is created, the event is created the moment the Customer is created and first saved and stored internally for a year before delivery.
(If that Customer should be deleted before the year is up then that age notification will automatically be deleted)

### Something happens at the server
When an event takes place at the server that triggers events related to server operations.  For example when the system backs up automatically.


## General notification type
The General notification type is a special case, all users are automatically subscribed to In Application delivery of general notifications meaning they will always receive critical system notifications as well as direct notifications from other users **inside AyaNova application**
There are no settings adjustable for in app General notifications, however Users can also subscribe to this same type of notification to be delivered via email / sms optionally.

## Notification event types


| EVENT | DESCRIPTION |
| ----- | ------------------------------ |
| ObjectDeleted | Deletion of core business object of selected type and tags |
| ObjectCreated | Creation of core business object of selected type and tags |
| ObjectModified | Any changes and saving of core business object of selected type and tags |
| WorkorderStatusChange | Any *change* of Workorder Status including from no status (new) to a *specific* selected status ID value |
| ContractExpiring | Customer service contract expiration |
| CSR Accepted | Customer service request accepted. (intended for Customer users) |
| CSR Rejected | Customer service request rejected. (intended for Customer users) |
| QuoteStatusChange | Any *change* of Quote Status including from no status (new) to a *specific* selected status ID value |
| ObjectAge | Any object, Age (conditional on AgeValue) after creation event of any object of selected specific type and optionally selected tags |
| ServiceBankDepleted | Service bank has run out and balance is within selected advance notice level |
| ReminderImminent | A Reminder in AyaNova is about to reach it's specified date/time |
| ScheduledOnWorkorder | User is scheduled on (added to) a Work order |
| ScheduledOnWorkorderImminent | Scheduled date and time reached for workorder which User is scheduled |
| WorkorderFinishStatusOverdue | Workorder not set to a "Finished" type Status before the selected duration from created date |
| WorkorderFinished | Service work order is set to any status that is flagged as a "Finished" type of status. (Customer and User notification) |
| OutsideServiceOverdue | An item sent for 3rd party service is overdue from projected repair time frame |
| OutsideServiceReceived | An item sent for 3rd party service has been received back |
| PartRequestReceived | An out of stock part requested via a Workorder has been received |
| NotifyHealthCheck | Automatic daily "ping" notification to confirm notification and Generator system is active at server |
| BackupStatus | Result of last Backup operation at server |
| CustomerServiceImminent | Scheduled service date / time is about to be reached. Intended for Customer type User |
| PartRequested | An out of stock Part has been requested on a Work order |
| WorkorderTotalExceedsThreshold | The balance of a Work order has exceeded a threshold (aka the "Andy") |
| WorkorderStatusAge | A Workorder has been sitting at the selected status for longer than the selected time frame |
| UnitWarrantyExpiry | A Unit's warranty expiration date is reached |
| UnitMeterReadingMultipleExceeded | A meter readingn *multiple* exceeds selected threshold (e.g. every 10,000 etc) |
| GeneralNotification | Any general notification including direct text notifications between users (built in but provided for email alternative delivery) |
| ServerOperationsProblem | Any timely and serious issue related to internal AyaNova Server operations requiring attention |
| QuoteStatusAge | A Quote has been sitting at the selected status for longer than the selected time frame |
| CopyOfCustomerNotification | Copy of any notification sent to Customer for AyaNova User. Filterable by Customer Tag |
| WorkorderCreatedForCustomer | Customer notification sent when a service type work order is created for them |
| WorkorderFinishedFollowUp | User notification sent after selected duration has passed since workorder set to a "Finished" type of status |

