Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Re: Pulling Email Address -> Links v1.11

Quote Reply
Re: Pulling Email Address -> Links v1.11 In reply to
I guess I'm not seeing the problem.

But, in order to get the email addresses out of the users table, you'd have to make a call to the users table, and load the results of that call into a hash variable (pointer to a hash).

Then, you'd use that returned result $user->{'Email'} to generate the proper values, and pass the test.

When adding a record, the only data available is the information in the $links hash of hashes. You need to use that value, to do a lookup on the $users table, and find the corresponding value, then pass _that_ value to the email template.

You could try to use a "join" construct, and do it all on one lookup, but I don't think it would work given the current construct of the code.

The best way would just be to do a get_record for the matching "user" value, then add that hash to the passed hash values. (or, assign $user->{email} to $links->{$id->{email}} or whatever).

Make sense?

In order to _use_ the values, you have to do an explicit lookup of the value in the user table. Then, pass that value to the email routines.

This is why I'm not sure why you did it the way you did, and why in another message, I said doing all the checks up front was a better way around the gestalt of the problem.

To do this right, would require a logic change to the code, where when a link was submitted with a valid userID. Then, when the "link" was going to be validated, (or presented in the Admin) a "join" was made with the users table, so that the missing data was inserted into the Admin edit screen. Then, when the records were sent to be validated, _all_ the link+user data was available, but only the link data was inserted into the Links table -- the rest was just discarded.

See what I'm getting to? The user management features need to be integrated on the front end, so that they are available through the program, otherwise you are going to have to make odd database calls at various points in the code (very messy) -- when the _logical_ place was up front, when the record was initially presented for approval.

If I've still not hit the problem, I really don't see it. What I see as the problem is you have no "Contact_Email" in the "link" and you need to get it from the "users" table, which is keyed to the link (or vice versa) by the UserID. Logically "join" the tables in the begining of the 'validate' routines, and you'll have those variables available in all the subsequent calls.

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Subject Author Views Date
Thread Pulling Email Address -> Links v1.11 Stealth 4541 Aug 13, 2000, 9:39 AM
Post Re: Pulling Email Address -> Links v1.11
pugdog 4449 Aug 13, 2000, 10:03 AM
Thread Re: Pulling Email Address -> Links v1.11
pugdog 4456 Aug 13, 2000, 10:08 AM
Thread Re: Pulling Email Address -> Links v1.11
Stealth 4455 Aug 13, 2000, 10:14 AM
Thread Re: Pulling Email Address -> Links v1.11
pugdog 4461 Aug 13, 2000, 9:07 PM
Thread Re: Pulling Email Address -> Links v1.11
Stealth 4458 Aug 13, 2000, 9:16 PM
Thread Re: Pulling Email Address -> Links v1.11
Stealth 4429 Aug 14, 2000, 10:21 PM
Thread Re: Pulling Email Address -> Links v1.11
pugdog 4429 Aug 15, 2000, 1:30 AM
Thread Re: Pulling Email Address -> Links v1.11
Stealth 4423 Aug 15, 2000, 7:04 AM
Thread Re: Pulling Email Address -> Links v1.11
pugdog 4432 Aug 15, 2000, 8:52 AM
Thread Re: Pulling Email Address -> Links v1.11
Stealth 4401 Aug 15, 2000, 8:19 PM
Thread Re: Pulling Email Address -> Links v1.11
pugdog 4411 Aug 15, 2000, 10:57 PM
Post Re: Pulling Email Address -> Links v1.11
Stealth 4386 Aug 16, 2000, 2:05 PM