Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 89 additions & 0 deletions gmail-sentiment-analysis/Samples.gs
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
/*
Copyright 2025 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

/**
* Create sample emails
*/
function generateSampleEmails() {
// Get active user's email
const userEmail = Session.getActiveUser().getEmail();

// Send emails
GmailApp.sendEmail(
userEmail,
"Thank you for amazing service!",
"Hi, I really enjoyed working with you. Thank you again!",
{
name: 'Customer A',
},
);

GmailApp.sendEmail(
userEmail,
"Request for information",
"Hello, I need more information on your recent product launch. Thank you.",
{
name: 'Customer B',
},
);

GmailApp.sendEmail(
userEmail,
"Complaint!",
"Hello, You are late in delivery, again. Please contact me ASAP before I cancel our subscription.",
{
name: 'Customer C',
},
);

console.log("Sample email generation completed.")
}
* Create sample emails
*/
function generateSampleEmails() {
// Get active user's email
var userEmail = Session.getActiveUser().getEmail();

// Send emails
GmailApp.sendEmail(
userEmail,
"Thank you for amazing service!",
"Hi, I really enjoyed working with you. Thank you again!",
{
name: 'Customer A',
},
);

GmailApp.sendEmail(
userEmail,
"Request for information",
"Hello, I need more information on your recent product launch. Thank you.",
{
name: 'Customer B',
},
);

GmailApp.sendEmail(
userEmail,
"Complaint!",
"Hello, You are late in delivery, again. Please contact me ASAP before I cancel our subscription.",
{
name: 'Customer C',
},
);

console.log("Sample email generation completed.")
}
1 change: 1 addition & 0 deletions gmail-sentiment-analysis/appsscript.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"https://www.googleapis.com/auth/script.external_request",
"https://www.googleapis.com/auth/cloud-platform",
"https://www.googleapis.com/auth/script.locale",
"https://www.googleapis.com/auth/userinfo.email",
"https://www.googleapis.com/auth/gmail.addons.execute",
"https://www.googleapis.com/auth/gmail.labels",
"https://www.googleapis.com/auth/gmail.modify"
Expand Down
Loading