Search in support tickets

#226 – Email to admin on ad update

Posted in ‘Support’
This is a public ticket. Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.
Saturday, 27 January 2018 10:39 CET
silverman
Hello.

I am using the option "Send email to admin on user update". But I want the email to get send only if a checkbox-field in the ad is set.

So if I have a checkbox-field called "ad_mycheckbox", only when this checkbox is set to 1, the mail to admin is sent.

So in controller.php. There is this line:

if ($conf->send_email_on_update == 1)

How do I write to access the field in the ad? I need something like this:

if ($conf->send_email_on_update == 1 && ad_mycheckbox == 1)
Custom Fields
Joomla Version
3.8
PHP Version
7
Product
AdsManager
Product Version
3.1.11
Monday, 29 January 2018 14:57 CET
loic
Hello,

You can try that :
if ($conf->send_email_on_update == 1 && $content->ad_mycheckbox == 1)


If the checkbox doesn't have any value, replace the 1 by 'on'

if it cause an error when not checked, then you can try that:
if ($conf->send_email_on_update == 1 && isset($content->ad_mycheckbox))


Best regards.
 
Monday, 29 January 2018 21:13 CET
silverman
Your first code works great! Thank you
This ticket is closed, therefore read-only. You can no longer reply to it. If you need to provide more information, please open a new ticket and mention this ticket's number.