I'm writing an automailer to send emails some time after an order.

I am trying to build the email content in the language that the order was made in, using extra constants defined for that purpose.

My problem is forcing the script (which uses application_top) to use the correct language constants on demand.

Normally the constants used are always those of the currently-selected shop language (when it is open in other tab of the browser).

Hard-coding in the script the SESSION values for language, languages_id and code works in isolation...
eg:
1) if script session values are set to language 1, script uses constants from language 1
2) when the shop tab is changed to language 2, the next time the script is refreshed it uses language 2, then the second time it is refreshed it reverts to language 1 as required

I understand its a session issue, but I would like some confirmation that
a) this is impossible when there is an active session in the same browser
b) if the script is run as a cron job, this will not be an issue

I've done a lot of playing around and in any case would still like to know if it is possible to force the use of a specific language by a script irrespective of other browser sessions.