# Wishlist Notifications

This guides explains how to trigger notifications for certain Wishlist events. You can for example trigger a popup when a product has been added to the Wishlist. In an effort to keep Wishlist King as light as possible, we have not added a Popup or Toast library. This needs to be added on your end.

{% hint style="info" %}
**Requires coding.**

This customisation requires some light coding. If you are unfamiliar with code, please get in touch for help.
{% endhint %}

### Code Access

Notifications can be triggered with Event Subscribers in Code Access. Make sure that the Code Access app embed is enabled in the theme editor, otherwise the code will not load into your theme.

In Code Access navigate to Save for Later in the left hand column. Here you will find some default event subscribers. We recommend to leave these as they are.

#### Subscribe to Wishlist Event

Every customer interaction with the Wishlist will trigger an event. In this example we will subscribe to the event `wk:wishlist:add:success` which is triggered after a product was added the to the Wishlist.

The event data will differ depending on the event type. In this example we log the product title to the browser console. Use this as a starting point to implement your own customisations.

```jsx
export function setup({ app }) {
  // Add this below the other subscribers
  app.events.subscribe("wk:wishlist:add:success", (event) => {
    console.log(`${event.data.product.title} added to Wishlist`);
  });
}
```

#### Wishlist Events

Here is a list of all the events that can be subscribed to.

* wk:wishlist:add:success
* wk:wishlist:add:error
* wk:wishlist:remove:success
* wk:wishlist:remove:error
* wk:wishlist:change-variant:success
* wk:wishlist:change-variant:error
* wk:wishlist:clear:success
* wk:wishlist:clear:error
* wk:wishlist:share:success
* wk:wishlist:share:error
* wk:wishlist:add-to-cart:success
* wk:wishlist:add-to-cart:error
* wk:wishlist:add-all-to-cart:success
* wk:wishlist:add-all-to-cart:error
* wk:wishlist:page-view
* wk:wishlist:login-required
* wk:customer:login
* wk:customer:logout


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.swish.app/customizations/wishlist-notifications.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
