notification::email::send (public)

 notification::email::send from_user_id to_user_id reply_object_id \
    notification_type_id subject content_text content_html file_ids

Defined in packages/notifications/tcl/notification-email-procs.tcl

Send the actual email.

Parameters:
from_user_id (required)
The user_id of the user that the email should be sent as. Provide empty for the standard mailer from address.
to_user_id (required)
reply_object_id (required)
notification_type_id (required)
subject (required)
content_text (required)
content_html (required)
file_ids (required)

Partial Call Graph (max 5 caller/called nodes):
%3 AcsSc.notificationdeliverymethod.send.notification_email AcsSc.notificationdeliverymethod.send.notification_email (private) notification::email::send notification::email::send AcsSc.notificationdeliverymethod.send.notification_email->notification::email::send acs_mail_lite::send acs_mail_lite::send (public) notification::email::send->acs_mail_lite::send ad_html_qualify_links ad_html_qualify_links (public) notification::email::send->ad_html_qualify_links lang::system::site_wide_locale lang::system::site_wide_locale (public) notification::email::send->lang::system::site_wide_locale lang::user::site_wide_locale lang::user::site_wide_locale (public) notification::email::send->lang::user::site_wide_locale lang::util::localize lang::util::localize (public) notification::email::send->lang::util::localize

Testcases:
No testcase defined.
Source code:

       # Get user data
       set email [party::email -party_id $to_user_id]
       set user_locale [lang::user::site_wide_locale -user_id $to_user_id]
       if { $user_locale eq "" } {
           set user_locale [lang::system::site_wide_locale]
       }

       # Variable used in the content
       set manage_notifications_url [manage_notifications_url]

       if { $content_html eq "" } {
           set mime_type "text/plain"
           append content_text "\n#" "notifications.lt_Getting_too_much_emai#"
           set content $content_text
       } else {
           set mime_type "text/html"
           append content_html "<p>#" "notifications.lt_Getting_too_much_emai#</p>"
           set content $content_html
       }

       # convert relative URLs to fully qualified URLs
       set content [ad_html_qualify_links $content]

       # Use this to build up extra mail headers
       set extra_headers [list]

       # This should disable most auto-replies.
       lappend extra_headers [list "Precedence" "list"]

       set reply_to [reply_address -object_id $reply_object_id -type_id $notification_type_id]

       if { $from_user_id ni {"" 0} && [person::person_p -party_id $from_user_id]} {
           # Notification is sent on behalf of a person on the system.
           set from_email [party::email -party_id $from_user_id]

           if {[parameter::get  -package_id [get_package_id]  -parameter EmailQmailQueueScanP -default 0] != 1} {
               # We did not activate the processing of incoming
               # messages: this means we do not process replies to
               # notifications. There is no point in setting the
               # Reply-To to something different than the Sender.
               set reply_to ""
           } else {
               # We support notification replies.
               # Set the Mail-Followup-To address to the
               # address of the notifications handler.
               lappend extra_headers [list "Mail-Followup-To" $reply_to]
           }
       } else {
           # Notification is sent by the system itself.
           set from_email $reply_to
       }

       acs_mail_lite::send  -to_addr $email  -from_addr $from_email  -reply_to $reply_to  -mime_type $mime_type  -subject [lang::util::localize $subject $user_locale]  -body [lang::util::localize $content $user_locale]  -file_ids $file_ids  -use_sender  -extraheaders $extra_headers
XQL Not present:
PostgreSQL
Generic XQL file:
packages/notifications/tcl/notification-email-procs.xql

Oracle XQL file:
packages/notifications/tcl/notification-email-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: