Web app to pull data from my emails not deploying: "Script function not found: doGet"

1,247 views
Skip to first unread message

eVe

unread,
May 6, 2023, 10:43:50 PM5/6/23
to Google Apps Script Community
Hello!

I'm teaching myself how to code and ran into an issue I can't resolve on my own despite researching it. I'm following this article as my sample. My code is showing no errors but when I deploy. But when I go to the link it's giving me nothing but this: "Script function not found: doGet" 

See below for my script and HTML samples. I'm just getting into this so I appreciate your helping this newb!

HTML:
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<title>Message Display Test</title>
</head>
<body style="padding:3em;">
<h1>Messages</h1>
<ul>
<? for(var m=0;m<messages.length;m++){ ?>
<li><?= messages[m].getSubject() ?></li>
<p><?= messages[m].getPlainBody() ?></p>
<? } ?>
</ul>
</body>
</html>

Script: 
function getRelevantMessages()
{
var threads = GmailApp.search("from:no-r...@editmysite.com Event Information",0,10);
var messages=[];
threads.forEach(function(thread)
{
messages.push(thread.getMessages()[0]);
});
return messages;
}
function getMessagesDisplay()
{
var templ = HtmlService.createTemplateFromFile('messages');
templ.messages = getRelevantMessages();
return templ.evaluate();
}

CBMServices Web

unread,
May 6, 2023, 11:39:15 PM5/6/23
to google-apps-sc...@googlegroups.com
Yeah you are missing a function with name doGet.

I suggest checking out this webapp tutorial here:



--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/7f359aec-8e67-4f33-a205-d1ec2243a1b7n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages