-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy of a3k registration version7
1 lines (1 loc) · 1.54 KB
/
Copy of a3k registration version7
1
{"files":[{"id":"46723a12-3524-4f33-91d6-738089096ec8","name":"Code","type":"server_js","source":"function doPost (e) {\nvar params \u003d JSON.stringify(e);\n var myObj \u003d JSON.parse(params);\n var ss \u003d SpreadsheetApp.openByUrl(\n \u0027Link to Registration Excel Sheet\u0027);\n var gen\u003dss.getSheets()[0];\n gen.appendRow([myObj.parameter.name,myObj.parameter.college,myObj.parameter.email,myObj.parameter.mobile]);\n for (var y \u003d 0; y \u003c myObj.parameter.no; y++) {\n var sheet \u003d ss.getSheetByName(myObj.parameters.eventid[y]);\n\n sheet.appendRow([myObj.parameter.name,myObj.parameter.college,myObj.parameter.email,myObj.parameter.mobile]);\n }\n var sheets \u003d ss.getSheets()[34];\n var startRow \u003d 1; \n var numRows \u003d 35; \n var dataRange \u003d sheets.getRange(startRow, 1, numRows, 2)\n var data \u003d dataRange.getValues();\n var emailAddress\u003dmyObj.parameter.email;\n var message\u003d\"Dear \"+myObj.parameter.name+\", \\n\\n\";\n for (var j \u003d 0; j \u003c myObj.parameter.no; j++){\n for (var k \u003d 0; k \u003c 35; k++){\n if(data[k][0]\u003d\u003dmyObj.parameters.eventid[j])\n {\n message+\u003d data[k][1]+\"\\n\\n\\n\";\n }\n }\n}\n message+\u003d\"\\n \\t \\t Thanks \u0026 Regards, \\n \\t \\t A3K TEAM :)\" ;\n var subject \u003d \"Welcome to A3k Your instructions As Follows\";\n MailApp.sendEmail(emailAddress, subject, message);\n var cal\u003dCalendarApp.getEventSeriesById(\"Google Calender Id\");\n cal.addGuest(myObj.parameter.email);\n}"}]}