[Date Prev][Date Next][Thread Prev][Thread Next][Interchange by date
][Interchange by thread
]
Re: [ic] different email by zip code?
Mathieu Lagarde wrote:
>
> Hi,
>
> We have a customer who sales frozen meal. Each part of the territory is
> deserve by a different and independent representative.
>
> So i want to know if it's possible to set interchange to be able to send
> the order to different email address depending of the zip code of the customer.
sure, embed some perl in the page that actually generates and sends the
email.
If the zipcodes are not contiguous using if/then statements is going to
be a pain in the ass.
Better to set up a hash keyed on the zipcode.
Then you'd only need to populate the hash and one line which says $email
= $hash{$zip}.
That would be one way to handle it...
Alternative solution:
Create a new table using the zipcode as the key for the one item in each
row, which would be the reps email address.
zip email
15216 bob@foo.com
15219 bob@foo.com
15230 bob@foo.com
16728 biff@boff.com
16725 biff@boff.com
Then just do a table lookup in the page that generates the e-mail.
[seti rep-email][data table="zips" column="email" key="[value
zip]"][/seti]