I am investigating in how to create Google Workspace add-ons and I am following the cats quickstart
But running it I encounter this error "TypeError: Cannot read property 'userTimezone' of undefined" on Common.gs row 24
var hour = Number(Utilities.formatDate(new Date(), e.userTimezone.id, 'H'));
The function that contains this row is
function onHomepage(e) {
console.log(e);
var hour = Number(Utilities.formatDate(new Date(), e.userTimezone.id, 'H'));
var message;
if (hour >= 6 && hour < 12) {
message = 'Good morning';
} else if (hour >= 12 && hour < 18) {
message = 'Good afternoon';
} else {
message = 'Good night';
}
message += ' ' + e.hostApp;
return createCatCard(message, true);
}
Can anyone help me to understand where is the problem ?
Thanks in advance, Vincenzo