01-27-2006, 10:02 AM
|
|||
|
|||
![]() Okay real quickly... As admin pointed out ... %sql1_domain_name%.%sql1_domain_tld% could be placed in your template if your custom SQL1 contains the appropriate query. Here's an overview of how to go about it, pretty much as outlined in the documentation located at: http://www.agilebill.com/EmailTemplateCoding?v=gfq To add such things as %var_variable%, you will first need perform an SQL query. This can be done a number of ways, but is easiest with performing associative queries using the custom SQL fields in your templates. For instance: In this case **assume** %SQL1% contains the account number (account_id) we could do: SELECT * FROM %DB_PREFIX%account WHERE id = %SQL1% Your template will now provide you with the matching account table array which you can call in your template using something like: %sql1_first_name% %sql1_middle_name% %sql1_last_name% %sql1_company% ... Easy, right? I think the account info is available in all templates anyway, but it's just an example. You can also use the custom SQL fields to do associated, recursive and join lookups. That's a bit more complex. Then, there is also another approach: Depending on which template you need to modify and what you intend to print to it, you can also modify the code in the particular module that actually calls the email template function. That function looks something like: $mail->send('this->template',$account_id,$SQL1,$SQL2,$SQL3); So let's say you wanted to assign values to $SQL1, 2 or 3. You would need to perform your query and assign your variables before calling the email function. In that instance, if you assigned a variable to $SQL2 for instance and use it to do a lookup when generating your invoices. Nice eh? etc. Hopefully I didn't miss anything. |