/d/ and /edit)SHEET_ID with your sheet’s ID and NOTIFY_EMAIL if neededOpen src/pages/careers/index.astro and replace the empty string:
const SCRIPT_URL = 'PASTE_YOUR_WEB_APP_URL_HERE';
const SHEET_ID = 'YOUR_GOOGLE_SHEET_ID_HERE';
const SHEET_NAME = 'Applications';
const NOTIFY_EMAIL = 'info@avinuevents.com';
function doPost(e) {
try {
const data = JSON.parse(e.postData.contents);
const ss = SpreadsheetApp.openById(SHEET_ID);
let sheet = ss.getSheetByName(SHEET_NAME);
if (!sheet) {
sheet = ss.insertSheet(SHEET_NAME);
// Header row
sheet.appendRow([
'Timestamp', 'Name', 'Email', 'Phone', 'City',
'Category', 'Experience', 'Languages',
'Website', 'Demo Video', 'Bio', 'Referral'
]);
sheet.getRange(1, 1, 1, 12).setFontWeight('bold');
}
sheet.appendRow([
new Date().toLocaleString('en-US', { timeZone: 'America/New_York' }),
data.name || '',
data.email || '',
data.phone || '',
data.city || '',
data.category || '',
data.experience|| '',
data.languages || '',
data.website || '',
data.video || '',
data.bio || '',
data.referral || '',
]);
// Email notification
GmailApp.sendEmail(
NOTIFY_EMAIL,
'🎤 New Talent Application — ' + (data.name || 'Unknown'),
[
'A new talent application has been submitted on avinuevents.com.',
'',
'Name: ' + (data.name || '—'),
'Email: ' + (data.email || '—'),
'Phone: ' + (data.phone || '—'),
'City: ' + (data.city || '—'),
'Category: ' + (data.category || '—'),
'Experience: ' + (data.experience || '—'),
'Languages: ' + (data.languages || '—'),
'Website: ' + (data.website || '—'),
'Demo Video: ' + (data.video || '—'),
'',
'Bio:',
data.bio || '—',
'',
'Referral: ' + (data.referral || '—'),
'',
'View all applications: https://docs.google.com/spreadsheets/d/' + SHEET_ID,
].join('\n')
);
return ContentService
.createTextOutput(JSON.stringify({ status: 'ok' }))
.setMimeType(ContentService.MimeType.JSON);
} catch (err) {
return ContentService
.createTextOutput(JSON.stringify({ status: 'error', message: err.message }))
.setMimeType(ContentService.MimeType.JSON);
}
}