Objective: The aim of this project is to demonstrate how to automate the updating of Gmail signatures using Google Apps Script and OAuth2 authentication. This setup allows users to update their Gmail signature dynamically via a web app endpoint.
Steps to Follow:
Create and Configure Google Cloud Project: Follow this guide to setup your GCP.
Setup Google Apps Script: Use the OAuth2 library to handle the OAuth2 flow in Apps Script.
1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF
![](https://lh7-us.googleusercontent.com/docsz/AD_4nXenZXpGNQJMnEOt832oP7VzSIdtIR2AUPpcdXX1nikXK-v-cFQFRlvM2PRqgmBwB-A7LHmRA-Bg1Elsxe9mi5kCns6TNpHFrKDUXDlc3rMSQSspoITSK-UWv84Lm3TZ5-c8sHpunLd-dsF0TKkh8MFPm7uf?key=uD9M_PtZpSulOAKSpVf2ew)
Also, enable Gmail and AdminDirectory services within Apps script editor
![](https://lh7-us.googleusercontent.com/docsz/AD_4nXdnrOfOTLlHhV5I49x1AK7h3Ik9qa5GolZ9XE-aejUgBShsiDLWVxP0tP53joWYqaQQbCXOnZ9iv-l5daBlIsKtgERVa5iruEvc2e8hS9GZsMT9lL4QgkcBi-yGD41OO06YEDWSQKsGqwqHU_wOMpfY_6A?key=uD9M_PtZpSulOAKSpVf2ew)
For API code reference, check here : CODE
Deploy as a Web App: Deploy the script as a web app. Access the web app URL with required parameters to change the Gmail signature.
Example :
https://script.google.com/macros/s/{DEPLOYMENT_ID}/exec?email=user@example.com&name=John%20Doe&position=Developer&info=About%20Me
Configure Sheetgo Connection: Use the “Form Connection” feature to configure an API request. Choose “GET” as the request method.
![](https://lh7-us.googleusercontent.com/docsz/AD_4nXfsAUCsyKvhEBd6woM9gba00lcuaIAeKT-haUmQ3n3LUYEad85dU-fKUjz3-LzRPWGaSpxRbT8jcIVgKSken9ff1p58QOElJB1BZxbh6Xgs8tElriTIYF0yFTOR43sfus7DKctNaSFw7-qIMr1YB23Mv-Kb?key=uD9M_PtZpSulOAKSpVf2ew)
To get the Apps script token use this code : console.log(ScriptApp.getOAuthToken())