Jump to content

Cannot get custom fields to be shown in 'New Order Notification' email template.


-M-

Recommended Posts

Man, I am actually getting pretty frustrated with WHMCS in terms of the email templates. Probably I am doing something wrong, but I have no clue what.

 

It's especially frustrating now that I have WHMCS almost ready, except for the stupid email templates. And this is something I am bumping my head on over and over.

 

A simple example. I created a custom customer field called: BTW nummer.

According to the online manual you can display this field in the email template by using:

 

{$client_custom_field_btwnummer}

 

This is right, right? Because, and I quote:

 

To display custom client fields in the email templates, you can 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" once the space was removed, so the merge field would be {$client_custom_field_vatnumber} in the email template.

 

So the variable {$client_custom_field_btwnummer} should be the correct one to display the custom customer field called 'BTW nummer'?

 

But when I copy this variable into my "New Order Notification" email template and fill out a test order online, it doesn't appear in there and I have no clue what the reason is... It's driving me nuts.

 

Maybe I am just to stupid to comprehend, but it starting really to get on my nerves... :(

Link to comment
Share on other sites

Man, I am actually getting pretty frustrated with WHMCS in terms of the email templates. Probably I am doing something wrong, but I have no clue what.

welcome to WHMCS - you get used to that feeling eventually... :)

 

It's especially frustrating now that I have WHMCS almost ready, except for the stupid email templates. And this is something I am bumping my head on over and over.

A simple example. I created a custom customer field called: BTW nummer.

According to the online manual you can display this field in the email template by using:

This is right, right? Because, and I quote:

So the variable {$client_custom_field_btwnummer} should be the correct one to display the custom customer field called 'BTW nummer'?

yeesss... but not all variables/arrays are available to all templates..

 

But when I copy this variable into my "New Order Notification" email template and fill out a test order online, it doesn't appear in there and I have no clue what the reason is... It's driving me nuts.

Maybe I am just to stupid to comprehend, but it starting really to get on my nerves... :(

http://forum.whmcs.com/showthread.php?107810-How-to-show-client-custom-field-in-admin-new-order-notification-email&p=442654#post442654

 

Support answered that not all fields available for this template and if I need my field there, I have to use EmailPreSend hook...

 

...Finally support answered that EmailPreSend doesn't work with admin emails, so unfortunately I can't do what I want using this hook.

as per our previous thread on this - http://forum.whmcs.com/showthread.php?108367-Problem-with-if-in-notification-emails-Maybe-variable-not-used - if the custom_fields array/variables are not available to the email template, and the usual hook method can't be used because it's an admin email, I don't think there's a simple solution to this. :(

 

if you could use the welcome/invoice templates, that would be one way around this - but you have previously mentioned that you don't.

 

you could try reporting it as a bug (though technically it isn't), contacting support or making a new feature request in the requests page.

 

also, you might be able to use the API to send yourself a separate admin email, though you would probably need to query the db to get the BTW number for the order.

 

http://docs.whmcs.com/API:Send_Admin_Email

Edited by brian!
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated