Automatic Email to borrowers

Talk to other Pedia users about the programs, share tricks and tips or ask questions about existing features.
Post Reply
kprice5
Bruji Friend
Bruji Friend
Posts: 12
Joined: Wed Jul 11, 2012 9:15 am

Automatic Email to borrowers

Post by kprice5 »

I have successfully sent an overdue email from the program, but found no information regarding how often the email is sent. I find that I need to email people at least once a week in order to have items returned. Is there a way to have the program send out the email more than once? What if I send out the emails manually? Can I send them out multiple times?

Also, it would be nice to have a timestamp by the "pending emails" for when the email was sent. It doesn't really make much sense to me that the box is entitled "pending emails" after they have been sent. It would be nice to have a section for "pending" and a section for "sent" that shows when the email was sent.

One more question: if I have the program on running on multiple machines how does the emailing work? Will it email the borrowers again if I log in from a different machine? Do I just untick the auto-email box on the other machines?

Thanks!
User avatar
Conor
Top Dog
Posts: 5343
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Automatic Email to borrowers

Post by Conor »

The email sending is tied to the due date for the item. When the due date comes around the email is sent and then the default due date is used as an extension of days before sending the email again. So if you wanted to send emails once a week, you would set the default due date 7 days. This means on borrowing an item the default would be set to 7 days due back, but you can then manually adjust the value in the borrow sheet so that the first email goes out at a later or earlier date.

The information about what mail has been sent and what yet needs to go out is stored in the data folder in a file called "messages.plist" So if you launch a program on another computer that shares the data folder it would read this file and not send the e-mails again. However, this will only work for casual use of the second machine. If both programs are running 24/7 they would both send the email during that period that they are both running. So it's better to disable the feature in the preference for the secondary machines and just have a single machine that is responsible for sending out the emails.

You could send email more than once, but you would have to adjust the due date back in time (before right now) in that same window to send the email again. You will notice that as the emails are sent the due date is adjusted forward. The due date in that window really acts as a time stamp for when the email will be sent as well as web nit was sent (take the due date and subtract the number of default due dates and that was the last time an email was sent).
kprice5
Bruji Friend
Bruji Friend
Posts: 12
Joined: Wed Jul 11, 2012 9:15 am

Re: Automatic Email to borrowers

Post by kprice5 »

Thanks! That was very helpful! I hadn't noticed how the date changes on the outgoing emails box.

One more related question: whenever I send out an email it shows the person's last name first. Is there a way to change this? In the database it lists the last name first, but on the outgoing emails box it lists the first name first. Is there a way I can alter the key so that i can address emails to people with their first name first?
User avatar
Conor
Top Dog
Posts: 5343
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Automatic Email to borrowers

Post by Conor »

All emails out of the pedias are filled out by the "borrowedBy" key. You bring up a good point that the format of this key depends on your Address Book settings and might not be reader friendly. I have updated the betas to allow for two new key "[key:borrowedByFirstName]" and "[key:borrowedByLastName]".

Download the beta and if you have changed the default message go to your preferences and under the email change the [key:borrowedBy] to [key:borrowedByFirstName].

Emails bodies are only created once and then cached, so that won't affect all the messages currently in the "Outgoing Email" section. To have the program recreate all those, simply turn of the automatic email preference and close the preference window and then open it up and turn it back on again, this will add all the emails that need to go out again (this also means the program will send another email for currently overdue books when adding them again).
kprice5
Bruji Friend
Bruji Friend
Posts: 12
Joined: Wed Jul 11, 2012 9:15 am

Re: Automatic Email to borrowers

Post by kprice5 »

Wow! Thanks for updating that so quickly! Very much appreciated :)
kprice5
Bruji Friend
Bruji Friend
Posts: 12
Joined: Wed Jul 11, 2012 9:15 am

Re: Automatic Email to borrowers

Post by kprice5 »

I have noticed that loans created on the iPad (and Macs other than the server) do not populate the "outgoing emails" box. Only loans created on the server (where the box to create overdue reminders automatically has been ticked) populates the outgoing emails list. Even if I change the loan date on the server for loans originally created on another mac or the iPad, the server still does not want to send out emails regarding that specific loan.

Am I doing something wrong or is there a fix for this? I should note that I am using the beta of both DVDpedia and Bookpedia. I did not try to replicate the issue before updating to the beta.

Thanks!
User avatar
Conor
Top Dog
Posts: 5343
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Automatic Email to borrowers

Post by Conor »

I had not considered that the server would not process updates for email sending as it was not the one making the changes. Since the preference is not on in the client machines they are also not tagging the messages as needing sending and the server does not check if it needs sending as it did not directly modify the entry itself.

One solution is through assistive devices to script the server's DVDpedia and Bookpedia to turn the automatic email preference off and on again daily. When the preference is turned on the programs will go through and check all the entries and pick new loaned entries and add them to the outgoing email queue.

