Topic: Email Notifications

I am trying to set up an email notifications when a birthday, reminder or todo event takes place but I have not been able to get it work. I have set up a cronjob with an outside agence (cron-org.org) and I keep getting the following message:
Fetched URL http://www.fredswebportal.com/luxcal/lcalcron.php
Status 302 Found.
Additional info:
On the Settings page, in the section Periodic Functions, I selected Cron job host = IP Address with 136.243.171.254 as the IP Address
The Status 302 Found message is coming from cron-jpb.org
The file lcalcron.php file is present in the calendar root folder

Any assistance will be much appreciated.

Re: Email Notifications

Hello Fred

There are some things you can do to test.

If on the Settings page you set the Cron job host to: remote
then you are allowed to start the lcalcron.php script by "hand" - this means you can start it from your browser.

1 - is this successful?
2 - At the external provider you have specified a job. If you "by hand" start the url you have given for the provider what is the outcome of this?
3 - In the luxcal.log file you should see an entry for every time the cron job has started - are there any hints in the log file?

Beware that when the cron job is set to remote (without IP address) anybody can start your cron job, so remember to "set it back"

Kind regards,
John

Re: Email Notifications

Scwartz,

Thanks for your quick response also...this application certainly does a great job with support.  Okay, I think we may be getting closer to a possible solution.

After changing the setting to "remote" and running the lcalcron.php file from my browser, I received the following message on the screen:  "SQL error. See 'logs/sql.log' "
When looking in the logs/sql.log file, this is what shows:
             2018.05.04 15:17:48 Script: /luxcal/lcalcron.php - SQL query error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'name' in 'field list'
Query string: SELECT `name`,`value` FROM `alumni_settings`

Have no idea why it is pointing to alumni_settings, which is a table of the Admidio application I have installed on the same server and which is using the same database.
My webhost limits the number of databases I can have so I have to use the same databases for different applications.

BTW, the cron-jog.org again shows the same message:

Fetched URL http://www.fredswebportal.com/luxcal/lcalcron.php
Status 302 Found

Please let me know if you need any other information.

Re: Email Notifications

Fred,

Now I understand what's going wrong. What's happening is the following:
The lcalcron.php script will search the database for installed calendars and it does this by looking for table names xxxx_settings (e.g. mycal_settings, pools_settings). Coincidentally and unfortunately Admidio also has a table called settings with a prefix in the format xxxx_. So the lcalcron.php script thinks that there is a calendar with name alumni and tries to read the alumni_settings table which results in a SQL error sad

There are several solutions:
1. You separate the databases of the Admidio application and the LuxCal application.
2. I will change the lcalcron.php script for you, so that it will not look for xxxx_settings tables, but instead for e.g. xxxx_styles tables to find the installed calendars.
3. You will use the SQLite version of the LuxCal calendar.

Solution 1 will not be possible if you have run out of databases.
Solution 2 has the disadvantage that you will have a dedicated lcalcron.php script (future upgrades).
Solution 3 would be my choice. No disadvantages, exactly identical functionality.

Please let me know your preference and I will help you.

Roel

5 (edited by fbonani 2018-05-04 23:14:28)

Re: Email Notifications

Roel,

You are very kind and as I have already stated, your support is top of the line.  OK, here are my thoughts and you can let me know if they are doable.

1. I actually believe this will be the best solution...separating the databases of Admidio and LuxCal. I can probably put the tables from the LuxCal application into another database. I assume that I will be able to just export the database information (and data) to an sql file and then import it into the other database.  I would then have to update the lcconfig.php file with the new database information. If that is not possible, let me know.

2. You are correct in that future upgrades will make this option an unneeded  headache.

3. I don't believe that my webhost has SQLite available.

Re: Email Notifications

Fred,

