Contact Adder - Part 2 - TEAL Technology Consulting GmbH
post-template-default,single,single-post,postid-1783,single-format-standard,bridge-core-2.6.1,,qode-title-hidden,qode-child-theme-ver-1.0.0,qode-theme-ver-24.6,qode-theme-bridge,disabled_footer_top,qode_header_in_grid,qode-wpml-enabled,wpb-js-composer js-comp-ver-6.5.0,vc_responsive

Contact Adder – Part 2

This month we would like to present you the promised version 2 of ContactAdder. What the ContactAdder is all about, you can read in part 1.

In this release, we wanted to automate the execution of the script and simplify the installation and updates for our employees. We also wanted to extend logging to provide support in the event of an error.

Our solution
We solved the automatic execution via a Scheduled Task. This is created by our setup script and configured to run the script every day at 9am.

The setup script has also implemented an update routine to update the task when the ContactAdder script is changed or to reset it to the default values defined in the setup routine. To install (or update) ContactAdder simply place both scripts in the same directory and start the setup script 😊

The actual script was supplemented at the relevant places by logging code, which can be switched on or off via a variable ($debuggingon to $true or $false). The code creates a separate logfile for each run in a subfolder. In order not to increase the number of logfiles excessively, only the 5 most recent logfiles plus the currently written logfile are kept (from ContactAdder as well as from the setup script). The number of logfiles to be stored can be adjusted to your needs by the variable $keeplatestlogcount. 

The script

You can find the script in our repository Repository. It is licensed under the MIT license.


We would like to take this opportunity once again to thank some of the authors whose work and information we used during the development: [not available anymore at the time of the writing]