Can I include a small thumbail of each image downloaded in the email download notification?

  • Is it possible to have JG insert or include the thumbnail of the image downloaded in the email notifications for downloads? What would I need to include in the .php file? Which php file would it be that does this?

  • in en-GB.com_joomgallery.ini, there is this line:


    COM_JOOMGALLERY_MESSAGE_NEW_DOWNLOAD_BODY="The image with the title %1$s (Filename: %2$s) has been downloaded by %3$s!"


    If I could figure out or you could tell me what variable represents the thumbnail of the image where it could be inserted into this line, I might have some luck.

    • Offizieller Beitrag

    In order to modify the content of the email you would need to change eighter the content of the language string (with a language override) or you have to modify the body of the mail within the JoomMessenger class.


    The first option is update safe, but more restricted in what you can do. Since Joomgallery's mailer is sending the mails in raw text format I guess its impossible to add an image this way but i would definitely give it a try.


    The second option is to modify JoomGallery core files. For that take a look at the following code line, where the email for new downloads gets created:
    https://github.com/JoomGallery…s/image/view.raw.php#L136

    Additionally look at this code lines where the JoomMessenger creates the email using Joomlas mailing service:

    https://github.com/JoomGallery…elpers/messenger.php#L459
    Here you can find the documentation of the Joomla mailing class. I think I would try putting the thumbnail as an attachement using $mailer->addAttachment(<IMAGEPATH>)

    Joomla! API
    The Joomla! CMS 3.10 API Documentation
    api.joomla.org

    Wir sind auf der Suche nach Helfern für die JoomGallery 4 Entwicklung!

    Melde dich bei Interesse bei mir (Elfangor93).

    (Verfügbare Jobs: PHP-Entwicklung, Testen, Übersetzen, Dokumentation)

  • [tt]Here you can find the documentation of the Joomla mailing class. I think I would try putting the thumbnail as an attachement using $mailer->addAttachment(<IMAGEPATH>)


    Thank you for that explanation! The <IMAGEPATH> needs a variable, it's not just IMAGEPATH, as indicated. Once I did that I got an error message but then I reversed the change I made and realized that the < and > around the word needs a variable followed by a ";" to end the command. What's the variable for the image thumbnail?