seblucas / cops

Calibre OPDS (and HTML) PHP Server : web-based light alternative to Calibre content server / Calibre2OPDS to serve ebooks (epub, mobi, pdf, ...)
http://blog.slucas.fr/en/oss/calibre-opds-php-server
GNU General Public License v2.0
1.43k stars 229 forks source link

Default Mailaddress in Config for sending Books #336

Open Offerel opened 7 years ago

Offerel commented 7 years ago

As i have seen, the user can specify various parameters in config_local.php which sets defaults for the settings page. Is there a way to specify also the default E-Mail address for sending books to Kindle etc.?

hugoheitz commented 7 years ago

In the sendto section of the config file, the address.from is the default email used to send.

* If you want to use a simple smtp server (provided by your ISP for example), you can configure it like that :
     * $config['cops_mail_configuration'] = array( "smtp.host"     => "smtp.free.fr",
     *                                           "smtp.username" => "",
     *                                           "smtp.password" => "",
     *                                           "smtp.secure"   => "",
     *                                           "address.from"  => "cops@slucas.fr",

but maybe you want to define the default destination address ? it is in the config section of the COPS interface that you can do that for the device used. by default, it is blank and asks you to fill a value for the email, after that this value will be used for the next emails.

I use the sendto function and I opened issues to improve the functionalities to provide easily the destination to one or more devices see #326 and #329 and support them if you want

Offerel commented 7 years ago

Yes, i mean the default destination address. I know its blank by default, but i would like to have it pre-filled with my kindle address.

My Problem is, that automatically all my browserdata is cleaned by default and i cant change this. So i would like to have such things saved server based.

hugoheitz commented 7 years ago

I understand and I agree with the idea. The basic would be to add "address.to => "destination address by default" , in the config file. And in bookdetail.php to check if there is a value for that and using it by default. As proposed in #329, I would like to offer the configuration of the destination address in the config file but also the name of the target device so you can easily choose on which device you want to send the content...

Offerel commented 7 years ago

This would be great. Also the idea, that you can have more than one destination device.

CHBMB commented 7 years ago

I'd add my vote for a selection bar or something similar you can select destinations from.

hugoheitz commented 7 years ago

Please vote +1 for #326 and #329, I describe the functionality and a way to implement it.

seblucas commented 7 years ago

Unfortunately voting is easy, implementing it is harder ;)

Anyway I agree that this feature is interesting. I started to hack something based on changing the configuration to something like that :

     * $config['cops_mail_configuration'] = array( "smtp.host"     => "smtp.free.fr",
     *                                           "smtp.username" => "",
     *                                           "smtp.password" => "",
     *                                           "smtp.secure"   => "",
     *                                           "address.from"  => "cops@slucas.fr",
     *                                           "address.to"    => array(
     *                                                                "myKindle1@kindle.com",
     *                                                                "me@gmail.com"
     *                                                              )
     *                                           "subject"       => "Sent by COPS : " // Not mandatory
     *                                           );
hugoheitz commented 7 years ago

I totally agree, voting is easy, getting it real is harder !

If you manage a family with multiple devices (my situation), the proposition you made to use the mail only is OK to know the correct target if you configure it properly in amazon interface (for the kindles). You can have something like that


     *                                           "address.to"    => array(
     *                                                                "kindle_dad@kindle.com",
     *                                                                "kindle_mom@kindle.com",
     *                                                                "kindle_son@kindle.com",
     *                                                                "kindle_daughter@kindle.com",
     *                                                                "me@gmail.com"

(of course, with the correct names).

Your solution will fix directly issue #336. It will help fix issues #326 and #329 (which by the way are enhancements). I hope the mockups I made help understand how to visualize it best.

How will you merge this evolution and the existing implementation ? Will there still be a way to modify the destination mail with the config page, I mean this page http://cops-demo.slucas.fr/index.php?page=19

Do you plan to use by default the default addresses in the config files and as the last item the mail configured in the config page ?

How can I help you to validate the solution ?

It is a great job, since discovering the sendto function, it is really easier than before !

seblucas commented 7 years ago

How will you merge this evolution and the existing implementation ?

My goal is to open a popup with a checkboxlist of all email adresses I got (coming from the configuration item and from COPS configuration page).

That way you can send to many email at the same time.

Will there still be a way to modify the destination mail with the config page, I mean this page http://cops-demo.slucas.fr/index.php?page=19

You'll be able to add a new email address, yes.

Do you plan to use by default the default addresses in the config files and as the last item the mail configured in the config page ?

Exactly.

How can I help you to validate the solution ?

By testing it as soon as I have something ready but that won't be soon (I'll go on vacation in 2 days)

hugoheitz commented 7 years ago

Can you use HTML5 to provide something like the following mockup ? mockup cops avec with mail button and destination emails list

I am OK to test it as soon as possible but there is no rush. Enjoy your vacation !

doug-w commented 7 years ago

Does the kindle built in webbrowser support HTML5? One of the main usecases of the mail function to me is to mail from the device to the device.

On Thu, Apr 6, 2017 at 9:44 AM, hugoheitz notifications@github.com wrote:

Can you use HTML5 to provide something like the following mockup ? [image: mockup cops avec with mail button and destination emails list] https://cloud.githubusercontent.com/assets/972023/24765662/e905e5a2-1af8-11e7-94ee-45de64f73969.png

I am OK to test it as soon as possible but there is no rush. Enjoy your vacation !

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/seblucas/cops/issues/336#issuecomment-292234039, or mute the thread https://github.com/notifications/unsubscribe-auth/AAMX8be9v9yZAetbjigDSq_BFXK-L_iPks5rtRaGgaJpZM4Myfpr .

hugoheitz commented 7 years ago

I dont know for sure about kindle built in webbrowser and the support of HTML5. I proposed that because it is visually better and gives a solution in order to implement the button in the book list page.

I found that information https://html5test.com/results/other.html where the kindle browser is listed...

you are right, if it's important that the function works from the device to the device it needs to work with simple code. a good old select then (as proposed in one of my comments on the issue #329).

keep it simple, it will be easy to debug, if you go into testing the capacity of the web browser, it might bug for unknown reason.

CHBMB commented 7 years ago

Yeah, well aware it's easy to say stuff and a hundred times more difficult to implement it. Sorry if it offended anyone. "Gets my vote" is an English saying.....

seblucas commented 7 years ago

@CHBMB

be sure I was not offended (If I was there would have been no smiley in my answer)

@all

I have something that mostly work, I'll try to create a branch with it soon.

hugoheitz commented 7 years ago

Great news ! I am ready to test as soon as it will be ready !

CHBMB commented 7 years ago

@seblucas Jolly good, glad to hear I've not upset anyone. Looking forward to testing this too.

hugoheitz commented 7 years ago

Any news about the implementation in a new branch ? I am ready to test it and I believe it will help to close #336, #329 (if the correct portion of the code is replicated to the page 'main'), #326...

hugoheitz commented 6 years ago

After a long time, I would like to know if there is any target date for this set of functionalities...

hugoheitz commented 6 years ago

I closed the issue #326 today. Any news about this functionalities ?