1. Yes, this is certainly possible.
3. Most PHP installations have both PDO-MySQL and PDO-SQLite installed. If you want you can check this by going to the calendar's settings page and under General select "Show info"  just after the PHP version (2nd line from the top). When selected, you will get the PHP page with all installation details. Now you can search for the "PDO" section (somewhere half way) and directly thereafter you will find which databases are enabled.

Roel

7 (edited by fbonani 2018-05-05 18:31:25)

Re: Email Notifications

Roel,

Unfortunately, it is still not working.  Here is what I have done so far:

1. Moved the tables from the original database to a database that does not have any tables with 'settings' in the name of the table, i.e. xxx_settings
2. Set up a Todo event for tomorrow at 9PM and had the cron job set to run at 8:45 AM this morning.
3. The settings in the calendar admin have been set using the IP Address with the IP address of cron-job.com
4. Received the same error message at cron-job.com as I received yesterday.
5. I changed the calendar admin to show remote and ran the lcalcron.php file manually and received a blank page...nothing in either of the logs

At this point, I don't know what else I can do to make this work...the calendar will be useless to me if this module does not work.  I am open to any suggestions you may have.

Fred

UPDATE: I just noticed that after running the lcalcron.php file manually from my browser, I did get a notification at my email address (in the spam folder) that you can see online at:
http://www.fredswebportal.com/luxcal/cron.png

Any ideas why the cron-job is not working? Also, I am concerned that the image states it did not find any reminders or changes...does that mean that it would not send a notification if it is a birthday or reminder?

Re: Email Notifications

Hello Fred

Allow me to make a suggestion :

1- download the L-version
2 - install the L version.
3 - Make some testevents
4 - send a mail from one of the events ( use the send-now option )
5 - make sure at least one of the events will be "hit" by the cronjob.
6 - Run the cronjob manually
7 - setup the cronjob to run automatic.

Tell us if one of the numbers fails, and what information you have about it.

Kind regards
John

Re: Email Notifications

I guess I can give that a try, although I don't know why it would make a difference running the SQLLite version of the application. It will still be running from the same domain and the cron job will still be from cron-job.org.

One question I have...could the fact that I have a separate calendar running on the same database have anything to do with this problem?

BTW, I sent an email from one of the events in the current version and have not received the email.

Re: Email Notifications

Schwartz wrote:

Hello Fred

Allow me to make a suggestion :

1- download the L-version
2 - install the L version.
3 - Make some testevents
4 - send a mail from one of the events ( use the send-now option )
5 - make sure at least one of the events will be "hit" by the cronjob.
6 - Run the cronjob manually
7 - setup the cronjob to run automatic.

Tell us if one of the numbers fails, and what information you have about it.

Kind regards
John

OK, here are the results:
1. Dowloaded the L-version
2. Installed the L version
3. Made some test events
4. Sent an email from one of the events - nothing happened
5. Set up a cron job - received following error message

Fetched URL
http://www.fredsfollies.com/fsptracker/lcalcron.php
Status
404 Not Found

Now what...this is getting too frustrating. There has to be a solution but don't know what it is at this point.

Re: Email Notifications

Hi Fred,

I'm sorry for all this hassle and I do understand you get frustrated.
Don't give up; this calendar is used by many people and we must get it to work.

I have a few remarks and suggestions . . .
Remarks:
Going back to your post yesterday at 16:09 . . .
Under point 5. you said you received a blank page when running the lcalcron.php script manually. This is correct, this scrip does not produce any output (unless there are errors) because there is no need to send output to cronjobs. So no output means it ran successfully. Also the cron.png image shows that the script ran successfully.
Under point 4. you said you received the same error message as the day before  (the one with SQL error . . . Query string: SELECT `name`,`value` FROM `alumni_settings`). This would normally not be possible; if there is no table `alumni_settings` in the database, there can be no error related to this table. I don't know, maybe the cronjob started a different calendar!?
Both points above show that starting lcalcron manually works and the cron job coming from cron-job.com works, but most probably starts the wrong lcalcron.php script. So we should look at this last problem.

