Download the PHP package moometric/gsuite without Composer

On this page you can find all versions of the php package moometric/gsuite. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package gsuite

Packagist Version License

GSuite Signature Manager (PHP)

Ensure that all your users have a standard signature by updating them using the gmail API. Users signatures can be updated direct from the GSuite users directory using standard and custom fields or alternatively from a JSON users file.

alt text

Getting Started

Prerequisites

Installing

Step 1: Create your service account

Ensure that you have gone through the steps described here to get your service-account.json file. More information can be found on the Google Admin SDK Guide to setting up a service account for your GSuite domain.

Step 2: Grant Domain Wide Delegation

Ensure that you have granted domain wide delegation through the GSuite console for the following scopes of your service account

Step 3: Install or clone this repo

OR

Step 4: Update your signature template

By default there is a signature template located in "signatures/defaultSig.html". You can modify this template and include your own MERGE fields.

Merge fields are in the following format {{mergeFieldOne}}. If you're not sure what merge fields you can use, use listMergeFields() function to view a list of available merge tags.

Step 5: Instantiate the signature object

If using composer, don't forget to include your autoload file.

Testing

Included is an index.php file which contains a few tests to get started.

Once you go live, ensure that you switch off testing mode.

Usage Examples

Message of the day

Set/Update the MOTD for all GSuite users

This will set "Hello World" as the MOTD for all GSuite users

Removing the MOTD for all GSuite users

If exists, this will remove MOTD for all GSuite users

Set/Update/Remove MOTD for select GSuite users

If you only want certain GSuite users to have a MOTD, you can filter the users by their primary email.

Or remove MOTD from those same select users

Updating the signature

Update signature for all domain users

Update the signature for all domain users from the default template.

Update signature for all domain users and set MOTD

Update the signature for all domain users from the default template.

Update signature for only certain users or single user

Update the signature for all domain users from the default template. In the example below only [email protected] and [email protected] will be updated, all other users will be excluded

Exclude users who don't have their profile photo set

Update the signature for all domain users but exclude those who don't have a profile photo or title set.

Update signature for users in a JSON file

Update the signature for users in the JSON file testUsers.json.

Update signature for users in your own array

In this example only users who are in the array below will be updated with a new signature. Two users below will be updated.

Other examples

See a list of available merge tags

If you want to see what merge fields are available for use in your template, you can run the following function to echo and output to your browser.

Output will look something like this

Merge TagExample
{{primaryEmail}}[email protected]
{{alias}}[email protected]
{{thumbnailPhotoUrl}}http://i.imgur.com/mmvUt5x.png
{{fullName}}MooMaster
{{phone0}}555-555-555
{{title}}IT Admin / Developer

Settings

Path Settings

If your signature, service-account.json or user defined JSON file aren't stored in the default directories, you can use the following to set the path where your files are located.

Set the service-account.json path (Default - /local-vars/)

Set the directory where your service-account.json file is stored

Set the signatures path (Default - /signatures/)

Set the directory where your signatures are stored

Set the users file path (Default - /local-vars/)

Set the directory where your users json files are stored. This is only required if you are fetching your users from a local JSON file, rather than the GSuite directory.

Basic Settings

Run test mode (Default - True)

During test mode no signatures are updated

Preview the output HTML (Default - True)

When testing, echo the signature into your browser

Get users from GSuite (Default - True)

Rather than JSON or other array. Default is True. Will default to False if you use specify a JSON array or another array source after this flag has been set.

Set the template (Default - defaultSig.html)

you wish to use that is located in the subfolder "/signatures"

Strip unused tags (Default = True)

that start and end with '{{' '}}' when generating the template. Switch to False when debugging.

User Filters

Skip fields (Default = [])

Skip updates if any of the fields are NULL, BLANK or don't exist. Useful when updating users that might have blank values that need to be updated before their signature is created. In the example below, we're skipping the signature update for users that don't have their title or profile picture set.

Filter email addresses to update (Default = [])

Enter the primaryEmail addresses that you wish you update. Any emails that aren't included here won't be updated.

Unset all current filters

If filters have been applied, you can unset them all using the following. Useful if you're chaining a whole heap of bulk updates with many different changing filters

MOTD Message of the day Settings

Set MOTD position (Default = "Below")

Set where the MOTD appears (Above or Below) on the signature.

Set HTML for MOTD (Default = "")

String value of the HTML that you want to include in the email signature.

Set MOTD when generating template (Default = True)

If you don't set the MOTD HTML, this will have no effect. Otherwise when the template for a user is generated, the MOTD will be included upon generation.

Other Settings

Get users from array (Default = [])

If you would prefer to get the users details from an array rather than the GSuite directory, you can push your own custom users array along with all the details for the signatures you wish to update. For this option you must include the primaryEmail and alias in each user array.

Get users from JSON file (Default = "")

If you would prefer to get the users details from a JSON file rather than the GSuite directory, you can add your JSON file to the /local_vars folder instead. For this option you must include the primaryEmail and alias in each JSON object.

Example JSON File

Authors

License

This project is licensed under the MIT License - see the LICENSE.md file for details


All versions of gsuite with dependencies

PHP Build Version
Package Version
Requires google/apiclient Version ^2.0
php Version >=5.3.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package moometric/gsuite contains the following files

Loading the files please wait ....