Update Gmail Signatures of Employees with Google Apps Script

Google Apps allows domain administrators to update the Gmail signatures programatically. This helps you maintain a standard email signature for all users of your organisation but certain fields like employee’s name, email address, title or phone number can be variable.

The Email Settings API is used for creating or retrieving Gmail Signatures and it is only available for Google Apps for Work accounts. Also, you need to have administrator privileges to update company-wide Gmail settings such as signatures. You can use both plain text and rich HTML signatures.

1. Create a HTML file with the signature template. The entry tag contains the apps:property tag for signature.

2. Paste this in the code.gs file. If you would like to update the signature of all Google Apps users, use the Google Admin SDK (AdminDirectory.Users.list()) to get a list of all users and loop through the list.

You would also need to include the Oauth2 library with the scope set as https://apps-apis.google.com/a/feeds/emailsettings/2.0/ for the email signature service.

You can also append standard legal disclaimers to the email signatures with this technique. First retrieve the existing Gmail signature of a Google App user, append the text and update the signature.