Index: openacs-4/packages/notifications/tcl/notification-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/notifications/tcl/notification-callback-procs.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/notifications/tcl/notification-callback-procs.tcl 30 Apr 2018 12:45:00 -0000 1.7 +++ openacs-4/packages/notifications/tcl/notification-callback-procs.tcl 3 Sep 2024 15:37:39 -0000 1.8 @@ -40,15 +40,23 @@ -array:required -package_id } { - Implementation of the interface acs_mail_lite::incoming_email for notifications. Notification - listens to replies sent out initially from notifications. According to the notification signature - -$object_id-$type_id@ it tries to figure out for which notification - type the email was from. The type corresponds to the service contract implementation. If the object_id - exists notification creates an entry in the table notification_email_hold and tries to inform implementations - of acs_mail_lite::incoming_email interested. Since the service contract NotificationType is implemented - only once for a package the table acs_mail_lite_reply_prefixes is used simply figure out which package corresponds - to the found type_id and has a valid package key. If a package key is found the callback implementation is - called. + + Implementation of the interface acs_mail_lite::incoming_email for + notifications. Notification listens to replies sent out initially + from notifications. According to the notification signature + <EmailReplyAddressPrefix>$object_id-$type_id@<EmailDomain> + it tries to figure out for which notification type the email was + from. + +

The type corresponds to the service contract + implementation. If the object_id exists notification creates an + entry in the table notification_email_hold and tries to inform + implementations of acs_mail_lite::incoming_email interested. Since + the service contract NotificationType is implemented only once for + a package the table acs_mail_lite_reply_prefixes is used simply + figure out which package corresponds to the found type_id and has + a valid package key. If a package key is found the callback + implementation is called. @author Nima Mazloumi (nima.mazloumi@gmx.de) @creation-date 2005-07-15 @@ -110,13 +118,19 @@ -content $email(bodies)] db_dml holdinsert {} - #extending email array for notification callback implementors + #extending email array for notification callback implementers set email(object_id) $object_id set email(type_id) $type_id set email(reply_id) $reply_id set email(user_id) $user_id - if {[db_0or1row select_impl {}]} { + if {[db_0or1row select_impl { + select impl_owner_name as package_key + from acs_sc_impls + where impl_id = (select min(sc_impl_id) + from notification_types + where type_id = :type_id) + }]} { ns_log Notice "acs_mail_lite::incoming_email -impl notifications: calling notifications::incoming_email implementation for package $package_key" if { [catch {callback -impl $package_key notifications::incoming_email -array email} error] } { ns_log Notice "acs_mail_lite::incoming_email -impl notifications: $error"