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

Comments (6)

  • Alexandre Quadros Nogueira Reply

    Hello, how are you?
    Does this custom menu option work for free PDFMaker?

    February 25, 2020 at 11:28 pm
    • info@its4you.sk Reply

      Hello, custom functions are not supported by FREE PDFMaker.
      Custom Functions are just for PDF Maker PRO version.

      February 26, 2020 at 7:38 am
  • Dan! padilla Reply

    el PDFMAKER BASIC tampoco lo soporta ?
    esa nota deberian ponerla cuando se adquiere dicho producto

    January 18, 2021 at 10:03 pm
  • jesus Reply

    y me salio otra duda

    tengo el PDFMAKER con licencia, cuando la licencia expira el PDFMAKER deja de funcionar es decir ya no podre exportar mi pedidos o ordenes de compra o solo termina mi soporte con ustedes y el sistema sigue funcionando normalmente?

    January 18, 2021 at 10:14 pm

Leave a Reply

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