Error sending a notification to a contactId

Hi all, I want to use Notify | Velo to send a notification to a site member, but I get this error: “Error sending notification: message: Not Found details: applicationError: description: Not Found code: NOT_FOUND data: {}”

This is the backend code:

import { Permissions, webMethod } from "wix-web-module";
import { notifications } from "wix-notifications.v2";
import * as wixAuth from 'wix-auth';

export const notifyWithElevation = webMethod(
  Permissions.SiteMember,  
  async (body, channels, options) => {
    try {
      const elevatedNotify = wixAuth.elevate(notifications.notify);
      const result = await elevatedNotify(body, channels, options);
      return result;
    } catch (error) {
      throw new Error("Notification failed");
    }
  }
);

This is the frontend code:

$w.onReady(function () {

    const body = "This is the body of the notification";
    const channels = ["Browser", "Mobile"];

    const options = {
        title: "Notification Title",
        toContacts: {
            contactIds: ["XXXXXXX-2115-444e-a332-XXXXXXXX"],
        },
        targetUrl: "https://example.com"
    };

    notifyWithElevation(body, channels, options)
        .then((result) => {
            console.log("Notification sent successfully", result);
        })
        .catch((error) => {
            console.error("Notification failecsfsd", error);
        });
});

I also tried sending it “toSiteContributors”, same error. Can you help? Thank you so much!

I’m using almost identical code, but I get a different backend error when run on both preview and live site, and no notification of course:

“message: Not Found details: applicationError: description: Not Found code: NOT_FOUND data: {}”

Frontend>>

import { notify } from "backend/createNotification.web";

//...
  const body = "Notification text";
  const channels = ["Browser", "Dashboard", "Mobile"];
  const options = {
    title: "Notification Title",
    toContacts: {
      contactIds: ["22ed90a5-4732-4200-a403-7e4f3e730cb5"],
    },
      targetDashboardPage: "Home"
  };

  notify(body, channels, options)
  .then((result) => {
    console.log("Notification sent successfully ", result);
  })
  .catch((error) => {
    console.log("Notification failed ", error);
  });
}

Backend>>
(file is named createNotification.web.js.)

import { notifications } from "wix-notifications.v2";
import { webMethod, Permissions } from "wix-web-module";
import { elevate } from "wix-auth";

const elevatedNotify = elevate(notifications.notify);

export const notify = webMethod(
  Permissions.Anyone,
  async (body, channels, options) => {
    try {
      const result = await elevatedNotify(body, channels, options);
      return result;
    } catch (error) {
      console.error(error);
    }
  },
);