Added template to gam <UserTypeEntity> show signature

This commit is contained in:
Ross Scroggs
2026-01-25 19:53:54 -08:00
parent 4a969e716e
commit 887628ef87
3 changed files with 19 additions and 3 deletions

View File

@@ -8040,7 +8040,7 @@ gam <UserTypeEntity> signature|sig
[html [<Boolean>]] [replyto <EmailAddress>] [default] [treatasalias <Boolean>]
[name <String>]
[primary]
gam <UserTypeEntity> show signature|sig [compact|format|html]
gam <UserTypeEntity> show signature|sig [compact|format|html|template]
[primary|default] [verifyonly]
gam <UserTypeEntity> print signature [compact]
[primary|default] [verifyonly] [todrive <ToDriveAttribute>*]

View File

@@ -1,3 +1,13 @@
7.32.03
Added option `template` as an additional formating option for `gam <UserTypeEntity> show signature`
that displays just the HTML data; this simplifies capturing the data for use as input to GAM.
```
$ gam redirect stdout ./SigTemplate.html user user@domain.com show signature template
$ more SigTemplate.html
<div dir="ltr"><div dir="ltr"><div dir="ltr"><p style="margin:0px;font-size-adjust:none;font-stretch:normal;font-size:12px;line-height:normal;font-family:Monaco;color:rgb(0,0,0)"><span style="background-color:rgb(82,208,206)">{RT}Email: {Email}{/RT}</span></p><p style="margin:0px;font-size-adjust:none;font-stretch:normal;font-size:12px;line-height:normal;font-family:Monaco;color:rgb(0,0,0)"><span style="background-color:rgb(82,208,206)">{RT}Phone: {Phone}{/RT}</span></p><p style="margin:0px;font-size-adjust:none;font-stretch:normal;font-size:12px;line-height:normal;font-family:Monaco;color:rgb(0,0,0)"><span style="background-color:rgb(82,208,206)">{RT}Mobile: {Mobile}{/RT}</span></p></div><br></div>\n</div>
```
7.32.02
Added variable `oauth2_txt_lock_mode` to `gam.cfg`, the default is 644 and valid values are: 644, 664, 666.

View File

@@ -25,7 +25,7 @@ https://github.com/GAM-team/GAM/wiki
"""
__author__ = 'GAM Team <google-apps-manager@googlegroups.com>'
__version__ = '7.32.02'
__version__ = '7.32.03'
__license__ = 'Apache License 2.0 (http://www.apache.org/licenses/LICENSE-2.0)'
# pylint: disable=wrong-import-position
@@ -76524,10 +76524,14 @@ def printShowLanguage(users):
SIG_REPLY_HTML = 0
SIG_REPLY_COMPACT = 1
SIG_REPLY_FORMAT = 2
SIG_REPLY_TEMPLATE = 3 # Does not go in MAP
SIG_REPLY_OPTIONS_MAP = {'html': SIG_REPLY_HTML, 'compact': SIG_REPLY_COMPACT, 'format': SIG_REPLY_FORMAT}
SMTPMSA_DISPLAY_FIELDS = ['host', 'port', 'securityMode']
def _showSendAs(result, j, jcount, sigReplyFormat, verifyOnly=False):
if sigReplyFormat == SIG_REPLY_TEMPLATE:
writeStdout(f"{escapeCRsNLs(result.get('signature', 'None'))}\n")
return
if result['displayName']:
printEntity([Ent.SENDAS_ADDRESS, f'{result["displayName"]} <{result["sendAsEmail"]}>'], j, jcount)
else:
@@ -76792,7 +76796,7 @@ def printShowSendAs(users):
# gam <UserTypeEntity> print signature [compact]
# [primary] [verifyonly] [todrive <ToDriveAttribute>*]
# gam <UserTypeEntity> show signature|sig [compact|format|html]
# gam <UserTypeEntity> show signature|sig [compact|format|html|template]
# [primary] [verifyonly]
def printShowSignature(users):
csvPF = CSVPrintFile(['User', 'displayName', 'sendAsEmail', 'replyToAddress',
@@ -76813,6 +76817,8 @@ def printShowSignature(users):
verifyOnly = True
elif (not csvPF and myarg in SIG_REPLY_OPTIONS_MAP) or (csvPF and myarg == 'compact'):
sigReplyFormat = SIG_REPLY_OPTIONS_MAP[myarg]
elif not csvPF and myarg == 'template':
sigReplyFormat = SIG_REPLY_TEMPLATE
else:
unknownArgumentExit()
i, count, users = getEntityArgument(users)