Suggestions:

1. Taking your SQLite calendar, give it one more try and do the following:
a. Create a test event for tomorrow and check the "Send mail now" check box and specify 1 day(s) before event and fill in your email address (if not done already) and hit the Add and Save button. Now you should get 1 email message.
b. Go to the settings page and in the section Periodic Functions ensure that the Cron job host is set to "remote"
c. Start the lcalcron.php script from your browser. This must be done before midday. Now you should receive 2 mail messages, a reminder and a cron job summary.
If so far all works well, the only thing left to do is set up a cronjob, so . . .
d. The URL http://www.fredsfollies.com/fsptracker/ in your last post does not exist. Correct this and try again.
If this also works, then on the Settings page, in the section Periodic Functions check Cron job host "IP address" and fill in the IP address of cron-job.com.

2. Give me temporarily FTP access to your calendar folder on your server (send me the credentials by email) and create a user account for me with admin rights in your SQLite calendar. I will then analyze the problem and make sure that periodic functions work.

Roel

12 (edited by fbonani 2018-05-06 20:31:59)

Re: Email Notifications

Roel,

I followed your suggestions exactly and here are the results.
1(a). Created an event for tomorrow and checked the Send mail now and did not receive an email.
  (b). Went back to settings and checked the Remote button and ran the lcalcron.php file from the browser...
  (c)  got a blank page but no email notification
  (d)  changed the URL to the correct one

Set up a cron job to run this morning and received the same error message I have been receiving...Fetched URL
http://www.fredswebportal.com/fsptracker/lcalcron.php
Status
302 Found

BTW, I tried the Test Email button in the settings in the first section. It said that an email was sent but I have not received one.  I tried it with both PHP mailer and smtp modules.

Now comes your second suggestion and after re-reading it, I may have found the problem myself.  You ask that I provide temporary FTP access, which I can do but then you ask for access to the mysqlite db and that is where I noticed that the mysqlite db is in a folder marked db in the root folder of the calendar application, so you will be able to access it without having any credentials.  when I installed the calendar using the mysqlite db, it did not ask for any log in credentials.  Is that where the db is supposed to be?

Send me your email address to fbonani@yahoo.com and I will provide FTP access.

BTW, I have friends in Brussels, how far do you live from there?

UPDATE:  I sent you the FTP credentials to your email address...I found it.

Fred

13

Re: Email Notifications

Fred I ran into a similar problem with the email function if the email address was not for the hosted domain. What I mean is I would have datadan@rogers.com (my ISP) for the admin address. It would not give an error and would say it is sent. As soon as I changed the admin email address to dan@bitsofknowledge.com (bitsofknowledge.com is one I host) the email went through.

Just offering as that would explain why it says it was sent and you did not receive it.

Regards,
Dan

Some own motorcycles, others ride them.

Find great LuxCal examples by Schwartz at http://www.calendarforum.dk/index.html

14 (edited by fbonani 2018-05-06 21:07:33)

Re: Email Notifications

Thanks for the heads up Dan, I will certainly check that out. I wonder if that would fix my problem of not getting the email notifications?

EDIT:  I was just thinking however, that I have other applications on this domain and I have not had the same problem with sending emails. I will check into and report back.

Re: Email Notifications

Good point Dan.

My ISP for most of my domains ( one.com) also demands the sender of the mail to be a mailaddress from the domain.
You will probably not get an error - the message will simply not be sent.

Kind regards
John Schwartz

16 (edited by fbonani 2018-05-06 22:04:50)

Re: Email Notifications

Well, changing the email address to one with the domain address sent the email.  It did not fix the cron job problem however...still getting the same error:

http://www.fredswebportal.com/fsptracker/lcalcron.php
Status
302 Found

Can't figure out why it is not working.

BTW, changing the email address to the domain's email address worked for both the MYSQL and MYSQLite versions.

