Closed (fixed)
Project:
UC Gift Certificate
Version:
6.x-1.1
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
21 May 2010 at 20:34 UTC
Updated:
31 Mar 2011 at 10:02 UTC
I believe it would be more effective and efficient if the email sent was based of a 'myfile.tpl.php' much like the invoices. This would allow for more flexibility in creating the emails and prevent the use of another module (MIMEMAIL).
Comments
Comment #1
jrust commentedComment #2
jrust commentedFixed in CVS
Comment #4
kyuubi commentedHello i would like to know if it is possible to have more than one tpl file for the gift certificate, to send customizaed emails based on some atributes (that part i have already done) but the theming system is allways getting the uc_gift_certificate.tpl.php even if i say in the theme function to get other tpl file :
function uc_gift_certificate_theme() {
return array(
'uc_gift_certificate' => array(
'template' => 'my_customized_certificate_email',
'arguments' => array('gift_certificate' => NULL, 'account' => NULL),
),
);
}
any idea why it allways gets the same file or what i would have to do to make him get another file?
best regards,
Joao Garin
Comment #5
kyuubi commentedFigured this out, the theme function is redirecting to the template_preprocess function where it is possible to set two special variables named "template_file" and "template_files", setting one of these variables (template_file has priority over template files) it will replace the tpl file to use in the gift email.
My code :
function template_preprocess_uc_gift_certificate(&$variables) {
$variables['template_file'] = 'uc_gift_mycertificate';
...
}
Put the file in the template dir and it´s done.
For more info on theme function http://api.drupal.org/api/drupal/includes--theme.inc/function/theme/6
Best regards,
Joao Garin