faq::notification_delivery::do_notification (private)

 faq::notification_delivery::do_notification question answer entry_id \
    faq_id user_id

Defined in packages/faq/tcl/q-and-a-procs.tcl

Issues notifications for a FAQ

Parameters:
question
answer
entry_id
faq_id
user_id

Partial Call Graph (max 5 caller/called nodes):
%3 packages/faq/www/admin/q-and-a-add-edit.tcl packages/faq/ www/admin/q-and-a-add-edit.tcl faq::notification_delivery::do_notification faq::notification_delivery::do_notification packages/faq/www/admin/q-and-a-add-edit.tcl->faq::notification_delivery::do_notification ad_conn ad_conn (public) faq::notification_delivery::do_notification->ad_conn db_string db_string (public) faq::notification_delivery::do_notification->db_string faq::notification::get_url faq::notification::get_url (private) faq::notification_delivery::do_notification->faq::notification::get_url notification::new notification::new (public) faq::notification_delivery::do_notification->notification::new notification::type::get_type_id notification::type::get_type_id (public) faq::notification_delivery::do_notification->notification::type::get_type_id

Testcases:
No testcase defined.
Source code:
        set faq_name [db_string select_faq_name {
            select faq_name from faqs
            where faq_id = :faq_id
        }]
        set name [person::name -person_id $user_id]
        set email [party::email -party_id $user_id]

        set faq_url [faq::notification::get_url $entry_id]

        set q_a_text [ns_reflow_text -- "Question: $question\nAnswer: $answer"]
        set text_version [subst {Faq: $faq_name\nAuthor: $name ($email)\n\n$q_a_text\n\n--To view the entire FAQ go to: $faq_url}]

        set new_content $text_version
        set package_id [ad_conn package_id]

        # Notifies the users that requested notification for the specific FAQ
        notification::new  -type_id [notification::type::get_type_id  -short_name one_faq_qa_notif]  -object_id $faq_id  -response_id $entry_id  -notif_subject "New Q&A of $faq_name"  -notif_text $new_content

        # Notifies the users that requested notification for all FAQ's
        notification::new  -type_id [notification::type::get_type_id  -short_name all_faq_qa_notif]  -object_id $package_id  -response_id $entry_id  -notif_subject "New Q&A of $faq_name"  -notif_text $new_content
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: