*

rooman

  • ****
  • 231 posts
Hello,
Send a message to the administrator if any advertisement has been deleted
Is there a way to do that

*

MB Themes

Re: Send a message to the administrator if any advertisement has been deleted
« Reply #1 on: September 03, 2022, 06:37:29 PM »
You coukd simply use removed item hook and send very basic mail using osclass mail function.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

rooman

  • ****
  • 231 posts
Re: Send a message to the administrator if any advertisement has been deleted
« Reply #2 on: September 08, 2022, 05:38:16 PM »
You coukd simply use removed item hook and send very basic mail using osclass mail function.

I don't understand this job
Please a little explanation

*

MB Themes

Re: Send a message to the administrator if any advertisement has been deleted
« Reply #3 on: September 08, 2022, 10:10:12 PM »
bone:

function mailremoveditem($item) {
  osc_sendmail(bla bla);
}

osc_add_hook('removed_item', 'mailremoveditem');
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

rooman

  • ****
  • 231 posts
Re: Send a message to the administrator if any advertisement has been deleted
« Reply #4 on: September 11, 2022, 01:39:52 PM »
I tried this method
but don't work
Is there an error?

Code: [Select]
function mailremoveditem($item) {
  osc_sendmail(array(
"username" => "*******@gmail.com",
"password" => "******",
"host" => "smtp.gmail.com",
"port" => "465",
"from" => "*******@gmail.com",
"to" => "*******@gmail.com",
"subject" => "Test Mail",
"body" => "This $item Is Deleted"
  ));
}

osc_add_hook('removed_item', 'mailremoveditem');

*

MB Themes

Re: Send a message to the administrator if any advertisement has been deleted
« Reply #5 on: September 11, 2022, 04:55:08 PM »
Hook is wrong

delete_item : When an item is deleted. $id is passed as argument
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots