PHP code example of moometric / gsuite
1. Go to this page and download the library: Download moometric/gsuite library . Choose the download type require .
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
moometric / gsuite example snippets
use Moometric\mooSignature;
$mooSig = new mooSignature("primaryDomain.com", "[email protected] ");
// Optionally set the path where your default service-account.json file is stored.
$mooSig->addSettingServiceAccountPath("/your/project/path/local_vars/");
// Optionally set the path where your signatures are stored.
$mooSig->addsettingSignaturePath("/your/project/path/signatures/");
$mooSig->addSettingRunTestMode(False);
$mooSig->addSettingMOTDHTML("<span style=\"color: red;\">Hello World</span>");
$mooSig->addSettingMOTDPosition("Below");
$mooSig->addSettingMOTD(True);
$mooSig->setSignatureMOTD();
$mooSig->removeSignatureMOTD();
$mooSig->addSettingMOTDHTML("<span style=\"color: red;\">Marketing Department MOTD</span>");
$mooSig->addSettingFilterEmailsToUpdate(["[email protected] ", "[email protected] "]);
$mooSig->setSignatureMOTD();
$mooSig->removeSignatureMOTD();
$mooSig->addSettingSetTemplate("defaultSig.html");
$mooSig->updateSignatures();
$mooSig->addSettingMOTDHTML("<span style=\"color: red;\">Hello World</span>");
$mooSig->updateSignatures();
$mooSig->addSettingFilterEmailsToUpdate(["[email protected] ", "[email protected] "]);
$mooSig->updateSignatures();
$mooSig->addSettingSkipConditions(["title", "thumbnailPhotoUrl"]);
$mooSig->updateSignatures();
$mooSig->addSettingUsersFile("testUsers.json");
$mooSig->updateSignatures();
$mooSig->addSettingUserArray([
[
"primaryEmail" => "[email protected] ",
"alias" => "[email protected] ",
"fullName" => "MooMaster",
],
[
"primaryEmail" => "[email protected] ",
"alias" => "[email protected] ",
"fullName" => "MooMinor",
]
]);
$mooSig->updateSignatures();
$mooSig->listMergeFields();
$mooSig->addSettingServiceAccountPath("/your/project/path/local_vars/");
$mooSig->addsettingSignaturePath("/your/project/path/signatures/");
$mooSig->addSettingJSONPath("/your/project/path/local_vars/");
$mooSig->addSettingRunTestMode(True);
$mooSig->addSettingPreviewSignature(True);
$mooSig->addSettingGetUsersFromGsuite(True);
mooSig->addSettingSetTemplate("defaultSig.html");
$mooSig->addSettingStripBlanks(True);
$mooSig->addSettingSkipConditions(["title", "thumbnailPhotoUrl"]);
$mooSig->addSettingFilterEmailsToUpdate(["[email protected] ", "[email protected] "]);
$mooSig->addSettingUnsetFilters();
$mooSig->addSettingMOTDPosition("Below");
$mooSig->addSettingMOTDHTML("<span style=\"color: red;\">Hello World</span>");
$mooSig->addSettingMOTD(True);
$mooSig->addSettingUserArray([
[
"primaryEmail" => "[email protected] ",
"alias" => "[email protected] ",
"thumbnailPhotoUrl" => "http://i.imgur.com/mmvUt5x.png",
"fullName" => "MooMaster",
"phone0" => "555-555-555",
"title" => "IT Admin / Developer"
],
[
"primaryEmail" => "[email protected] ",
"alias" => "[email protected] ",
"thumbnailPhotoUrl" => "http://i.imgur.com/mmvUt5x.png",
"fullName" => "MooMinor",
"phone0" => "444-444-444",
"title" => "DevOps Admin"
]
]);
$mooSig->addSettingUsersFile("testUsers.json");