Buy Now
Sign in

email result to PMS (JIM) adress

jfkraaij , January 14 2008, 05:51
J
jfkraaij 3
January 14 2008, 05:51 #4908
LS,

I am a happy user of chronoforms.

Using JIM PMS as privage message system, I wonder if it is possible to email the results of a chronoform to another user. I am using CB for my usermanagement.

In that case it will be possible to hold private information in a secured environment.

Thanx,

Frank<br><br>Post edited by: jfkraaij, at: 2008/01/14 00:52
GreyHead 64
January 14 2008, 15:48 #4909
Hi Frank,

You could almost certainly hack the ChronoForms code to replace the mail function call with a corresponding call from JIM.

Unfortunately the JIM download site is down at the moment so I can't look at the code to see what would be needed. If you want to email me the component at the address in my sig I'll take a quick look.

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much
GreyHead 64
January 14 2008, 18:12 #4910
Hi Frank,

Thanks for the code. I had a quick look and found this in the CB bridge:
global $database;
$sql="
INSERT
INTO #__jim (username, whofrom, date, readstate, subject, message)
VALUES('"  .$to."', '".$from."', NOW(), 0, '".$sub."', '".$msg."');";
$database->SetQuery($sql);
if (!$database->query()) {
die("SQL error" . $database->stderr(true));
}
I think this would do the trick with a little modification.

Here's a first hack at it, I've changed the SQL format to make it a bit simpler to keep the Values clean. I think the place to put this is in the 'OnSubmit after email' box.
<?php    global $database, $my;
$from = $my->username;
$to = ???;
$sql="
INSERT
INTO #__jim
SET username = '$to',
whofrom = '$from',
date = NOW(),
readstate = 0,
subject = '$subject',
message = '$html_message';";
$database->SetQuery($sql);
if (!$database->query()) {
die("SQL error" . $database->stderr(true));
}
?>
I've left ??? in the $to variable as I'm not sure how you'd pick up the recipient's username. I guess that depends on your application.



Rough code! Not tested!

Bob
ChronoForms technical support
If you'd like to buy me a coffee or two, thank you very much