I’m using a code I found on the forum:
Backend
import wixCrm from 'wix-crm-backend';
export function notifyOwnerOnDashboard(title, action,site,role) {
wixCrm.notifications.notify(
"Notification body",
["Dashboard"],
{
"title" : title,
"actionTitle": action,
"actionTarget": {"url": site},
"recipients": { "role": role}
}
);
console.log('Notification sent')
}
In page
import {notifyOwnerOnDashboard} from 'backend/Notification';
export function Notifyteam() {
const title = "I'm a title"
const action = "This is what I have done" ;
const site = "www.google.com" ; // use full URL link
const role = "Owner";
notifyOwnerOnDashboard(title,action,site,role)
}
export function btnNotification_click(event) {
Notifyteam()
}
but copying it exactly the same gives me this error:
How can i fix this?