SwiftModders Posted September 13, 2008 Share Posted September 13, 2008 Hi, I can't get my product fields to work anymore in my emails, for example: [ProductCustom-IP Address] Produces... [ProductCustom-IP Address] Not the IP address for the customer. Can you tell me the correct code to use for custom fields. - John 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted September 13, 2008 WHMCS CEO Share Posted September 13, 2008 The syntax you need to use is shown in the merge fields list or {$service_custom_field_fieldname} Matt 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted September 13, 2008 Share Posted September 13, 2008 Actually... Available Merge Fields Client Related ID {$client_id} Full Name {$client_name} First Name {$client_first_name} Last Name {$client_last_name} Company Name {$client_company_name} Email Address {$client_email} Address 1 {$client_address1} Address 2 {$client_address2} City {$client_city} State {$client_state} Postcode {$client_postcode} Country {$client_country} Phone Number {$client_phonenumber} Password {$client_password} Signup Date {$client_signup_date} Credit Balance {$client_credit} CC Type {$client_cc_type} CC Last 4 Digits {$client_cc_number} CC Expiry Date {$client_cc_expiry} Language {$client_language} Custom Fields (Array) {$client_custom_fields.1} Status {$client_status} Other Company Name {$company_name} WHMCS URL {$whmcs_url} WHMCS Link {$whmcs_link} Signature {$signature} It does not list {$service_custom_field_fieldname} anywhere... 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted September 13, 2008 WHMCS CEO Share Posted September 13, 2008 The reason it doesn't list the service related merge fields in the above list is because you're composing a "General" type email message. You only see the merge fields that you can use in the email you are currently creating (not all of them). Matt 0 Quote Link to comment Share on other sites More sharing options...
MikeDVB Posted September 13, 2008 Share Posted September 13, 2008 Yeah I just looked It gives "Custom Fields (Array) {$service_custom_fields.1}" but does not list the syntax you gave (the non-array form) 0 Quote Link to comment Share on other sites More sharing options...
SwiftModders Posted September 13, 2008 Author Share Posted September 13, 2008 He is right, there is none that tell you how to do this in the non array way. That should have been in the right side menu, but its not. So I would use: {$service_custom_field_IP Address} or {$service_custom_field_ip_address} Might want to update that Wiki 0 Quote Link to comment Share on other sites More sharing options...
SwiftModders Posted September 14, 2008 Author Share Posted September 14, 2008 Matt, can you help me out here? 0 Quote Link to comment Share on other sites More sharing options...
WHMCS CEO Matt Posted September 14, 2008 WHMCS CEO Share Posted September 14, 2008 There are 2 ways of referencing the custom fields. The first and easier way is the array method for example {$service_custom_fields.0) or {$service_custom_fields.1} for fields 1 & 2 respectively. Alternatively, you can reference the field by name using syntax such as{$service_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 "How did you find our site?" would become "howdidyoufindoursite" and so would be {$service_custom_field_howdidyoufindoursite} in the email template. Matt 0 Quote Link to comment Share on other sites More sharing options...
AxlF Posted December 15, 2008 Share Posted December 15, 2008 There are 2 ways of referencing the custom fields. The first and easier way is the array method for example {$service_custom_fields.0) or {$service_custom_fields.1} for fields 1 & 2 respectively. Just a note: With the new ordering feature in 3.8.1 the field number depends on the order of the custom fields. If you change the order you need to update your templates as well so best to use the name reference. 0 Quote Link to comment Share on other sites More sharing options...
apollo1 Posted December 15, 2008 Share Posted December 15, 2008 Can someone please tell me how/where you pull up a list of these merge fields? I seem to recall there was a button or something from within the email template being worked on, but I don't see it anymore. Where do we go to find the fields? I am using 3.8.1 and I'm wondering if it might have changed anything. 0 Quote Link to comment Share on other sites More sharing options...
AxlF Posted December 15, 2008 Share Posted December 15, 2008 Can someone please tell me how/where you pull up a list of these merge fields? I seem to recall there was a button or something from within the email template being worked on, but I don't see it anymore. Where do we go to find the fields? I am using 3.8.1 and I'm wondering if it might have changed anything. Theres no button anymore. The fields should show up on the right side as another column. Another note: {$service_custom_field_howdidyoufindoursite} This never worked for me!!! I have only access to the index vlaues, not the named values 0 Quote Link to comment Share on other sites More sharing options...
apollo1 Posted December 15, 2008 Share Posted December 15, 2008 Theres no button anymore. The fields should show up on the right side as another column. You're right. Geez I totally missed that... my screen is 1024x768 so those were scrolled off to the right and I didn't notice! Thanks. 0 Quote Link to comment Share on other sites More sharing options...
splitech Posted January 7, 2009 Share Posted January 7, 2009 Just upgraded my customer's WHM to version 3.8.1. After doing so the email templates custom merge inserts are not working. For instance on an email template there is: IP: [productcustom-ip address] Port: [productcustom-device port] Password: [productcustom-device password] Now i see this changed in the new version, so i did the following. IP: {$service_custom_field_ip_address} Port: {$service_custom_field_device_port} Password: {$service_custom_field_device_password} And when we send emails we get IP: Port: Password: Now these are custom fields for each product/services. Does it matter what merge you have to do for each product? Like {$product1_custom_field_ip_address} and {$product2_custom_field_ip_address} Please help. 0 Quote Link to comment Share on other sites More sharing options...
SilverNodashi Posted October 11, 2009 Share Posted October 11, 2009 I see these custom fields doesn't work in WHMCS 4.11 anymore Matt, what is the correct syntax to use in WHMCS 4.11? 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted March 29, 2012 Share Posted March 29, 2012 wow 14 posts and still no right answer it seems omg... seems noone really knows how this is suppose to work lol 0 Quote Link to comment Share on other sites More sharing options...
durangod Posted March 29, 2012 Share Posted March 29, 2012 (edited) UPDATE i put a whole list of formats in the template and {$service_custom_fields.0} works but {$service_custom_fields.softwareinstallurl} does not work, so i guess ill just have to remember if i ever change the order to change the template as the naming option does not work. Edited March 29, 2012 by durangod 0 Quote Link to comment Share on other sites More sharing options...
dm800pvr Posted April 5, 2012 Share Posted April 5, 2012 {$service_custom_fields.0} also does not works for me!! 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.