Commit 67a35bd0 authored by Frank Bergmann's avatar Frank Bergmann

- modified member-notify to handle attachments

parent ba836940
Pipeline #77 failed with stages
......@@ -167,7 +167,7 @@ select acs_mail_body__new (
:header_to, -- header_to
:content_item_id, -- content_item_id
'acs_mail_body', -- object_type
now(), -- creation_date
now() ::date, -- creation_date
:creation_user, -- creation_user
:creation_ip, -- creation_ip
null -- context_id
......
......@@ -198,6 +198,7 @@ ad_proc -private acs_mail_encode_content {
ns_log Debug "acs-mail: encode: starting $content_item_id"
# What sort of content do we have?
if ![acs_mail_multipart_p $content_item_id] {
ns_log Debug "acs-mail: encode: one part $content_item_id"
# Easy as pie.
# Let's get the data.
......@@ -210,7 +211,8 @@ ad_proc -private acs_mail_encode_content {
]
set storage_type [db_string get_storage_type "
select storage_type from cr_items
select storage_type
from cr_items
where item_id = :content_item_id
"]
......@@ -221,18 +223,7 @@ ad_proc -private acs_mail_encode_content {
}] {
if [string equal $storage_type text] {
ns_log Debug "acs-mail: encode: one part hit $content_item_id"
# vinodk: no need for this, since we're checking
# storage_type
#
# We win! Hopefully. Check if there are 8bit characters/data.
# HT NL CR SP-~ The full range of ASCII with spaces but no
# control characters.
#if ![regexp "\[^\u0009\u000A\u000D\u0020-\u007E\]" $content] {
# ns_log Debug "acs-mail: encode: good code $content_item_id"
# # We're still okay. Use it!
return [list $v_content_type $content]
#}
#ns_log "Notice" "acs-mail: encode: bad code $content_item_id"
} else {
# this content is in the file system or a blob
ns_log Debug "acs-mail: encode: binary content $content_item_id"
......@@ -266,7 +257,10 @@ ad_proc -private acs_mail_encode_content {
return [list $v_content_type $encoded_content]
}
}
} else {
# This is a multipart item.
# Harder. Oops.
ns_log Debug "acs-mail: encode: multipart $content_item_id"
set boundary "=-=-="
......@@ -277,8 +271,7 @@ ad_proc -private acs_mail_encode_content {
from acs_mail_multipart_parts
where multipart_id = :content_item_id
order by sequence_number
}
]
}]
if ![empty_string_p $multipart_list] {
foreach multipart_item $multipart_list {
......@@ -304,7 +297,9 @@ ad_proc -private acs_mail_encode_content {
}
lappend contents [list $mime_disposition $content]
}
} else {
# Defaults
return {
"text/plain; charset=us-ascii"
......@@ -405,6 +400,7 @@ ad_proc -private acs_mail_process_queue {
} {
set to_send [acs_mail_body_to_output_format -link_id $message_id]
set to_send_2 [list $envelope_to $envelope_from [lindex $to_send 2] [lindex $to_send 3] [lindex $to_send 4]]
ns_log notice "acs_mail_process_queue: to_send_2=$to_send_2"
if [catch {
eval ns_sendmail $to_send_2
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment