Email of database updates

AndyB

Member
You are using DaDaBIK version 7.3.3 pro, installed on 29-07-2016, the last version of DaDaBIK is 7.3.3 released on 26-07-2016
You are runnning the last release of DaDaBIK
PHP Version: 5.6.24
mysql version: 5.6.34-log
Web server: Apache
Client: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0

I am using the email feature to get emails whenever the database is updated or new records added.
I have been receiving these emails ok for a couple of months now but all of a sudden this week the emails are coming hours later than expected and sometimes coming out of order.
I have spoken to my hosting provider but do not undertsand enough of how the process works to be able to have a sensible conversation with them. For example how does the email get sent? I cannot find where the outgoing smtp server is listed only in config.php the list of email receipients. Thanks.
 

eugenio

Administrator
Staff member
Hello,
DaDaBIK uses a simple mail() php function. That's all your hosting provider needs to know to fix the problem.

Best,
 

AndyB

Member
Eugenio,

They have just sent me the following two errors from the server log file saying this might be the cause of the issue. Do you have any ideas what these error messages are saying?

[Sat Nov 26 11:34:00.882793 2016] [fcgid] [pid 11162] [client 31.50.69.103:36258] mod_fcgid: stderr: PHP Notice: Undefined variable: master_table_where_value in /home/hp3-linc3-nfs2-z/906/714906/user/htdocs/dadabik/index.php on line 2414, referer: http://ahstcg.org/dadabik/index.php?tablename=ClockDataExpanded&function=edit&where_field=UniqueNumberID&where_value=746&just_updated=1&master_table_name=&master_table_function=&master_table_where_field=&master_table_where_value=&is_items_table=

[Sat Nov 26 11:34:00.882807 2016] [fcgid] [pid 11162] [client 31.50.69.103:36258] mod_fcgid: stderr: PHP Notice: Undefined variable: is_items_table in /home/hp3-linc3-nfs2-z/906/714906/user/htdocs/dadabik/index.php on line 2414, referer: http://ahstcg.org/dadabik/index.php?tablename=ClockDataExpanded&function=edit&where_field=UniqueNumberID&where_value=746&just_updated=1&master_table_name=&master_table_function=&master_table_where_field=&master_table_where_value=&is_items_table=

Thanks.

Andy
 

eugenio

Administrator
Staff member
Hello,
there is a warning related to a variable not set, that shouldn't happen and will be fixed in the next release, however this doesn't prevent and doesn't affect in any way the email sending process (in fact you receive the email, but delayed).

Best,
 

AndyB

Member
Thanks Eugenio.
When you said "in fact you receive the email, but delayed" how long should be delay be?
I am assuming you mean a few seconds whereas I am receiving the email either hours later or not at all.

Andy
 

eugenio

Administrator
Staff member
The thing is that if you receive the email, even after days, it means that the mail() command has been executed and the problem is somewhere in the mail server. Believe me, the only thing your hosting provider needs to know (DaDaBIK-side) to try to solve your problem is that DaDaBIK uses a simple PHP mail() function.

Best,
 

guidancepca

New member
Hi,

Can you tell me where I change the code to allow emails to be sent when a record is added or updated.

Thanks,

Paul

You are using DaDaBIK version 7.3.3 pro, installed on 11-26-2016, the last version of DaDaBIK is 7.3.3 released on 07-26-2016

You are runnning the last release of DaDaBIK

PHP Version: 5.6.26

mysql version: 5.5.52-cll

Web server: Apache

Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
 

eugenio

Administrator
Staff member
Hello,
you don't have to change the code, search for "email notices parameters" in config.php and enable the feature.

Cheers,
 

guidancepca

New member
Hi,

I can now send email updates to specified addresses in config.php.

Is there a way to send the inserted/update record to an email address chosen from a single select dropdown field filled in as part of the record?

Thanks,

Paul

You are using DaDaBIK version 7.3.3 pro, installed on 11-26-2016, the last version of DaDaBIK is 7.3.3 released on 07-26-2016

You are runnning the last release of DaDaBIK

PHP Version: 5.6.26

mysql version: 5.5.52-cll

Web server: Apache

Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
 

guidancepca

New member
hi,

