原始内容
Digital Print Request System
A web-based print request system for University of Westminster Harrow Digital Print services.
Architecture
DIGITAL PRINT REQUEST FLOW
POST JSON
�
index.html Google Apps Script
�
(GitHub Reference Number (Web App Endpoint)
Pages)
Redirect with Append Row
?ref=PR-XXXXXX + Send Email
� �
MS Forms Google Sheet
(File (Order Database
Upload) + Status Tracking)
Custom Menu
Actions
�
Email to Student
(Confirmation /
Ready Notification)
Setup Instructions
1. Create the Google Sheet
- Go to Google Sheets and sign in with your institutional Google account
- Click Blank to create a new spreadsheet
- Name it something descriptive like
Digital Print Requests 2024-25 - The headers will be created automatically when the first submission is received, but you can run the setup manually (see Step 2)
2. Set Up Google Apps Script
- In your Google Sheet, go to Extensions � Apps Script
- Delete any existing code in the editor
- Copy the entire contents of
google-apps-script.jsand paste it into the editor - Click the Save icon (or press
Ctrl/Cmd + S) - Name your project (e.g., "Print Request Handler")
Configure the Script
Before deploying, update the CONFIG object near the top of the script:
const CONFIG = {
senderName: 'Harrow Digital Print',
universityName: 'University of Westminster',
departmentEmail: 'your.email@westminster.ac.uk', // � Update this
sheetName: 'Sheet1', // � Change if your sheet has a different name
// ...
};
Deploy as Web App
- Click Deploy � New deployment
- Click the gear icon � next to "Select type" and choose Web app
- Configure the settings:
- Description:
Print Request API v1 - Execute as:
Me - Who has access:
Anyone
- Description:
- Click Deploy
- Click Authorise access when prompted
- Select your Google account and grant the required permissions
- Copy the Web App URL you'll need this for the HTML form
� Important: If you make changes to the script later, you must create a new deployment for those changes to take effect.
Create Headers Manually (Optional)
If you want to set up the headers before receiving any submissions:
- In Apps Script, click on the function dropdown (shows
myFunctionby default) - Select
manuallyCreateHeaders - Click Run
3. Create the MS Forms for File Upload
- Go to Microsoft Forms
- Sign in with your university Microsoft account
- Click New Form
- Name it "Digital Print File Upload"
Add Fields
Reference Number (required)
- Click Add new � Text
- Question: "Reference Number"
- Subtitle: "Enter your reference number (e.g., PR-123456)"
- Toggle Required on
File Upload (required)
- Click Add new � File upload
- Question: "Upload your print file(s)"
- Subtitle: "Accepted formats: TIFF, PSD, PDF, JPEG (300 DPI minimum)"
- Set file number limit (e.g., up to 10 files)
- Set file size limit (e.g., 1GB total)
- Toggle Required on
Additional Comments (optional)
- Click Add new � Text
- Question: "Any additional comments?"
- Toggle Long answer on
Get the Form URL
- Click Collect responses (or Share)
- Copy the form URL
- You'll use this URL in the HTML configuration
4. Configure the HTML Form
- Open
index.htmlin a text editor - Scroll to the bottom and find the
CONFIGobject:
const CONFIG = {
googleScriptUrl: 'https://script.google.com/macros/s/YOUR_SCRIPT_ID/exec',
msFormsUrl: 'https://forms.office.com/Pages/ResponsePage.aspx?id=YOUR_FORM_ID'
};
- Replace
YOUR_SCRIPT_IDwith your actual Google Apps Script Web App URL - Replace
YOUR_FORM_IDwith your actual Microsoft Forms URL - Save the file
5. Deploy to GitHub Pages
Create a new repository on GitHub
Upload all three files:
index.htmlgoogle-apps-script.jsREADME.md
Enable GitHub Pages:
- Go to Settings � Pages
- Under "Source", select Deploy from a branch
- Choose main branch and / (root) folder
- Click Save
Your form will be live at:
https://yourusername.github.io/repository-name/
How It Works
For Students
- Visit the form Access the print request form via the GitHub Pages URL
- Configure your print Select size, paper type, and quantity; see the live price calculation
- Complete pre-flight checks Confirm your image meets the technical requirements
- Enter your details Provide name, email, student ID, and course
- Submit the form Receive a unique reference number (PR-XXXXXX)
- Upload your files Click the link to upload files via Microsoft Forms, including your reference number
- Wait for email Receive a confirmation email immediately, then a "ready for collection" email when prints are done
- Collect and pay Pick up your prints from the Digital Print room with your reference number and payment
For Technicians
Viewing Requests
- Open the Google Sheet to see all print requests
- Each row contains all the order details, contact information, and pre-flight check confirmations
- Status column shows:
New�Processing�Ready for Collection�Collected
Using the Custom Menu
When you open the Google Sheet, a Print Requests menu appears with these options:
| Menu Item | Action |
|---|---|
| Send Ready Email for Selected Row | Sends "prints ready" email to the student and updates status |
| Update Status to Processing | Marks the order as being worked on |
| Update Status to Ready | Marks as ready (also sets Ready Date) |
| Update Status to Collected | Marks as collected by student |
| Refresh Headers | Reformats the header row if needed |
Workflow
- Review new submissions in the sheet
- Check the uploaded files in Microsoft Forms responses
- Set status to Processing when starting the print job
- Once complete, use Send Ready Email for Selected Row to notify the student
- When the student collects, set status to Collected
Customisation
Changing Prices
In index.html, find the PRICES object in the JavaScript section:
const PRICES = {
B0: { plain: 10, standard: 80, fibre: 112 },
A0: { plain: 5, standard: 40, fibre: 56 },
A1: { plain: 2.50, standard: 20, fibre: 28 },
A2: { plain: 1.25, standard: 10, fibre: 14 },
A3: { plain: null, standard: 5, fibre: 7 },
A4: { plain: null, standard: 2.50, fibre: null }
};
plain= Plain paper pricestandard= Standard paper pricefibre= Fibre-based paper pricenull= Not available for this size
Adding/Removing Paper Types
In index.html, find the paper type <select> element and modify the options:
<optgroup label="Standard Papers">
<option value="New Paper Name" data-category="standard">New Paper Name</option>
<!-- Add data-max-size="A3" to restrict to smaller sizes -->
</optgroup>
The data-category attribute must be one of: standard, fibre, or plain
Adding Courses
In index.html, find the course <select> element:
<optgroup label="Undergraduate (UG)">
<option value="BA New Course">BA New Course</option>
</optgroup>
<optgroup label="Postgraduate (PG)">
<option value="MA New Course">MA New Course</option>
</optgroup>
Changing Branding Colours
In index.html, modify the CSS custom properties at the top of the <style> section:
:root {
--primary: #1e3a5f; /* Main brand colour */
--primary-light: #2d5a8a; /* Lighter variant */
--primary-dark: #152a45; /* Darker variant */
--accent: #4a90d9; /* Accent/focus colour */
--success: #28a745; /* Success messages */
--error: #dc3545; /* Error messages */
/* ... */
}
Changing Email Templates
In google-apps-script.js, find the sendConfirmationEmail() and sendReadyEmail() functions to modify the HTML email templates.
File List
| File | Description |
|---|---|
index.html |
The main web form with styling, validation, and submission logic |
google-apps-script.js |
Google Apps Script backend for handling submissions, managing the spreadsheet, and sending emails |
README.md |
This documentation file |
Troubleshooting
Form submissions aren't appearing in the sheet
- Check the Web App URL: Ensure you copied the correct URL from the deployment
- Check permissions: The Web App must be set to "Anyone" can access
- Check the Apps Script logs: In Apps Script, go to Executions to see any errors
- CORS issues: The form uses
mode: 'no-cors'ensure this is in the fetch request
Emails aren't being sent
- Check Gmail permissions: The script needs permission to send emails via Gmail
- Check quota: Google has daily email sending limits
- Check spam folders: Confirmation emails may be filtered
Custom menu doesn't appear
- Refresh the sheet: Close and reopen the Google Sheet
- Check authorisation: You may need to run
onOpenmanually once to grant permissions
Price shows "N/A"
- This means the selected size/paper combination isn't available
- Check the
PRICESobject to see which combinations are valid
File upload link doesn't work
- Check the MS Forms URL: Ensure it's correct in the CONFIG object
- Check form permissions: The form must be accessible to your target audience
Reference number not passing to MS Forms
- Microsoft Forms may not support URL parameters for all field types
- Students should manually enter their reference number in the form
Support
For technical issues with this system, contact:
[Your Name / Department] =� [your.email@westminster.ac.uk] =� Harrow Campus, Digital Print Room
License
This project was created for University of Westminster Harrow Digital Print services.
Last updated: December 2024