Jump to content

Email Presend: Intercept invoices for all clients that use automated billings


Recommended Posts

Asking for help, not a developer and need to figure out how I can stop invoice reminders being sent to all clients that have signed up for automated billing.  I was told to use an email presend I would appricate any help to help fill in the code.  https://developers.whmcs.com/hooks-reference/everything-else/#emailpresend

Also which folder would I upload this too.  Thanks in advance. 

 

<?php

add_hook('EmailPreSend', 1, function($vars) {
    $merge_fields = [];
    $merge_fields['my_custom_var'] = "My Custom Var";
    $merge_fields['my_custom_var2'] = "My Custom Var2";
    if ($vars['messagename'] =='My Message Name' && $vars['relid'] == 2) {
        //Stop the email from sending a specific message and related id.
        $merge_fields['abortsend'] = true;
    }
    return $merge_fields;
});

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated