Giter Club home page Giter Club logo

trilogy-tutor-tracking-custom-menu's Introduction

Trilogy Tutor Tracking Sheet - Custom Menu Items

by Victor Yamaykin, Senior Data Visualization Tutor


Description:

This is a script for the Google Tutor Tracking Spreadsheet. After entering a new student's information on your roster, you will be able to click on the "Send Emails" menu and select "Send Intro Email". The function will send a draft of the email to your Gmail folder labeled "Drafts".

For the weekly availability email, the function will send a separate draft of the weekend email for each student (and CC to Central Support).

That way you can verify before sending them out just in case if someone is no longer on your student roster.

Using the project triggers, you can have the emails sent automatically to your Drafts folder every week.

Requirements:

  • Gmail, Google Sheets all associated with the same Google Account.
  • A separate sheet named "Student Roster"

Installation:

  1. From the Tutor Tracking sheet, select the menu item Tools > Script Editor.

  2. If this is the first time you've been to script.google.com, you'll be redirected to a page that introduces Apps Script. Click Start Scripting to proceed to the script editor.

  3. A welcome screen will ask what kind of script you want to create. Click Blank Project or Close. Delete any code in the script editor and paste in the code below.

  4. Enter your calendly link for the variable "calendly", then copy and paste the link inside the message for display text, and add your name where needed.

  5. Select the menu item File > Save. Name your new script and click OK.

// Create a new menu item called Send Emails with a dropdown box

function onOpen() {
  var ui = SpreadsheetApp.getUi();
  ui.createMenu('Send Emails')
      .addItem('Send intro email', 'intro')
      .addItem('Send weekend email', 'weekly')
      .addToUi();
}

// A unique function to find out the last row number on your student roster

function getLastRowSpecial(range){
  var rowNum = 0;
  var blank = false;
  for(var row = 0; row < range.length; row++){
    if(range[row][0] === "" && !blank){
      rowNum = row;
      blank = true;
    }else if(range[row][0] !== ""){
      blank = false;
    };
  };
  return rowNum;
};

// Send intro email to let student know how to schedule sessions

function intro(email) {

  // Select the student roster
var wb = SpreadsheetApp.getActiveSpreadsheet();
var sh1 = wb.getSheetByName("Student Roster");

// Display the input box   
var ui = SpreadsheetApp.getUi();
var response = ui.prompt(
  'Introductory Email Details', 
  'Which student?' + " (row number)", 
   ui.ButtonSet.OK_CANCEL);

// Process the user's response.
if (response.getSelectedButton() == ui.Button.OK) {
  var row = response.getResponseText();

  // Use row number to collect relevant information
  var name = sh1.getRange("C" + row).getValue();
  Logger.log(name)
  var email = sh1.getRange("D" + row).getValue();
  Logger.log(email)

// ENTER YOUR CALENDLY LINK 

  var calendly = " "; 

// Enter your name and the display text for your calendly link in the message below
 
  var message = []; 

    message += "Hi "+ name +"!" + 
"<br><br>Nice to meet you! My name is <!-- ENTER YOUR NAME-->, and I was assigned to be your tutor. I am a graduate of the YOUR AREA OF STUDY Coding Boot Camp so I understand the challenges you're facing in the boot camp very well!<br>" +
"<br>I just sent you an invite to our tutoring Slack Team, Tutors & Students. This is where we will be communicating through Direct Message (DM).  Let me know if you don't see the invite or have any issues getting signed up.  Please send me a direct message once you create your account there. You can DM me on that Slack by using my Slack name @YOUR SLACK NAME. Make sure to have that Slack available on your mobile phone so that you can message me if there are problems with wifi, etc.<br>" +
"<br>Below, I'll provide you with the link to my calendly.  Let me know which of those time slots works best for you and we can schedule a session. If our availability doesn't sync, let me know and I'll see if we can figure something out.</strong><br>" +
"<br><strong><u>Maximum tutorial sessions per week - our week is Monday - Sunday.</u></strong><br>" +
"<ul><li>Part-time (6 month boot camp) students are entitled to 1 session per week.</li>" +
"<li>Full-time (3 month boot camp) students with an assigned group tutor will receive 1 one-on-one session and 1 group session per week.</li>" +
"<li>Full-time (3 month boot camp) students without a group tutor are entitled to 2 one-on-one sessions per week.</li></ul>" +
"Schedule your session at: <a href='" + calendly + "'><!--ENTER DISPLAY TEXT OF YOUR CALENDLY LINK HERE--></a><br>" + 
"<br><mark><strong>On the Calendly page, be sure you have the correct time zone selected in the section labeled 'Times are in'</strong></mark><br>" +
'<br>Each session takes place over Zoom.us (video chat/screen sharing) and lasts about 50 minutes. I\'ll email you the Zoom.us link the day before our scheduled time. (If you have not used zoom before please join the meeting at least 15 minutes early as it may have you download and install some software.)<br>' +  
"<br>Again, all I need from you:" +
"<ul><li>Be on Tutors & Students Slack 5 minutes before your time slot.</li>" +
"<li>Make sure your computer/mic/internet connection are working.</li>" +
"<li>Make sure your work space is quiet and free from interruptions.</li></ul>" +
"At the end of the session, I will provide you with a link to a 2 minute evaluation form that you are required to complete.<br><br>" +
"Slack or email me with any questions.  I'm looking forward to our meeting!<br><br>" +
"<strong>CC Central Support on all email by always using REPLY ALL.</strong><br><br>" +
"Sincerely,<br><!--YOUR NAME-->";

// ENTER THE SPECIFIC COURSE (DV, FSF, etc.) FOR THE SUBJECT LINE

var subject = 'Coding Boot Camp - Tutorial Available';

// Create the email draft

// .createDraft() is for testing and .sendEmail() can be used instead to mail directly 

  GmailApp.createDraft(email, subject, "", {cc: "[email protected]", htmlBody: message});

// Log other responses to input box 
} else if (response.getSelectedButton() == ui.Button.CANCEL) {
  Logger.log('The user didn\'t want to provide a number.');
} else {
  Logger.log('The user clicked the close button in the dialog\'s title bar.');
}
};

