[ic] mv_order_route and "route expandable" dont work together?

Kevin Walsh interchange-users@interchange.redhat.com
Fri Mar 8 06:52:01 2002


> 
> I have a field in userdb called "emailcopy". It should behaive
> like "email" on checkout/order; another (second) email should
> send to this mail address. In catalog.cfg, I set up:
> 
> UserDB    default    scratch       "[...] emailcopy"
> [...]
> ## This route copies the user to the second address
> Route copy_user_copy  error_ok     1
> Route copy_user_copy  report       etc/mail_receipt
> Route copy_user_copy  track        logs/log
> Route copy_user_copy  email        "[scratch emailcopy]"
> [...]
> #won't work when emailcopy is non-empty:
> Route   default   cascade         "log main copy_user"
> #won't work when emailcopy is empty:
> #Route   default   cascade         "log main copy_user copy_user_copy"
> [...]
> #FormIgnore      mv_order_route
> 
> The configuration is based on the one from the foundation demo, I
> just added my route. 
> 
> I cannot use the copy_user_copy route in cascade, since it would
> generate an error if this scratch (--> optional database field) is
> empty. So I decided to try to use mv_order_route for that. So I
> wrote in ord/checkout.html:
> 
> <INPUT TYPE=hidden NAME=mv_order_route
> VALUE="log main copy_user [if scratch emailcopy]copy_user_copy[/if]">
> 
> This works if "emailcopy" is empty only. If it's set, a mail gets
> send:
> 
> to=[scratch, stat=User unknown
> 
> to=emailcopy], stat=User unknown
> 
> the non-expanded email address (which gets expanded when I
> configure this via the "route default cascade" option). So it isn't
> working (I think this may be a IC bug in
> Interchange version 4.8.2 Copyright 1996-2001 Red Hat, Inc.
> or I missed something)
> 
> Any ideas how to generate a second mail to a user/userdb
> dependent email-address?
> 
Perhaps something like this:

1) Get rid of the 'email' directive in your 'copy_user_copy'
   route.  In fact, get rid of the whole route and make a new
   one by making a copy of your existing 'copy_user' route.

2) Copy etc/mail_receipt to etc/mail_receipt_copy and use this
   new filename in your new 'copy_user_copy' route.

3) Use your [scratch emailcopy] in the [email] tag's "to" parameter
   in place of the [value email] tag in your etc/mail_receipt_copy
   file.

4) Change the [if value email_copy] code, in the etc/mail_receipt_copy
   file to read [if scratch emailcopy].

You get the idea.

-- 
   _/   _/  _/_/_/_/  _/    _/  _/_/_/  _/    _/
  _/_/_/   _/_/      _/    _/    _/    _/_/  _/   K e v i n   W a l s h
 _/ _/    _/          _/ _/     _/    _/  _/_/    kevin@cursor.biz
_/   _/  _/_/_/_/      _/    _/_/_/  _/    _/