Send a ticket to all the contacts of the same account

Send a ticket to all the contacts of the same account

Hi! 

Some tickets I publish are useful to all the contacts of the same account.

I´ve already created a checkbox field when the ticket must send a notification to all the contacts of the same account. The problem is that I don´t know how to code using the custom function. 

Someone could help or any other option I might use?