|
| 1 | +/* |
| 2 | +Copyright 2025 Google LLC |
| 3 | +
|
| 4 | +Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | +you may not use this file except in compliance with the License. |
| 6 | +You may obtain a copy of the License at |
| 7 | +
|
| 8 | + https://www.apache.org/licenses/LICENSE-2.0 |
| 9 | +
|
| 10 | +Unless required by applicable law or agreed to in writing, software |
| 11 | +distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | +See the License for the specific language governing permissions and |
| 14 | +limitations under the License. |
| 15 | +*/ |
| 16 | + |
| 17 | +/** |
| 18 | + * Create sample emails |
| 19 | + */ |
| 20 | +function generateSampleEmails() { |
| 21 | + // Get active user's email |
| 22 | + const userEmail = Session.getActiveUser().getEmail(); |
| 23 | + |
| 24 | + // Send emails |
| 25 | + GmailApp.sendEmail( |
| 26 | + userEmail, |
| 27 | + "Thank you for amazing service!", |
| 28 | + "Hi, I really enjoyed working with you. Thank you again!", |
| 29 | + { |
| 30 | + name: 'Customer A', |
| 31 | + }, |
| 32 | + ); |
| 33 | + |
| 34 | + GmailApp.sendEmail( |
| 35 | + userEmail, |
| 36 | + "Request for information", |
| 37 | + "Hello, I need more information on your recent product launch. Thank you.", |
| 38 | + { |
| 39 | + name: 'Customer B', |
| 40 | + }, |
| 41 | + ); |
| 42 | + |
| 43 | + GmailApp.sendEmail( |
| 44 | + userEmail, |
| 45 | + "Complaint!", |
| 46 | + "Hello, You are late in delivery, again. Please contact me ASAP before I cancel our subscription.", |
| 47 | + { |
| 48 | + name: 'Customer C', |
| 49 | + }, |
| 50 | + ); |
| 51 | + |
| 52 | + console.log("Sample email generation completed.") |
| 53 | +} |
| 54 | + * Create sample emails |
| 55 | + */ |
| 56 | +function generateSampleEmails() { |
| 57 | + // Get active user's email |
| 58 | + var userEmail = Session.getActiveUser().getEmail(); |
| 59 | + |
| 60 | + // Send emails |
| 61 | + GmailApp.sendEmail( |
| 62 | + userEmail, |
| 63 | + "Thank you for amazing service!", |
| 64 | + "Hi, I really enjoyed working with you. Thank you again!", |
| 65 | + { |
| 66 | + name: 'Customer A', |
| 67 | + }, |
| 68 | + ); |
| 69 | + |
| 70 | + GmailApp.sendEmail( |
| 71 | + userEmail, |
| 72 | + "Request for information", |
| 73 | + "Hello, I need more information on your recent product launch. Thank you.", |
| 74 | + { |
| 75 | + name: 'Customer B', |
| 76 | + }, |
| 77 | + ); |
| 78 | + |
| 79 | + GmailApp.sendEmail( |
| 80 | + userEmail, |
| 81 | + "Complaint!", |
| 82 | + "Hello, You are late in delivery, again. Please contact me ASAP before I cancel our subscription.", |
| 83 | + { |
| 84 | + name: 'Customer C', |
| 85 | + }, |
| 86 | + ); |
| 87 | + |
| 88 | + console.log("Sample email generation completed.") |
| 89 | +} |
0 commit comments