coderbunker / gas

G-Suite Google Apps Script (GAS) used with Coderbunker documents
3 stars 0 forks source link

automatic onboarding process for freelancers #53

Closed echolabstech closed 5 years ago

echolabstech commented 5 years ago

What changed and why?

When someone signs up on the website, we don't follow up with a thank you email or any email instructions for what to do next. Spend a lot of time to follow the onboarding process manually.

Background context or notes?

how to make a google app script

todo (if appropriate):

Goals

Reduce Coderbunker Onboarding freelancer process from 20 steps to 5 steps (-15 steps)


reviewer todo (if appropriate):

Sunying-RONG commented 5 years ago

ScriptApp.newTrigger("sendNew") .timeBased() .everyMinutes(1) .create(); // 1555247304(1) 1555247324(1)

Sunying-RONG commented 5 years ago

We only need the following code to send email automatically. For checking new entries, no need to use code, we can use the setting in Google script, as shown in following picture: // function sendNew(){ var dataSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("data"); var templetSheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName("template"); var templateSubject = templetSheet.getRange(1, 2).getValue(); var templateBody = templetSheet.getRange(2, 2).getValue();

for (var i =2; i<= dataSheet.getLastRow(); i++){ var name = dataSheet.getRange(i, 1).getValue(); var emailAddress = dataSheet.getRange(i, 2).getValue(); var status = dataSheet.getRange(i, 3).getValue();

var subject = templateSubject.replace("<>", name); var body = templateBody.replace("<>", name);

if (status == ""){ MailApp.sendEmail(emailAddress, subject, body); dataSheet.getRange(i,3).setValue("Email Sent"); } } } // image

rngadam commented 5 years ago

This is redundant work to what @ancagabriela has done internally for the script to onboard people.

The full onboarding procedure is described here:

https://docs.google.com/document/d/1OskzP7OSv1wWe212Qgz_MpNTdNQcpgQbZAYKxjX12uA/edit#

We send out this PDF at the moment:

Coderbunker email registration.pdf

This creates an entry on Coderbunker Categorization:

https://docs.google.com/spreadsheets/d/11fWotgVODH5xuj6OH9YunbJCMnqCWD1Ud-pyJ_ID52A/edit#gid=0

Then we MANUALLY run a script

https://script.google.com/d/1Nnxm0mLzRMObgh_sO892JC05h5r_5eQTo3nXqDT_mbZoebpYLxTONPcB/edit

@Sunying-RONG read and integrate the script. I think what's interesting here is that you figured out a way to automatically run the mail sending script - that's the functionality we need to integrate to the next step.

andiechu commented 5 years ago
  1. clone the repo
  2. create a folder under /src
  3. work on your code in this folder: use clasp to pull down your script code in this folder.
  4. everytime you change the script's code in Google's Editor, use clasp pull to update your local codes. Then push them to Github
Sunying-RONG commented 5 years ago

This issue is seperated and finished by issues #67 #74 #75 #76