The second would need a lot of testing, but I have updated all the email sending to read the information from the file in realtime for all operations. Do download the new betas of Bookpedia 24 and DVDpedia 40 and set the preferences for automatic message sending on on all machines with the new betas.

The new code is a lot more complicated as they are all reading and writing from the message file and needs serious testing, since there could be race issues. I am hoping that the programs are actually so fast that it won't be a major concern. Theoretically two programs could both read the file at the same time and try to send emails, but it should be so fast that with only a few programs running there should be no overlap and any client or server that sends emails will then update the file to let the other programs know that it has sent the emails, they would also all add information into the file when updating entries.

The truth is the automatic email message sending option was develop with a single users in mind and is not built to handle this kind of concurrency being a simple XML file on the disc instead of a Core Data object like the database that is built to handle multiple updates from several machines.
kprice5
Bruji Friend
Bruji Friend
Posts: 12
Joined: Wed Jul 11, 2012 9:15 am

Re: Automatic Email to borrowers

Post by kprice5 »

Thanks for the quick response. I have tried both methods that you suggested and cannot get the software to auto-generate emails to loans created by other macs or the iPad with the beta.

When I tick/untick the auto-emails preference, it still only populates with emails for loans created on that mac. The loans created on the second mac can be auto-generated on the second mac.

I could actually be fine with one mac and one iPad running the software, but loans created on the iPad are also not generating email reminders on either machine.

I also would not mind generating email reminders manually once a week (as the iPad-created loans are appearing), but my attempts to generate emails in batches did not work. It appears it would have to be user by user.

Thanks!
User avatar
Conor
Top Dog
Posts: 5343
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Automatic Email to borrowers

Post by Conor »

Strange. Ticking and unpicking the box should refresh all the emails. If this is done after an iPad sync it should also pick up all the loans from the iPad as they are now set that way in DVDpedia. I can't repeat it here but I'll try different setups.
kprice5
Bruji Friend
Bruji Friend
Posts: 12
Joined: Wed Jul 11, 2012 9:15 am

Re: Automatic Email to borrowers

Post by kprice5 »

I have been playing around with the new beta on multiple macs and the iPad, but still cannot manage to get the outgoing emails to sync between the two macs (and emails are not being generated anywhere for the iPad-created loans). At one point I did had loans from the other mac reflected on the server, but they appeared without the borrowers' names. Unfortunately, I have not been able to replicate this again. I started to think it could be a permissions issue, and played around with read/write settings as well, but that did not work either.

Any ideas on what I could try next? If you cannot replicate this on your end, I would assume that it has to do with my setup. I would really like to know why the server is not auto-generating emails for loans generated by the iPad.

Thanks so much for your quick responses and patience in dealing with my unusual setup!
kprice5
Bruji Friend
Bruji Friend
Posts: 12
Joined: Wed Jul 11, 2012 9:15 am

Re: Automatic Email to borrowers

Post by kprice5 »

Hi,
I have been trying to make Pocketpedia communicate correctly with DVDpedia and am posting the following screen shot to see if this could be the root of the problem.

I have done the following in my current setup with one mac and one iPad using Beta 40:
1. moved the database off of the server and on to one single mac, putting the database in its default location and deleting the old pocketpedia database.
2. erased Pocketpedia on the iPad and reinstalled the app
3. checked a movie out on the iPad and synced the database.
4. The loan showed up on the mac, but did not generate an email for that loan (same problem I have been having).
5. I closed dvdpedia database and opened the pocketpedia database.
6. As you can see on the screen shot, there is no due date on the pocketpedia database for the highlighted film (although one had been generated on the DVDpedia database).

Could this be part of the problem? If not, do you have any suggestions as to what I may try?

Thanks!

Image
User avatar
Conor
Top Dog
Posts: 5343
Joined: Sat Jul 03, 2004 12:58 pm
Contact:

Re: Automatic Email to borrowers

Post by Conor »

Thank you for the all the details. After much debugging and looking around I was able to find the bug.

The address book record identifiers are not the same on the iPhone/iPad as they are on the Mac, even though the contacts might be synced from the same database. The beta version of 5.1.2 that will be released soon has been updated to find out the necessary email address for emailing a borrower by using the full name of the borrower and looking him up on the address book. Not ideal as this might cause an issue if you have more than one person with the same full name, but hopefully this is not the case. It also limited to people and will not send email to corporations as the search is limited to that available in borrowed by.

I apologize it took quite a while to find that bug, it's was quite hidden. The complexities of two way sync are numerous.
kprice5
Bruji Friend
Bruji Friend
Posts: 12
Joined: Wed Jul 11, 2012 9:15 am

Re: Automatic Email to borrowers

Post by kprice5 »

Wonderful! Thanks for finding and fixing the bug. I am looking forward to the beta! I will make sure to keep my address book clean to avoid problems. Thanks!
Post Reply