Notifications on change of certain files

Dominik Ruf dominikruf at gmail.com
Wed Aug 30 17:15:49 UTC 2017


Леутин Александр <a.leutin at infinnity.ru> schrieb am Do., 10. Aug. 2017 um
15:24 Uhr:

> Hello!
>
> I'm trying to set up notifications to certain users about changing certain
> files in repository within Kallithea.
> I set up hook with type of "incoming" to launch python function.
>
> I already digged how to use two extra fields I created for this task
> (monitor_files and monitor_emails), and now I have difficulties with
> sending e-mail notifications.
>
> In the kallithea/model/comment.py I saw this code:
>
>             NotificationModel().create(
>                 created_by=user, subject=subj, body=body,
>                 recipients=recipients, type_=notification_type,
>                 email_kwargs=email_kwargs,
>             )
>
> Will it be sufficient to create such model in my hook code to send e-mail
> notifications, or I have to do something else?
>
Kallithea has no API for sending emails.
I'd recommend creating a hook that uses something like
https://docs.python.org/2/library/email-examples.html

>
> --
> Alexandr Leutin
> _______________________________________________
> kallithea-general mailing list
> kallithea-general at sfconservancy.org
> https://lists.sfconservancy.org/mailman/listinfo/kallithea-general
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sfconservancy.org/pipermail/kallithea-general/attachments/20170830/3dcfe233/attachment.html>


More information about the kallithea-general mailing list