Hi
I'm building an application that should send HTML emails (eventually with attachments) given some profiles built by users. It would normally use the notifications package but I could not find a way of formating emails with it, so I'm trying to use acs-mail.
I have taken code from the documentation at /doc/acs-mail/openacs-mail.html in my installation, but I get an error (see below).
I have two questions:
1) Is acs-mail the way to go? what about acs-mail-lite? (I can see that notifications uses it, but I read in other thread that it was planned to be merged into acs-mail)
2) If so why isn't the function found?
thanks
set subject "GS alert: My subject"
set headerTo "rafa@usyd.edu.au"
set headerFrom "rafa@usyd.edu.au"
set email "rafa@usyd.edu.au"
set content_type "text/plain"
set body_id [acs_mail_body_new -header_subject $subject -content $text -content_type $content_type]
# queue it
set sql_string "select acs_mail_queue_message.new (
null, -- p_mail_link_id
:body_id, -- p_body_id
null, -- p_context_id
now(), -- p_creation_date
:user_id, -- p_creation_user
:ip_addr, -- p_creation_ip
'acs_mail_link' -- p_object_type
);"
set mail_link_id [db_string queue_message $sql_string]
# put in in outgoing queue
set sql_string "
insert into acs_mail_queue_outgoing
( message_id, envelope_from, envelope_to )
values
( :mail_link_id, :from_addr, :to_addr )"
db_dml outgoing_queue $sql_string
error:
Database operation "0or1row" failed (exception NSDB, "Query was not a statement returning rows.")
ERROR: Function acs_mail_body__new("unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", "unknown", timestamptz, "unknown", "unknown", "unknown") does not exist
Unable to identify a function that satisfies the given argument types
You may need to add explicit typecasts
SQL:
select acs_mail_body__new (
NULL, -- body_id
NULL, -- body_reply_to
NULL, -- body_from
NULL, -- body_date
NULL, -- header_message_id
NULL, -- header_reply_to
'GS alert: My subject', -- header_subject
NULL, -- header_from
NULL, -- header_to
NULL, -- content_item_id
'acs_mail_body', -- object_type
now(), -- creation_date
NULL, -- creation_user
NULL, -- creation_ip
null -- context_id
);