How to create own Custom function for PDF Maker or EMAIL Maker?

How to create own custom function

Hello Guys,

lot of our customers ask me how to create custom function for PDF Maker or EMAIL Maker.
Even thought it is described in our manuals (you can read it here) of these extensions, I will show you it one more time with simple example.

First at all, you need to create own .php file because with update of PDF Maker or EMAIL Maker our standard files are re-written and you can lose your function.

  1. Please create your new file in: [vtigerROOT]/modules/PDFMaker(EMAILMaker)/resources/functions
    How to create own custom function

    How to create own custom function

  2. At least, your file have to contains
    <?php

    You can also copy these lines to your new file:

    if (!function_exists('nameofyourfunction')) {
    
        function nameofyourfunction( ) {
            
        }
    
    }

     

  3. Now, you can create your own custom function
    <?php
    
    if (!function_exists('sayHello')) {
    
        function sayHello($name) {
       
       
       return 'Hello '.$name. '! Now, you know how to add own custom function :)';
        }
    
    }
  4. Please, save your file
  5. Open PDF Maker Professional or EMAIL Maker Professional and in EditView of template please select Other information
  6. Now, You can see your new function in list of custom functions. You can add it into your template.
    How to create own custom function

    How to create own custom function

  7. That’s all.
    How to create own custom function

    How to create own custom function

    Hope, it was interesting for You.

Share this post

Leave a Reply

Your email address will not be published. Required fields are marked *


We use cookies to improve our website. By browsing this website, you agree to our use of cookies. More info