Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-rule-engine
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-rule-engine
Commits
71f75022
Commit
71f75022
authored
Jun 08, 2018
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Fixed rule-engine support for simple_survey
parent
52efaeaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
9 deletions
+18
-9
intranet-rule-engine-procs.tcl
tcl/intranet-rule-engine-procs.tcl
+18
-9
No files found.
tcl/intranet-rule-engine-procs.tcl
View file @
71f75022
...
...
@@ -153,7 +153,7 @@ ad_proc im_rule_callback_log {
# ---------------------------------------------------------------------
ad_proc im_rule_callback
{
{
-debug_p
0
}
{
-debug_p
1
}
{
-action
""
}
-object_id:required
{
-type_id
""
}
...
...
@@ -317,7 +317,7 @@ ad_proc im_rule_callback {
# Check if there are emails to be sent
if
{
""
!=
[
string
trim
$rule
_action_email_to_tcl
]}
{
im_rule_callback_fire_email -email_tcl
$rule
_action_email_to_tcl -object_id
$object
_id -rule_id
$rule
_id -env
$env
im_rule_callback_fire_email -
debug_p
$debug
_p -
email_tcl
$rule
_action_email_to_tcl -object_id
$object
_id -rule_id
$rule
_id -env
$env
}
}
}
...
...
@@ -370,6 +370,7 @@ ad_proc im_rule_callback_fire_email {
-rule_id:required
-env:required
{
-debug_p 0
}
{
-process_mail_queue_now_p 1
}
}
{
Send out an email to the users specified
}
{
...
...
@@ -379,6 +380,10 @@ ad_proc im_rule_callback_fire_email {
array set old
[
lindex
$env
0
]
array set new
[
lindex
$env
1
]
array set changed
[
lindex
$env
2
]
if
{
$debug
_p
}
{
ns_log Notice
"im_rule_callback_fire_email: old=
[
array
get old
]
"
}
if
{
$debug
_p
}
{
ns_log Notice
"im_rule_callback_fire_email: new=
[
array
get new
]
"
}
if
{
$debug
_p
}
{
ns_log Notice
"im_rule_callback_fire_email: changed=
[
array
get changed
]
"
}
db_1row rule_info
"
select r.*
...
...
@@ -390,6 +395,8 @@ ad_proc im_rule_callback_fire_email {
# Execute the email action
#
if
{
""
!=
[
string
trim
$rule
_action_email_to_tcl
]}
{
if
{
$debug
_p
}
{
ns_log Notice
"im_rule_callback_fire_email: rule_action_email_to_tcl=
$rule
_action_email_to_tcl"
}
if
{[
catch
{
set cmd
"set out
\[
$rule
_action_email_to_tcl
\]
"
eval
$cmd
...
...
@@ -400,6 +407,7 @@ ad_proc im_rule_callback_fire_email {
-message
$out
-statement
$rule
_action_email_to_tcl -env
$env
return
}
if
{
$debug
_p
}
{
ns_log Notice
"im_rule_callback_fire_email: sending emails to: '
$out
'"
}
# Log the result of the command
im_rule_callback_log -object_id
$object
_id -rule_id
$rule
_id -source
"action_email_to_fire"
\
...
...
@@ -472,13 +480,7 @@ ad_proc im_rule_callback_fire_email {
ns_log Notice
"im_rule_callback_fire_email: Sending email to
$email:
$subject
\n
$body
"
if
{
$debug
_p
}
{
ad_return_complaint 1
"<pre> acs_mail_lite::send
-send_immediately
-to_addr
$email
-from_addr
$new
(sender_email)
-subject
$subject
-body
$body
"
ad_script_abort
# ad_return_complaint 1
"<pre> acs_mail_lite::send
\n\t
-send_immediately
\n\t
-to_addr
$email
\n\t
-from_addr
$new
(sender_email)
\n\t
-subject
$subject
\n\t
-body
$body
"
;
ad_script_abort
}
else
{
if
{[
catch
{
acs_mail_lite::send
\
...
...
@@ -501,6 +503,13 @@ ad_proc im_rule_callback_fire_email {
}
}
# ---------------------------------------------------------------
# Process the mail queue right now
# ---------------------------------------------------------------
if
{
$process
_mail_queue_now_p
}
{
acs_mail_process_queue
}
ns_log Notice
"im_rule_callback_fire_email: finished: object_id=
$object
_id, rule_id="
}
...
...
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