Jump to content

How to Email custom fields value to the clients


Webmaster001

Recommended Posts

We have a product and it has 5 custom fields. Each of these custom fields is defined by using an input box during the checkout.

 

When the product is created we want to send these values (which the client typed) to them for their record.

 

WHMCS suggest using {$client_custom_fields.1} in the email template. But our clients receive empty input for those. We double checked the clients. In the Product section they have those values defined and we can see them however we are unable to see those in the sent emails. They are not encrypted by MD5 so we technically should be able to send them.

 

Can anyone suggest how we should set up the email template so the clients receive those 5 custom field values?

Link to comment
Share on other sites

Thanks for the help. I have tried that but it has not worked yet. I tried to send the email with these

 

1) {$service_custom_fields.1}

2) {$service_custom_fields.2}

3) {$service_custom_fields.3}

4) {$service_custom_fields.4}

5) {$service_custom_fields.5}

 

 

Also, I used this foreach function:

 

{foreach from=$service_custom_fields item=customfield}

{$customfield.name}: {$customfield.value}

{/foreach}

 

However the email contains blank fields . No output in the email. Any suggestion?

Link to comment
Share on other sites

ok, the solution works when the product is initially created but I can't use the same technique to send the custom_fields after the initial product creation email. At least the initial suggest worked :)

 

Solution:

{$service_custom_fields.0}

{$service_custom_fields.1}

{$service_custom_fields.2}

{$service_custom_fields.3}

{$service_custom_fields.4}

 

And the output was produced in the initial product email without any issue. Any suggestion why we cant send them again in an email?

Link to comment
Share on other sites

that's how it worked for me when I tested it last night - purely as a welcome email when purchasing a hosting product.

 

when you send an email (Send Email Message), I think that you can only use the merge fields shown in that page, which I think are client only.

 

i'm not overly familiar with the mail side of WHMCS, but when sending the email, I am assuming that you are ticking the checkbox next to the clients name and hitting "Send Email Message" - this won't work as it won't have access to the product custom fields.

 

what I think you need to do is go into the client's profile, select the product in question and then at the bottom of that page hit "Send Message" - you will then have access to the custom fields... i've tested this on mine before posting, so it should work on yours!

Link to comment
Share on other sites

  • 10 years later...

You could also try:

{foreach from=$service_custom_fields_by_name item=field key=index}

    {if $field.name == "ACTUAL NAME OF FIELD"}

{$field.name} : {$field.value}

    {/if}

{/foreach}

or 


{foreach from=$service_custom_fields item=customfield}
{$customfield}
{/foreach}

 

 

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.

×
×
  • 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