-
Notifications
You must be signed in to change notification settings - Fork 88
Users Gmail Send As Signature Vacation
- API documentation
- Definitions
- Manage sendas
- Display sendas
- Manage signature
- Display signature
- Manage vacation
- Display vacation
- User attribute
replace <Tag> <UserReplacement>
processing - Standardize user signatures
- https://developers.google.com/gmail/api/reference/rest/v1/users.settings.sendAs
- https://developers.google.com/gmail/api/v1/reference/users/settings
- https://support.google.com/a/answer/1710338
<FalseValues>= false|off|no|disabled|0
<TrueValues> ::= true|on|yes|enabled|1
<DomainName> ::= <String>(.<String>)+
<EmailAddress> ::= <String>@<DomainName>
<EmailAddressList> ::= "<EmailAddress>(,<EmailAddress>)*"
<EmailAddressEntity> ::=
<EmailAddressList> | <FileSelector> | <CSVkmdSelector> | <CSVDataSelector>
See: https://github.com/taers232c/GAMADV-XTD3/wiki/Collections-of-Users
<Charset> ::= ascii|mbcs|utf-8|utf-8-sig|utf-16|<String>
<Password> ::= <String>
<SMTPHostName> ::= <String>
<Tag> ::= <String>
<UserName> ::= <String>
<UserReplacement> ::=
(field:<UserReplacementFieldName>)|(schema:<SchemaName>.<FieldName>)|<String>
<StorageBucketName> ::= <String>
<StorageObjectName> ::= <String>
<StorageBucketObjectName> ::=
https://storage.cloud.google.com/<StorageBucketName>/<StorageObjectName>|
https://storage.googleapis.com/<StorageBucketName>/<StorageObjectName>|
gs://<StorageBucketName>/<StorageObjectName>|
<StorageBucketName>/<StorageObjectName>
<UserGoogleDoc> ::=
<EmailAddress> <DriveFileIDEntity>|<DriveFileNameEntity>|(<SharedDriveEntity> <SharedDriveFileNameEntity>)
<SendAsContent> ::=
(sig|signature|htmlsig <String>)|
(file|htmlfile <FileName> [charset <Charset>])|
(gdoc|ghtml <UserGoogleDoc>)|
(gcsdoc|gcshtml <StorageBucketObjectName>)
<SignatureContent> ::=
(<String>)|
(file|htmlfile <FileName> [charset <Charset>])|
(gdoc|ghtml <UserGoogleDoc>)|
(gcsdoc|gcshtml <StorageBucketObjectName>)
<VacationMessageContent> ::=
(message|textmessage|htmlmessage <String>)|
(file|textfile|htmlfile <FileName> [charset <Charset>])|
(gdoc|ghtml <UserGoogleDoc>)|
(gcsdoc|gcshtml <StorageBucketObjectName>)
gam <UserTypeEntity> [create|add] sendas <EmailAddress> [name] <String>
[<SendAsContent> (replace <Tag> <UserReplacement>)*]
[html [<Boolean>]] [replyto <EmailAddress>] [default] [treatasalias <Boolean>]
[smtpmsa.host <SMTPHostName> smtpmsa.port 25|465|587
smtpmsa.username <UserName> smtpmsa.password <Password>
[smtpmsa.securitymode none|ssl|starttls]]
gam <UserTypeEntity> update sendas <EmailAddress> [name <String>]
[<SendAsContent> (replace <Tag> <UserReplacement>)*]
[html [<Boolean>]] [replyto <EmailAddress>] [default] [treatasalias <Boolean>]
gam <UserTypeEntity> delete sendas <EmailAddressEntity>
With create|add
, the <String>
following <EmailAddress>
and optionally name
, is the display name
of the sendas address.
<SendAsContent>
is the signature, there are four ways to specify it:
-
sig|signature|htmlsig <String>
- Use<String>
as the signature -
file|htmlfile <FileName> [charset <Charset>]
- Read the signature from<FileName>
-
gdoc|ghtml <UserGoogleDoc>
- Read the signature from<UserGoogleDoc>
-
gcsdoc|gcshtml <StorageBucketObjectName>
- Read the signature from the Google Cloud Storage file<StorageBucketObjectName>
The default
option sets <EmailAddress>
as the default sendas address for the user.
For treatasalias
, see: https://support.google.com/a/answer/1710338
You can allow users to send mail through an external SMTP server when configuring a sendas address hosted outside your email domains. You must enable this capability in Admin Console/Apps/Google Workspace/Gmail/Advanced settings/End User Access/Allow per-user outbound gateways.
Example:
Paul shall send emails from the marketing email address with the name Paul from Example" and replies shall go back to them.
gam user paul add sendas [email protected] "Paul from Example" replyto paul
gam <UserTypeEntity> info sendas <EmailAddressEntity> [compact|format|html]
gam <UserTypeEntity> show sendas [compact|format|html]
[primary|default] [verifyonly]
These are the output formatting options:
-
compact
- Escape carriage returns as \r and newlines as \n in original HTML; this format produces output that can be used as input to GAM -
format
- Strip HTML keywords leaving basic printable information -
html
- Show original HTML; this is the default option; the output is human readable but cannot be used as input to GAM
By default, all sendas addresses are shown, use these options to limit the display:
-
primary
- Display the primary email address -
default
- Display the default sendas address
Use the verifyonly
option to display True
or False
in the signature field based on whether the signature is non-blank.
gam <UserTypeEntity> print sendas [compact]
[primary|default] [verifyonly] [todrive <ToDriveAttribute>*]
These are the output formatting options:
-
compact
- Strip carriage returns and newlines in original HTML; this makes these values easier to process in the CSV file and can be used as input to GAM.
By default, all sendas addresses are shown, use these options to limit the display:
-
primary
- Display the primary email address -
default
- Display the default sendas address
Use the verifyonly
option to display True
or False
in the signature field based on whether the signature is non-blank.
gam <UserTypeEntity> signature|sig
<SignatureContent> (replace <Tag> <UserReplacement>)*
[html [<Boolean>]] [replyto <EmailAddress>] [default] [treatasalias <Boolean>]
[name <String>]
[primary]
<SignatureContent>
is the signature, there are four ways to specify it:
-
<String>
- Use<String>
as the signature -
file|htmlfile <FileName> [charset <Charset>]
- Read the signature from<FileName>
-
gdoc|ghtml <UserGoogleDoc>
- Read the signature from<UserGoogleDoc>
-
gcsdoc|gcshtml <StorageBucketObjectName>
- Read the signature from the Google Cloud Storage file<StorageBucketObjectName>
The default
option sets <EmailAddress>
as the default sendas address for the user.
For treatasalias
, see: https://support.google.com/a/answer/1710338
When <UserTypeEntity>
specifies an alias, the primary
option causes the primary
email address signature rather than the alias signature to be set.
[name <String>]
sets the display name for non-primary sendas addresses, not the name of the signature, as that isn't possible via the API.
If you have a current default signature, the API will update that, but if you delete it, it seems that the API will not over-write any of the other signatures, but instead add a new signature called My signature
. If you rename that signature, the API will keep on updating that same signature, and not touch the other signatures.
gam <UserTypeEntity> show signature|sig [compact|format|html]
[primary|default] [verifyonly]
These are the output formatting options:
-
compact
- Escape carriage returns as \r and newlines as \n in original HTML; this format produces output that can be used as input to GAM -
format
- Strip HTML keywords leaving basic printable information -
html
- Show original HTML; this is the default option; the output is human readable but cannot be used an input to GAM
By default, the signature for <UserTypeEntity>
is displayed, use these options to alter the display:
-
primary
- Display the primary email address signature -
default
- Display the default sendas address signature
Use the verifyonly
option to display True
or False
in the signature field based on whether the signature is non-blank.
gam <UserTypeEntity> print signature [compact]
[primary|default] [verifyonly] [todrive <ToDriveAttribute>*]
These are the output formatting options:
-
compact
- Strip carriage returns and newlines in original HTML; this makes these values easier to process in the CSV file and can be used as input to GAM.
By default, the signature for <UserTypeEntity>
is displayed, use these options to alter the display:
-
primary
- Display the primary email address signature -
default
- Display the default sendas address signature
Use the verifyonly
option to display True
or False
in the signature field based on whether the signature is non-blank.
The command line is wrapped for readability.
gam config csv_output_row_filter "signature:boolean:false"
csv_output_header_filter "User,displayName,signature"
auto_batch_min 1 num_threads 10
redirect csv ./NoPrimarySignature.csv multiprocess
all users print signature primary verifyonly
-
config csv_output_row_filter "signature:boolean:false"
- Output rows that indicate no signature -
csv_output_header_filter "User,displayName,signature"
- Output basic headers -
auto_batch_min 1 num_threads 10
- Turn on parallel processing -
redirect csv ./NoPrimarySignature.csv multiprocess
- Intelligently combine output from all processes -
all users
- Process all non-suspended users -
print signature primary verifyonly
- Display state of primary email address signature
gam <UserTypeEntity> vacation [<Boolean>] [subject <String>]
[<VacationMessageContent> (replace <Tag> <UserReplacement>)*]
[html [<Boolean>]] [contactsonly [<Boolean>]] [domainonly [<Boolean>]]
[start|startdate <Date>|Started] [end|enddate <Date>|NotSpecified]
The initial <Boolean>
can be omitted to allow updates to other fields without affecting the current responder state.
<VacationMessageContent>
is the vacation message, there are four ways to specify it:
-
message|textmessage|htmlmessage <String>
- Use<String>
as the vacation message -
file|htmlfile <FileName> [charset <Charset>]
- Read the vacation message from<FileName>
-
gdoc|ghtml <UserGoogleDoc>
- Read the vacation message from<UserGoogleDoc>
-
gcsdoc|gcshtml <StorageBucketObjectName>
- Read the vacation message from the Google Cloud Storage file<StorageBucketObjectName>
It's highly recommended to set (overwrite) start and end date. Otherwise it may not work for users who used vacation messages previously and where the end date is already expired.
Example:
gam [email protected] vacation ON subject "[Out of Office]" file autoreply.eml start 2000-01-01 end 2999-01-01
gam <UserTypeEntity> show vacation [compact|format|html] [enabledonly]
Gam displays the information as an indented list of keys and values.
These are the output formatting options:
-
compact
- Escape carriage returns as \r and newlines as \n in original HTML; this format produces output that can be used as input to GAM -
format
- Strip HTML keywords leaving basic printable information -
html
- Show original HTML; this is the default option; the output is human readable but cannot be used an input to GAM -
enabledonly
- Do not display users with vacation autoreply disabled.
gam <UserTypeEntity> print vacation [compact] [enabledonly] [todrive <ToDriveAttribute>*]
Gam displays the information in CSV form.
-
compact
- Strip carriage returns and newlines in original HTML; this makes these values easier to process in the CSV file and can be used as input to GAM. -
enabledonly
- Do not display users with vacation autoreply disabled.
You can standardize user signatures by creating a signature template and a CSV file with data for each user.
You can create a signature template by defining the signature in the Gmail Settings GUI of a test user.
You must use the default signature My signature
.
Use text like {FirstName}
and {Email}
in the locations where the actual values will go.
Once you're created the template signature, do the following:
$ gam user [email protected] show signature compact > SimpleSig.html
$ more SimpleSig.html
SendAs Address: <[email protected]>
IsPrimary: True
Default: True
Signature: <div dir="ltr">--<div>Name: {FirstName} {LastName}<div>Phone: {Phone}</div><div>Email: {Email}</div></div><div><br></div><div>Company Name</div><div>Company Address</div><div><br></div></div>\n
Edit SimpleSig.html and delete all text from SendAs
through Signature:
.
The result should be:
<div dir="ltr">--<div>Name: {FirstName} {LastName}<div>Phone: {Phone}</div><div>Email: {Email}</div></div><div><br></div><div>Company Name</div><div>Company Address</div><div><br></div></div>\n
This is a sample Users.csv file.
email,first,last,phone
[email protected],Bob,Smith,510-555-1212 x 123
[email protected],Mary,Jones,510-555-1212 x 456
This command will update the user's signatures.
gam csv Users.csv gam user "~email" signature htmlfile SimpleSig.html replace FirstName "~first" replace LastName "~last" replace Phone "~phone" replace Email "~email"
Need more help? Ask on the GAM Discussion Group
Update History
Installation
- How to Install GAM7
- How to Uograde GAMADV-XTD3 to GAM7
- How to Upgrade Legacy GAM to GAM7
- How to Update GAM7
- Install GAM as Python Library
- GAM7 on Chrome OS Devices
- GAM7 on Android Devices
- Google Network Addresses
- HTTPS Proxy
- SSL Root CA Certificates
- How to Uninstall GAM7
Configuration
- Authorization
- GAM Configuration
- Running GAM7 securely on a Google Compute Engine
- Using GAM7 with a delegated admin service account
- Using GAM7 with a YubiKey
Notes and Information
- Upgrade Benefits
- Questions? Visit the GAM Discussion Forum
- GAM Public Chat Room
- Scripts
- Other Resources
- Drive REST API v3
- BNF Syntax
- GAM Return Codes
- Python Regular Expressions
- Rclone
Definitions
Command Processing
- Bulk Processing
- Command Line Parsing
- Command Logging and Progress
- Command data from Google Docs/Sheets/Storage
- CSV Special Characters
- CSV Input Filtering
- CSV Output Filtering
- Meta Commands and File Redirection
- Permission matches
- Tag Replace
- Todrive
Collections
Client Access
- Addresses
- Administrators
- Alert Center
- Aliases
- Calendars
- Calendars - Access
- Calendars - Events
- Chrome Auto Update Expiration Counts
- Chrome Browser Cloud Management
- Chrome Device Needs Attention Counts
- Chrome Installed Apps
- Chrome Policies
- Chrome Printers
- Chrome Profile Management
- Chrome Version Counts
- Chrome Version History
- ChromeOS Devices
- Classroom - Courses
- Classroom - Guardians
- Classroom - Invitations
- Classroom - Membership
- Cloud Channel
- Cloud Identity Devices
- Cloud Identity Groups
- Cloud Identity Groups - Membership
- Cloud Identity Policies
- Cloud Storage
- Context Aware Access Levels
- Customer
- Domains
- Domains - Verification
- Domain People - Contacts & Profiles
- Domain Shared Contacts - Global Address List
- Email Audit Monitor
- Find File Owner
- Google Data Transfers
- Groups
- Groups - Membership
- Inbound SSO
- Licenses
- Mobile Devices
- Organizational Units
- Reports
- Reseller
- Resources
- Send Email
- Schemas
- Shared Drives
- Sites
- Users
- Unmanaged Accounts
- Users - Signout and Turn off 2-Step Verification
- Vault - Takeout
- Version and Help
Special Service Account Access
Service Account Access
- Users - Analytics Admin
- Users - Application Specific Passwords
- Users - Backup Verification Codes
- Users - Calendars
- Users - Calendars - Access
- Users - Calendars - Events
- Users - Chat
- Users - Classification Labels
- Users - Classroom - Profile
- Users - Deprovision
- Users - Contacts
- Users - Contacts - Delegates
- Users - Drive - File Selection
- Users - Drive - Activity/Settings
- Users - Drive - Cleanup
- Users - Drive - Comments
- Users - Drive - Copy/Move
- Users - Drive - Files-Display
- Users - Drive - Files-Manage
- Users - Drive - Orphans
- Users - Drive - Ownership
- Users - Drive - Permissions
- Users - Drive - Query
- Users - Drive - Revisions
- Users - Drive - Shortcuts
- Users - Drive - Transfer
- Users - Forms
- Users - Gmail - Client Side Encryption
- Users - Gmail - Delegates
- Users - Gmail - Filters
- Users - Gmail - Forwarding
- Users - Gmail - Labels
- Users - Gmail - Messages/Threads
- Users - Gmail - Profile
- Users - Gmail - S/MIME
- Users - Gmail - SendAs/Signature/Vacation
- Users - Gmail - Settings
- Users - Group Membership
- Users - Keep
- Users - Looker Studio
- Users - Meet
- Users - Classroom - Profile
- Users - People - Contacts & Profiles
- Users - Photo
- Users - Profile Sharing
- Users - Shared Drives
- Users - Spreadsheets
- Users - Tasks
- Users - Tokens
- Users - YouTube