eCRM documentation by Chris Armstrong Contents -------- 1. Introduction 1.1. Creation history 1.2. Features overview 1.3. Requirements 1.4. First time start 2. Developers 2.1. Overview 2.2. Customize html to your look and feel 2.3. Customize text 2.4. Further development 1. Introduction --------------- eCRM is a tool that was built to manage your web customers. 1.1. Creation history --------------------- This program was written for a hotel that had several online bookings. The key problem for them was that they wanted to: - Keep the customer data - Import the customer data in to their hotel applications once a month - Be able to send special offers to their customers - Import customers they have in their hotel application in to the eCRM - Send personalized emails 1.2. Features overview ---------------------- eCRM is not an ordinary Mailinglist Manager and not an ordinary mailto cgi. That's why we are using the word "eCRM". With eCRM you can manage your customers online and transfer them in to your normal applications. Key features are: - Address Management - Customer records can be grouped - Statistics about your customers - Automatic Form Creation that can be implemented on several websites (mailto that stores the contact in the database) - Very flexible import and export functions - Backup and restore functions - Text and HTML mailings - Mailings can sent at a user defined date - Personalized Mailings - Html is fully seperate from code (replacement tags) - Multiple language support "Would be nice to have" features are: - Authentication and permissions - Date dependent stickit notes for the Address Management (searchable) - Trouble ticketing system - E-Mail Client - Calendar 1.3. Requirements ----------------- In order to build the software the following applications are required: Apache Webserver http://httpd.apache.org PHP 4.0.6 (as Apache Module AND as binary) http://www.php.net MySQL http://www.mysql.com 1.4. First time start --------------------- You should test every application before you use it in production. There are two things that you should test very carefully: - Test the autogenerated form on your website Check if the contact information is added in to the Database correctly and if you get an email - Test the Mailing functions Add a few test contacts with test email addresses Test if the TEXT mailing works Test if the HTML mailing works Test if the personalized mailing works 2. Developers --------------------------- This part of the documentation covers most of the things, developers need to know to customize eCRM or add functionalities. It would be nice of you, if you could send us your modified or added functionalities. We are not able to pay you any money at the moment but you will be listed in our hall of fame and in these documentations. eCRM is built as a plugin based system. This means that additional functionalities can be easially implemented without dealing with code from other plugins. 2.1. Overview ----------------- eCRM |- msg | | |- conf |- js | | |- cronscripts |- tpl | | |- lib |- en -|- tmpl | | |- sql | | | |- customers -|- lng -| | | | |- modules -|- backup | | | |- contacts | | | | ... | | |- rparser -|- modules -|- infoparsers | | | | | |- error | | | | | |- ... | | | |- lng -|- en -|- tmpl | | | |- tpl | | | |- js | | | |- msg | 2.2. Customize html to your look and feel ----------------------------------------- All the html templates are in the tmpl and tpl folders. The html files contain html, dhtml, javascript and replacement tags. In the tmpl folder are the static html pages. In the tpl folder are some html parts, that will be repeated, as example the list of contacts, that has to be generated. The html templates are completly seperate from the php code. Customization should be easy and straight forward. 2.3. Customize text ------------------- You will find all the text in the language dependent folder (en). Most of the text is located in the html templates. There is aswell some text in the js files and the msg folder. 2.4. Further development ------------------------ The eCRM application is built in a modular way. Additional functionality can be implemented pretty easy. The first thing you'll have to know is the structure: - conf The directory for the config files - lib The libraries, that can be globally used - customer The directory that contains the different interfaces that "you" or your customer is working with. - rparser This directory contains the parser that is used to save a contact that registered over the form on your website in to the database and send you an email. - sql Here you'll find the SQL database scripts. - cronscripts This directory contains the PHP commandline script that will be executed over the cron daemon. - lng This folder contains the language dependent files. The language dependent files are javascript (js), messages (msg), html templates (tmpl), repeating html pieces (tpl). - modules The modules folder contains the different plugins. As example the plugin contacts contains all the code that is used to manage our contacts. To be able to integrate a new plugin you will have to do following: 1. Drink a coffee and smoke one 2. Wake up from the hangover you have from last night 3. Read the fasttemplate documentation and look at the code in customers/modules/contacts/contacts_004.inc. Fasttemplate Documentation: http://www.thewebmasters.net/php/FastTemplate.phtml 4. First edit the html stuff and add it to the tmpl and the tpl folder. Tpl's are in most cases repeating tables (as example repeating address entries). Add replacement tags in to your html files. 5. If you have libraries, you can add them in to the lib folder. Libraries only contain functions. I'm using classes. You can also use normal functions. 6. Add additional tables to the database. 7. Start coding your new plugin in a seperate folder in the modules folder. SESSION MANAGEMENT You don't have to care about session management or things like that since it is done in the customers/index.php file. You can use the session_register command to register additional variables. Please make shure that when the customer leaves your plugin, your session variables are deleted again. THE WAY TO THE ACTUAL CODE The customers/index.php file gets executed first and switches to the current plugin folder to the file swx.inc. Swx.inc directs the User to the actual code part. As example: index.php?module=1&page=5. $module is checked in the customers/index.php file. $page is checked in the customers//swx.inc file. NAVIGATION BAR The customers/navbar.inc file contains the navigation bar items that you see at the top of the application. UMMMLLLLMMMMNNN....... I STILL DON'T HAVE ENOUGH INFO This documentation is still pretty poor. If i have some time i'll enhance it a little bit. But i hope it's enough to give you a basic overview how you are able to integrate new plugins.