Forum OpenACS Development: send surveys through email

Collapse
Posted by Iuri Sampaio on
I created a tool on survey's package to send out new surveys by email to the users of my system.

I created the whole code to select the users and prepare the email to be sent. I wrote the code following the code i saw within dotlrn/www/spam-recipients.adp/tcl and spam.adp/tcl

Everything is properly written and the email is being sent. Although i want to add the survey's form in the body of the email message.

I got stuck on how to create the survey's form as a full HTML content in order to append it to the TCL var $message that I am passing as the argument for the API [bulk_mail::new]. Please see the API hook bellow.


bulk_mail::new \
-package_id [site_node_apm_integration::get_child_package_id -package_key [bulk_mail::package_key]] \
-send_date [template::util::date::get_property linear_date $send_date] \
-date_format "YYYY MM DD HH24 MI SS" \
-from_addr $no_reply \
-reply_to $person_email \
-subject "\[$group_name\] $subject" \
-extra_headers "Reply-To {$person_email} Return-Path {$no_reply}" \
-message $message \
-message_type $message_type \
-query $query

I was browsing the files on survey's package to learn how it builds the survey's form in the browser.
It basically uses the files www/repond.adp/tcl plus one_list.adp which i believe i will need to use them in other to build the new form.

Is this issue really hard to accomplish?

In a few words I want to push the survey's form into the body of the email that is sent to the users.

i know that once the email is sent I will have another problem to receive those survey's results and load them in the system. But that is another part of the whole project I need to build.

Collapse
Posted by Ryan Gallimore on
Why not simply include a link to the survey form in your e-mail?