// Weekend email for tutorial availability

function weekly(email) {
// Select sheet
  var wb = SpreadsheetApp.getActiveSpreadsheet();
  var sh1 = wb.getSheetByName("Student Roster");

// ENTER YOUR CALENDLY LINK HERE!

  var calendly = "   " ; 

// Collect email addresses

  var emailAddressColumn = sh1.getRange("D2:D").getValues();
  var emailLastRow = getLastRowSpecial(emailAddressColumn);
  var emailList = sh1.getRange(2, 4, emailLastRow, 1).getValues();
  Logger.log(emailList);

  // Make lists for each set of data

  var nameColumn = sh1.getRange("C2:C").getValues();
  var nameLastRow = getLastRowSpecial(nameColumn);
  var nameList = sh1.getRange(2, 3, nameLastRow, 1).getValues();

  //  // Send Alert Email to Multiple Email Addresses

  for (var i = 0; i < emailList.length; i++) {

// Enter your name and the display text for your calendly link in the message below

    var message = [];
    message += "Hi "+ nameList[i] +"!" +
      "<br><br>I hope you had a great week! Here's the link to schedule another tutoring session if you wish:<br><br>" +
"<a href='" + calendly + "'><!--ENTER DISPLAY TEXT OF YOUR CALENDLY LINK HERE--></a>" + "<br><br><mark><strong>On the Calendly page, be sure you have the correct time zone selected in the section labeled 'Times are in'</strong></mark>" +
"<br><strong>If our availability doesn't sync, let me know and I'll see if we can figure something out.</strong><br>" +
"<br><strong><u>Maximum tutorial sessions per week - our week is Monday - Sunday.</u></strong><br>" +
"<ul><li>Part-time (6 month boot camp) students are entitled to 1 session per week.</li>" +
"<li>Full-time (3 month boot camp) students with an assigned group tutor will receive 1 one-on-one session and 1 group session per week.</li>" +
"<li>Full-time (3 month boot camp) students without a group tutor are entitled to 2 one-on-one sessions per week.</li></ul>" +
"If you have already scheduled a tutoring session for this week please ignore this email.<br><br>" +
"If you have any questions or none of the times available work for you please let me know and I would be happy to help.<br><br>" +
"If you would like to schedule regular, recurring sessions at the same day/time each week, just let me know by REPLY ALL and we can work it out.  This is particularly useful if you have a strict schedule so you won't have to compete for time on my calendar.<br><br>" +
"<strong>CC Central Support on all email by always using REPLY ALL.</strong><br><br>" +
"<strong>Boot camp tip! - Our Learning Assistant team is available to help you every day with your curriculum-based questions." +
" We think you’ll find this resource very helpful as a supplement to tutor support, TA office hours, and class time." +   
" If you’re unsure how to utilize that resource, please speak to your TAs, Instructor, or Success Manager (SSM / PSM).</strong><br><br>" +
"Sincerely,<br><!--ENTER YOUR NAME-->";

// ENTER THE SPECIFIC COURSE (DV, FSF, etc.) FOR THE SUBJECT LINE

  var subject = "Coding Boot Camp - Tutorial Available";

// .createDraft() is for testing and .sendEmail() can be used instead to mail directly 

    GmailApp.createDraft(
      emailList[i],
      subject, "",
      {cc: '[email protected],htmlBody: message});
  }
  };   

Result:

Current project trigger settings

  1. To set up the automatic email drafts, go to Edit > Current Project's Triggers to set up a schedule to run the weekly() function at a time that suits you. Click + Add Trigger in the bottom right corner as shown below. These are the settings that I use: "time-driven, weekly timer, every Friday, from 9 to 10am, notify me immediately if there's an error."

Current project trigger settings

  1. If you select the menu item Run, a dialog box will appear and tell you that the script requires authorization. Click Continue. A second dialog box will then request authorization for specific Google services. Read the notice, then click Allow.

  2. Close the tutor tracking speadsheet and reopen. Now you have custom menu item buttons to "Send intro email" to a new student on your roster and "Send weekend email" if you prefer sending manually. Thanks for your time! ^_^

Notes:

  • I haven't tested functionality with a non-gmail account, so please let me know if that would be helpful.

  • You can switch the GmailApp.createDraft() to .sendEmail() instead to skip the drafts folder and send right away.

  • If you run into any issues, Slack me @victoryamaykin or use the issues tab.

Thanks!

trilogy-tutor-tracking-custom-menu's People

Contributors

victoryamaykin avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.