Script for adding signature using PNG

138 views
Skip to first unread message

Nikolay G

unread,
Oct 19, 2022, 6:44:16 AM10/19/22
to GAM for Google Workspace
I am trying to deploy a signature using a PNG file but the error I get when using 
gam user <user id> signature file signature.png png

gives this error
signature.png, 'utf-8' codec can't decode byte 0x89 in position 0: invalid start byte

Is it even possible to import it as PNG or I should use only HTML.

Additionally if it is possible, what would be the command from a CSV with each user having a separate signature file as png?

James SEYMOUR

unread,
Oct 20, 2022, 9:26:40 PM10/20/22
to GAM for Google Workspace
Hi Nikolay,

I think the signature file needs to have the HTML code to display the image, like you would on a webpage. You can just add an image as a signature directly.

WRT CSV, this looks more complicated. I haven't done this but from looking into it, it looks like you need to have a file as the base signature, but you can use Tag Replacement to change this based on the values in a CSV. This page covers the tag replacement https://github.com/taers232c/GAMADV-XTD3/wiki/Tag-Replace#user-attribute-replace-tag-userreplacement-processing and this helpsheet from Kim (https://goo.gl/DXmmsB) runs through the process.

Hope this helps

James

Jay Lee

unread,
Oct 20, 2022, 9:29:23 PM10/20/22
to google-ap...@googlegroups.com
My recommendation is to set one user's signature using the Gmail UI however you want it to look, then run:

gam user <user> show signature

to see what it looks like and modify as you need for others.

Jay Lee


Jerudong International School
https://www.jerudonginternationalschool.com
Follow us on:
http://www.facebook.com/jisbruneidarussalam http://www.twitter.com/jisbrunei http://www.instagram.com/jisbrunei https://www.youtube.com/user/JISBrunei https://www.flickr.com/photos/133960569@N03/albums

--
You received this message because you are subscribed to the Google Groups "GAM for Google Workspace" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-man...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-manager/1dc5300d-befd-47fa-b970-9c7f8992c3ebn%40googlegroups.com.

James SEYMOUR

unread,
Oct 20, 2022, 9:38:12 PM10/20/22
to GAM for Google Workspace
Hi Jay,

Nikolay is looking to update users via a CSV file. So once you have the signature, is it possible to have this 'code' in a cell of a CSV to update the users? My understanding is that you can only update using a file.

Nikolay G

unread,
Nov 1, 2022, 10:39:03 AM11/1/22
to GAM for Google Workspace
I finally got an html file from my customer.

I was reviewing the file James sent but I am having issues running the command with the examples in it.

I printed the signatures with csv headers and so on but for some reason whenever I run the command for "UsersWithoutSignature", gam doesn't execute anything and doesnt show me an error. It just shows a new line and asks for a new command.

I don't have experience with html or python so maybe I am doing something wrong.

My understanding is that in the html file I need to replace the name with a {string} i.e. instead of Nikolay G > {firstName} {lastName}. Same goes for phone, title etc.

I've done that already on the file and now I am trying to get a command on GAM to pull the headers from the csv with the strings, place it on the html and set it as signature for the user. I can also provide the html file as well if that's alright.

Command I used was: gam csv UsersWithoutSignaturesOU.csv matchfield orgUnitPath "^test" gam user ~email signature file sign.txt html replace firstName ~firstName replace lastName ~lastName replace title ~title replace email ~email

Reply all
Reply to author
Forward
0 new messages