meowtec / Imagine

🖼️ PNG/JPEG optimization app for macOS, Windows and Linux.
MIT License
3.69k stars 278 forks source link

Feature Request/Help Add the ability to Email the Reduced Images #61

Open rpelletierrefocus opened 4 years ago

rpelletierrefocus commented 4 years ago

I would like to configure the ability to send the resized images to an email address. This would require another options panel to configure the SMTP server, plus another option in the ActionsBar for email.

I have built electron apps before, but this one is a bit more complex, especially regarding the use of react which I have never used.

I would love to try and contribute and add this feature myself, but would greatly appreciate a few pointers.

Basically, where might you suggest I start to add the components for the Options Popup, which would be quite similar to the ImageOptions panel, except of course it would be a form with SMTP server address, SMTP credentials and from address.

Thank you for any assistance you could provide. And thank you for the project, I like it quite a bit and would love to contribute with some assistance.

meowtec commented 4 years ago

Thanks for your willingness to contribute, but Please not do that. It is just an image manipulation application, not an email client.

While you can add the email feature in your fork, build and release your own edition. But please not send me a Pull Request.

Some advices:

  1. Add a new property like mailConfig into interface IStorageContent, interface IGlobals for storing the email configure data. And make sure to store it to local.
  2. Modify OptionsPanel.tsx and add some inputs for server address, credentials and others. Or you can create a new modal, using material ui or ant design modal.
  3. Search for ACTIONS.DEFAULT_OPTIONS_UPDATE to know how to update the redux state. (You should update IGlobals.mailConfig when the form changes)
  4. Modify ActionBar.tsx for adding the email button.
  5. Search for fileSaveAll to know how to filter for reduced images (and the mailConfig). Then add a similar one like mailAllReducedImages, in which you can use a node mail module such as Nodemailer to send the mail.
rpelletierrefocus commented 4 years ago

Understood, Thank you so much for the pointers. This is a great start and very helpful.