Jump to content

Inserting product_custom_field In Email Template


stevewilliams

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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 by sparky
Link to comment
Share on other sites

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}.

Link to comment
Share on other sites

  • 3 years later...

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