Re: Email Notifications

Hello Fred

I can see Roel is online - but I post this anyway smile

Be sure it is for the L-version you start the cronjob. This way nothing else is to interfere.

Then try to start the cronjob by hand.

This SHOULD function.

Then set the cronjob to start automatically.


Kind regards
Schwartz

Re: Email Notifications

Everything worked...

I received a notification that an event had changed
I received a notification when I ran the cron job by hand
I received a notification of Cron Job Summary

IT DID NOT WORK WHEN I RAN THE CRON JOB AUTOMATICALLY USING THE lcalcron.php FILE

Roel provided me with a small testcron.php file that is working. The frustration keeps mounting. Hopefully this can be resolved.

Re: Email Notifications

Hello Fred

This is a bit strange.

Running the lcalcron.php should be the same - started by "hand" or started by a job.

What happens if you use another browser and clears the cache before starting the cronjob ?

There should be no difference ( By hand or by cronjob provider )

Are you sure that the IP-address from the provider is correct? Some cronjob providers make use of two or more IP-addresses.
You can check in the logfile what IP the job comes from. Check that it is the IP you have set up for the cronjob provider.

Kind regards

Schwartz

Re: Email Notifications

Schwartz,

Since the file Roel sent me works with the cronjob provider, I would assume the lcalcron.php file would work as well since it is from the same provider.  BTW, the provider I am using is cron-job.org and I believe you provided the IP Address for it?

Since the cron job doesn't run, there is no log file entry, therefore no IP Address information, but as stated above, if it works for the file Roel sent me the IP Address should be correct. BTW, the luxcal log file contains the following information:

- Aborted. - OK. - OK. - OK. - Aborted. - Aborted. - Aborted. - Aborted. - Aborted. - Aborted. - Aborted. - OK. - Aborted. - Aborted. - Aborted. - Aborted. - Aborted. - OK. - Aborted.

Re: Email Notifications

I believe the problem has been solved...the IP Address that I had in there was incorrect and when corrected, the notifications started coming through.  I am now testing the actual events instead of test events and will post the results tomorrow as that is when the cron job is scheduled.  I am making an assumption that if no events are scheduled, the notification will still arrive except that it will state no events are scheduled?

Re: Email Notifications

If using the Remote-setting for the cronjob, the job can be started from everywhere. And then the IP is shown.
This is not a setting I would normally recommend - but it is useful when testing.

I am sorry if you are mislead by the IP-address shown in the documentation for the Cronjob.
I will make a remark that the number shown, is just for the example, and that people themselve has to check the IP for their provider.

I hope your next post is to tell that it now all functions smile

Re: Email Notifications

Yes, it is working...I am getting the email notifications. As a matter of fact I am getting them at two different email addresses although I thought I had changed them all to be sent to the one email. I am going to try to find out why it is still sending to both of them and report back. 

I wanted to thank everyone that helped get this problem resolved and happy that it was a small matter that caused it in the first place.

Fred

24 (edited by fbonani 2018-11-02 17:00:48)

Re: Email Notifications

All of a sudden I have noticed that the email notifications are not coming through again for my calendar and to my knowledge nothing has changed.  I am still using cronjob.org as the site to send the crons and am curious if anyone would know the reason.  I have checked cronjob.org and it states that the cron jobs have been issued and have been consistently.  I am have uploaded an image of the Notifications section of the calendar for your perusal.  I have changed the email address for security purposes, but everything else is the same as it has been.  thanks in advance for your help.

http://www.fredswebportal.com/luxcal/cron.jpg

Re: Email Notifications

Try to contact the provider and check :

Have they changed their IP address ?
Have you looked in the logfile to see what IP the cronjob is using?
Does the provider use more than one server and the IP could therefore change?

And you could maybe check yourself : What happens if you start the cronjob "by hand"?

This is just my suggestions to maybe come closer to the problem.