Jump to content
cheetooh

The "EmailPreSend" hook

Recommended Posts

Dear all,

I am trying to prevent the invoices email being sent to the profile contact and only send to sub-contacts. Is it possible to achieve with the "EmailPreSend" hook?

Thank you!

Share this post


Link to post
Share on other sites

Yes it's possible.

 

Did you try with

$merge_fields['abortsend'] = true; ?

 

Share this post


Link to post
Share on other sites

Yes I did but they will actually abort all invoices email sending regardless of how many contacts you have. Cannot differentiate between profile contact or sub-contact

Share this post


Link to post
Share on other sites
1 hour ago, cheetooh said:

Yes I did but they will actually abort all invoices email sending regardless of how many contacts you have.

I think the implication of the Contacts documentation is that the emails are sent to the client, and are effectively bcc'd to any applicable contacts...i'm not sure if the emails are sent individually to both main account and contacts (if you see what I mean). :?:

2 hours ago, cheetooh said:

Cannot differentiate between profile contact or sub-contact

you could use the Class docs to see if they're a contact, but if bcc is occurring, then I don't know if doing that gets you any further forward. :?:

somewhere in the back of my mind, I can recall a thread where one of the WHMCS guys said that it wasn't possible to disable emails to the main account holder... now that doesn't necessarily mean that it was impossible back then, or still is now, but I can't recall anyone posting code to do it.

certainly, there is a 5-year old feature request for this... impatientsmilie.gif

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×

Important Information

By using this site, you agree to our Terms of Use & Guidelines