stevewilliams Posted October 27, 2008 Share Posted October 27, 2008 For each of my products, I have a hidden custom field in which each product has a different number. ex. Product 1 has a hidden custom field "itemno" with a value of "1". In the welcome email template, Im trying to insert the product_custom field like this: Visit this link: http://mydomain.com/folder/{product_custom_field_itemno} in efforts to generate a URL like: Visit this link: http://mydomain.com/folder/1 if the person buys product 1. I gues the email templates do not support the product_custom_field tag. Is there any way to pass a value that is hidden in the checkout process to the welcome email template? Thanks for any help you can provide. 0 Quote Link to comment Share on other sites More sharing options...
stevewilliams Posted October 27, 2008 Author Share Posted October 27, 2008 EDIT: I see that I can insert the product custom field tag into the Order Confirmation email instead, which is great. Only, I try inserting it like this: [ProductCustomField-role] Where "role" is the name of the custom field, but the value will not show. I have the custom field setup like this: Field name: role Field type: dropdown Field options: 06 Required: yes Show on order form: no So, in the order confirmation email, Im trying to get the value "06" to show without the custom field being visible on the order form. It's a set value for this product. Any ideas?? Thanks again. 0 Quote Link to comment Share on other sites More sharing options...
stevewilliams Posted October 28, 2008 Author Share Posted October 28, 2008 EDIT: I see that I can insert the product custom field tag into the Order Confirmation email instead, which is great. Only, I try inserting it like this: [ProductCustomField-role] Where "role" is the name of the custom field, but the value will not show. I have the custom field setup like this: Field name: role Field type: dropdown Field options: 06 Required: yes Show on order form: no So, in the order confirmation email, Im trying to get the value "06" to show without the custom field being visible on the order form. It's a set value for this product. Any ideas?? Thanks again. Could anyone offer some sort of assistance to help me get the "product custom field" to display in the order confirmation email? Thanks 0 Quote Link to comment Share on other sites More sharing options...
sparky Posted October 28, 2008 Share Posted October 28, 2008 (edited) The way I understand it In a product you have setup 1 custom field, so to display that custom field in an email template you would use {$service_custom_fields.0} then {$service_custom_fields.1} for a second custom field. So in your example you could also use {$service_custom_fields_role} or {$service_custom_fields_itemno} After writing this I checked in the wiki. You can read info on this here http://wiki.whmcs.com/Messages/Emails Edited October 28, 2008 by sparky 0 Quote Link to comment Share on other sites More sharing options...
Shaun Posted October 28, 2008 Share Posted October 28, 2008 The wiki is your friend: http://wiki.whmcs.com/Messages/Emails#Email_Templates To display client custom fields in the email templates, you can either reference it by it's numerical reference such as {$client_custom_fields.0} for the first field, {$client_custom_fields.1} for the second, etc... Or you reference it by name using the format {$client_custom_field_fieldnamehere}. For fieldnamehere, you need to take your custom field name, convert the name to lowercase and remove anything other than a-z 0-9 chars. For example "VAT Number" would become "vatnumber" and so would be {$client_custom_field_vatnumber} in the email template. The same applies to Product custom fields, however they are referenced by {$service_custom_fields.0} or {$service_custom_field_fieldnamehere}. 0 Quote Link to comment Share on other sites More sharing options...
dm800pvr Posted April 5, 2012 Share Posted April 5, 2012 I test everything No solution works! {$service_custom_fields.0} {$service_custom_fields.fieldname} . . . I use in invoice email template but description of related product won't shows at all! 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.