Forum OpenACS Development: error among API parameters

Collapse
Posted by Iuri Sampaio on
in a tcl file i have the command line

callback acs_mail_lite::send \
-package_id $package_id \
-message_id $message_id \
-from_addr $from_addr \
-to_addr $to_addr \
-body $body \
-mime_type $mime_type \
-subject $subject \
-cc_addr $cc_addr \
-bcc_addr $bcc_addr \
-file_ids $file_ids \
-object_id $object_id

What causes the error at logs
[17/Apr/2009:16:25:22][8124.2982824880][-sched:13-] Error: *****Error while sending queued mail: can't read "from_party_id": no such variable

Tracking down the error my guess is that this API calls all callbacks related, and one of them is
callback::acs_mail_lite::send::impl::mail_tracking

Defined in packages/mail-tracking/tcl/mail-tracking-callback-procs.tcl

This callback has -from_party_id (required) and -to_party_id (required) as parameters.

However the vars from acs_mail_lite API contains
-from_addr $from_addr \
-to_addr $to_addr \

which somehow must be switched to -from_party_id (required) and -to_party_id (required)

Moreover, the vars $from_addr and $to_addr are not passed to the callback API on mail-tracking with their respective values.

Then in the file packages/mail-tracking/tcl/mail-tracking-callback-procs.tcl line 72 require those vars;

# set log_id [mail_tracking::new -package_id $package_id \
-sender_id $from_party_id \
-recipient_ids $to_party_id \

How do i track the sequence of this APIs to check those parameters ?

Collapse
Posted by Ryan Gallimore on
Hi Iuri,

What version of OpenACS are you running? Make sure you have the latest stable release.

Collapse
Posted by Emmanuelle Raffenne on
Hi Iuri,

The from_party_id and to_party_id are args of another callback (acs_mail_lite::complex_send) that was available in 5.4 but has been removed in 5.5.

Anyhow, the implementation in mail-tracking is not correct since it's for the acs_mail_lite::send callback which declares the following args:

ad_proc -public -callback acs_mail_lite::send {
-package_id:required
-message_id:required
-from_addr:required
-to_addr:required
-body:required
{-mime_type "text/plain"}
{-subject}
{-cc_addr}
{-bcc_addr}
{-file_ids}
{-object_id}
}

The implementation must use the same signature. In other words, it's the implementation that need to be fixed, not the callback declaration in acs-mail-lite.

Hope that will help.

Collapse
Posted by Iuri Sampaio on
Yes Ryan,

i can't tell about stable but it's latest 5.5 from cvs HEAD.

Yes Emma,
it helped. thanks!
From now on i should be following acs-mail-lite source code to fix the rest. since it is the last updated.