Sorry but you can disregard last question.

Can I do the following in config.php to allow insert notice mails go to 4 different email addresses?


$insert_notice_email_to_recipients_ar[0] = 'my_account_1@my_provider.com';
$insert_notice_email_to_recipients_ar[1] = 'my_account_2@my_provider.com';
$insert_notice_email_cc_recipients_ar[0] = 'my_account_3@my_provider.com';
$insert_notice_email_cc_recipients_ar[1] = 'my_account_4@my_provider.com';

thanks,

Paul

You are using DaDaBIK version 7.3.3 pro, installed on 11-26-2016, the last version of DaDaBIK is 7.3.3 released on 07-26-2016

You are runnning the last release of DaDaBIK

PHP Version: 5.6.26

mysql version: 5.5.52-cll

Web server: Apache

Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
 

eugenio

Administrator
Staff member
Exactly you can add as many recipients as you want, bot in TO or in CC, e.g.

$insert_notice_email_to_recipients_ar[0] = 'jon@my_provider.com';
$insert_notice_email_to_recipients_ar[1] = 'luigi@my_provider.com';
$insert_notice_email_to_recipients_ar[2] = 'tom@my_provider.com';
$insert_notice_email_to_recipients_ar[3] = 'mario@my_provider.com';
 

guidancepca

New member
Cool!

Great.

Thanks.

You are using DaDaBIK version 7.3.3 pro, installed on 11-26-2016, the last version of DaDaBIK is 7.3.3 released on 07-26-2016

You are runnning the last release of DaDaBIK

PHP Version: 5.6.26

mysql version: 5.5.52-cll

Web server: Apache

Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
 

guidancepca

New member
Hi,

For:

"you can add as many recipients as you want, bot in TO or in CC, e.g.

$insert_notice_email_to_recipients_ar[0] = 'jon@my_provider.com';
$insert_notice_email_to_recipients_ar[1] = 'luigi@my_provider.com';
$insert_notice_email_to_recipients_ar[2] = 'tom@my_provider.com';
$insert_notice_email_to_recipients_ar[3] = 'mario@my_provider.com';"

is there a way to enable the notice email for a particular form?

I have a few forms in the database but there is only one important form where people need to know that inserts and updates have occured?

Thanks,

Paul


You are using DaDaBIK version 7.3.3 pro, installed on 11-26-2016, the last version of DaDaBIK is 7.3.3 released on 07-26-2016

You are runnning the last release of DaDaBIK

PHP Version: 5.6.26

mysql version: 5.5.52-cll

Web server: Apache

Client: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36
 

eugenio

Administrator
Staff member
Hello,
no, at the moment you can't, unless you add some custom code in index.php. For example if the table you want to send email is the table "customers", you can surround the two mail_custom function calls you find in index.php with

[pre]
if ($table_name === 'customers'){

.... mail_custom() here..

}
[/pre]
 

AndyB

Member
You are using DaDaBIK version 7.3.3 pro, installed on 29-07-2016, the last version of DaDaBIK is 7.3.3 released on 26-07-2016
You are runnning the last release of DaDaBIK
PHP Version: 5.6.24
mysql version: 5.6.34-log
Web server: Apache
Client: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:35.0) Gecko/20100101 Firefox/35.0

Eugenio,

After spending 2 weeks going back and forward to my hosting provider I think I have found the cause of my problem with delayed emails.

The email from my database changes is using the default server email from address which is being blocked by a rule they have set up to stop it being used for spamming. Apparently I need to set the from addess to my domain email address instead. Can you tell me if this is possible using the PHP Mail() function and if so where do I need to change it?
Thank you.

Andy
 

eugenio

Administrator
Staff member
In index.php you can find this code two times:

[pre]
$additional_headers = '';
[/pre]


change it to: (please note the double quotes)

[pre]
$additional_headers = "From: myemail@mydomain.com\r\n";
[/pre]


I haven't tested but it should work.

Best,
 

AndyB

Member
Eugenio,

Thank you for this, it worked great.

You have just ended 2 weeks of real pain for me, just trying to get my hosting provider to admit what the problem was.
I am very grateful for all you help as always.

Regards

Andy
 
Top