Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-core
Commits
7bc78640
Commit
7bc78640
authored
Mar 24, 2006
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed alerts for forums
- Fixed bug in im_send_alert - Cleaned up code in forum/www/new-2.tc
parent
2486ee08
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
intranet-alert-procs.tcl
tcl/intranet-alert-procs.tcl
+14
-8
No files found.
tcl/intranet-alert-procs.tcl
View file @
7bc78640
# /packages/intranet-core/tcl/intranet-alerts.tcl
# /packages/intranet-core/tcl/intranet-alert
-proc
s.tcl
#
#
# Copyright (C
)
1998-200
4
various parties
# Copyright (C
)
1998-200
6
various parties
# The code is based on ArsDigita ACS 3.4
# The code is based on ArsDigita ACS 3.4
#
#
# This program is free software. You can redistribute it
# This program is free software. You can redistribute it
...
@@ -24,7 +24,7 @@ ad_library {
...
@@ -24,7 +24,7 @@ ad_library {
# -------------------------------------------------------------------
# -------------------------------------------------------------------
# Add an alert to the database alert queue
# Add an alert to the database alert queue
# -------------------------------------------------------------------
# -------------------------------------------------------------------
ad_proc im_send_alert
{
target_id frequency subject
{
message
""
}
}
{
ad_proc
-public
im_send_alert
{
target_id frequency subject
{
message
""
}
}
{
Add a new alert to the queue for a specific user.
Add a new alert to the queue for a specific user.
The idea is to aggregate several alerts into a single email,
The idea is to aggregate several alerts into a single email,
to avoid hundereds or emails, for example if a user has been
to avoid hundereds or emails, for example if a user has been
...
@@ -52,13 +52,14 @@ ad_proc im_send_alert {target_id frequency subject {message ""} } {
...
@@ -52,13 +52,14 @@ ad_proc im_send_alert {target_id frequency subject {message ""} } {
}
}
# Determine the sender address
# Determine the sender address
set sender_email
[
ad_parameter -package_id
[
ad_acs_kernel_id
]
SystemOwner
""
"webmaster@local
\
set sender_email
[
ad_parameter -package_id
[
ad_acs_kernel_id
]
SystemOwner
""
"webmaster@localhost"
]
host"
]
if
[
catch
{
if
[
catch
{
set sender_email
[
db_string sender_email
"select email as sender_email from parties where
\
set sender_email
[
db_string sender_email
"select email as sender_email from parties where party_id = :current_user_id"
-default
$sender
_email
]
party_id = :current_user_id"
-default
"asfd@asdf.com"
]
}
errmsg
]
{
}
errmsg
]
{
# nothing - use default
ns_log Notice
"im_send_alert: Error determining email for sender
$current
_user_id:
$errmsg
"
ad_return_complaint 1
"Error determining email for sender
$current
_user_id:<br>
<pre>
$errmsg
</pre>"
return
}
}
...
@@ -67,6 +68,11 @@ host"]
...
@@ -67,6 +68,11 @@ host"]
ns_sendmail
$email
$sender
_email
$subject
$message
ns_sendmail
$email
$sender
_email
$subject
$message
}
errmsg
]
{
}
errmsg
]
{
ns_log Notice
"im_send_alert: Error sending to
\"
$email
\"
:
$errmsg
"
ns_log Notice
"im_send_alert: Error sending to
\"
$email
\"
:
$errmsg
"
# ad_return_complaint 1 " Error sending email to '$email':<br>
# <pre>$errmsg</pre>"
# return
}
else
{
}
else
{
ns_log Notice
"im_send_alert: Sent mail to
$email
\n
"
ns_log Notice
"im_send_alert: Sent mail to
$email
\n
"
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment