#UID has been generated
1 messages ยท Page 1 of 1 (latest)
perm issue then unfortunately
that was on manual fire
huh
any bypass or do I have to create a vercel server less script again
vercel serverless always comes in clutch but lets use that as a last resort
oh I have to deal with sheets API again that sucks
https://developers.google.com/apps-script/reference/mail/mail-app#authorization_1 you sure this is there as a scope?
valid point need to check it out
sec trying to reproduce this while you do that
summin like this?
yah
yeah your thing is tweaking
mines an editor add on
works fine
and your handler seems to fire
so wtf
did you have it on trigger?
i have it happen when a dialog shows up
hmm
** b r u h **
fr
just writing a message to get the notificatons on this thread xD
vro
I was looking for it ๐
lmao
Didn't see it and expected it to be in a more obvious place like ๐ญ
im currently tweaking as to how he got it so fast and mines tweaking
Anyways, I'm a bit busy today, but if you guys don't figure it out i'll try to look into this tomorrow
gl(hf?)
thanks
sending code here again for reference
function onFormSubmit(e) {
var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet();
// Get the header row (assuming it's the first row)
var headers = sheet.getRange(1, 1, 1, sheet.getLastColumn()).getValues()[0];
// Find the column numbers
var phoneNumberCol = headers.indexOf("Your Phone Number") + 1;
var nameCol = headers.indexOf("Your Name") + 1;
var emailCol = headers.indexOf("Your Email Address ") + 1;
var datesCol = headers.indexOf("Days You will Be Attending") + 1;
var uidCol = headers.indexOf("UID") + 1;
// Check if all required columns are found
if (phoneNumberCol > 0 && nameCol > 0 && uidCol > 0 && emailCol > 0) {
// Get the last row
var lastRow = sheet.getLastRow();
// Get the values from the last form response
var phoneNumber = sheet.getRange(lastRow, phoneNumberCol).getValue();
var name = sheet.getRange(lastRow, nameCol).getValue();
var email = sheet.getRange(lastRow, emailCol).getValue();
var dateAttend = sheet.getRange(lastRow, datesCol).getValue();
// Take the first 3 letters of the name and email
//.... logic for UID
var uid = "MBS-D2024-" + (total % 256);
// Write the UID back to the sheet in the "UID" column
sheet.getRange(lastRow, uidCol).setValue(uid);
var htmlTemplate = HtmlService.createHtmlOutputFromFile('Style').getContent()
.replace(/{{259106725__COL\$D}}/g, name)
.replace(/{{259106725__COL\$A}}/g, uid)
.replace(/{{259106725__COL\$I}}/g, dateAttend)
.replace(/{{259106725__COL\$G}}/g, phoneNumber);
MailApp.sendEmail({
to: email,
subject: "Mallapur Bangiya Sangha Durgotsav 2024 - Dandiya Nights Registration Confirmation",
htmlBody: htmlTemplate,
name: "Mallapur Bangiya Sangha", // Optional: Set the sender name
bcc: "", // Optional: Add BCC recipients if needed
replyTo: "",
});
} else {
Logger.log("Phone Number, Name, or UID column not found.");
}
}```
yup np
theres NO WAY this solves your issue but try it off superstition anyways lol https://stackoverflow.com/questions/64221977/email-not-sending-or-probably-not-being-triggered-on-form-submit-google-apps-scr
Theirs is much more simpler than mine honestly
cause what I see is their code does not run at all
mine does. but its some selective ahh running
yeah thats what i thought but the answer said [Edit] Since the trigger is created properly, change the first the line of the trigger code from:
that's probably not the issue
more likely is your code has an error somewhere
move send email to the first linje of the handler (with hardcoded stuff)
I plead to differ, it should not have worked when run manually then no?
yeah, but there can always be inconsistencies between environments
true
5 mins
ok
so
I was nerding about
This is what i find when its triggered:
and if I run it manually those values exist
so my code is tweaking when run on triggers
what the hell
scammers I tell you
I GOT IT TO WORK ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ
I REMOVED VARIABLES AND BASICALLY GOT IT TO GET VALUES THEN AND THERE AGAIN
I COOKED ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ๐ฃ๏ธ
HEHAW
I must thank you for spending a part of your day in helping me with this problem!
Could not have done it without the nudges
๐ญ
so it was an env difference wtf
not only that
its tick rate
the varaibles were not allocated the memory by the time the email was sent
pretty sure thats why they return me a blank value
they are declared but never initialized
makes sense as to why manual runs works
honestly stupid but sure who cares if it works it works
???
the whole script runs when manually executing it
Oh lmao
yeah its so goofy
Damn
So now we know
Whenever you send the code yeah
Send the whole thing ๐ฏ
Censor out some values but keep the code structure intact ๐ฃ๏ธ
Tragic fix I was lowkey hoping for a bug to be there on Googles end
Only rewarded for security bugs afaik 