send-email.tcl

email sending page

Location:
/packages/acs-admin/www/send-email.tcl
Author:
Hiro Iwashima
Created:
23 Aug 2000
CVS ID:
$Id: send-email.tcl,v 1.8.2.3 2023/10/06 12:09:19 gustafn Exp $

Related Files

[ hide source ] | [ make this the default ]

File Contents

ad_page_contract {
    email sending page

    @author Hiro Iwashima <iwashima@mit.edu>
    @creation-date 23 Aug 2000
    @cvs-id $Id: send-email.tcl,v 1.8.2.3 2023/10/06 12:09:19 gustafn Exp $
} {
    email:email
    email_from
    subject
    message
    return_url:localurl
    {show_sent_message_p:boolean,notnull "f"}
    {sent_title "Email sent"}
    {sent_subject "Email sent"}
    {sent_message "Email was successfully sent"}
    {error_subject "Error sending email"}
    {error_message "There was an error sending email:"}
} -properties {
    sent_title:onevalue
    sent_subject:onevalue
    sent_message:onevalue
    return_url:onevalue
}

ad_try {

    acs_mail_lite::send \
        -send_immediately \
        -to_addr $email \
        -from_addr $email_from \
        -subject $subject \
        -body $message

} on error {errorMsg} {
    ad_return_error $error_subject "<p>[ns_quotehtml $error_message]</p>
          <div><code>[ns_quotehtml $errorMsg]</code></div>"
    ad_script_abort
}

if { $show_sent_message_p != "t" } {
    # Do not show any message. Just go to return url
    ad_returnredirect $return_url
    ad_script_abort
}

# Local variables:
#    mode: tcl
#    tcl-indent-level: 4
#    indent-tabs-mode: nil
# End: