Skip Navigation

[Resolved] CRED user form: not able to add custom field in notification email

This support ticket is created 5 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 8 replies, has 2 voices.

Last updated by roulartaM 5 years, 2 months ago.

Assisted by: Shane.

Author
Posts
#1378947
form-editor.PNG

I've made a CRED user form so users can register on our website. I use expert mode to build the form (see screenshot 'form-editor.PNG'.

When the form is submitted, a confirmation e-mail is sent to the right person. In the 'To:' the recipient is filled in with First name, Last name and Email. This works great.

BUT: I want to use that first name to personalize that e-mail. There should be something like this in it:

Hi Sam,
...

I've tried a lot of possible first name shortcodes but I'm not able to get that first name out of my form into my email. Here are my attempts that are not working:

1) [types usermeta="first_name" user_id="%%USER_USERID%%" user_is_author="true"][/types]<br/>
2) [types usermeta="first_name" user_id="%%USER_USERID%%"][/types]<br/>
3) [cred-field value='[types field="first_name"]']<br/>
4) [cred-field value='[types field="first_name"]']<br/>
5) [cred_field field='first_name']<br/>
6) [wpv-user field="user_firstname"],<br/>
7) [cred_field field='first_name' post='user' value='' urlparam='']<br/>
8) [cred_field field='firstname']<br/>
9) [types usermeta="firstname" user_id="%%USER_USERID%%" user_is_author="true"][/types]<br/>
10) [types usermeta="firstname" user_id="%%USER_USERID%%"][/types]<br/>
11) %%USER_USERID%%<br/>
12) [types usermeta="first_name" style="text" user_is_author="true"][/types]<br/>
13) [types usermeta="first_name" style="text" user_id="%%USER_USERID%%" user_is_author="true"][/types]<br/>
14) [types usermeta="straat" style="text" user_is_author="true"][/types]<br/>

And this is the output:

1)
2)
3) [cred-field value=”]
4) [cred-field value=”]
5) [cred_field field=’first_name’]
6) DH,
7) [cred_field field=’first_name’ post=’user’ value=” urlparam=”]
8) [cred_field field=’firstname’]
9)
10)
11) 93
12)
13)
14)

I really don't know why I'm not able to get it working. 6) and 11) are just a couple of extra tests,

Can you please help me fix this?
Thanks a lot!

#1378963

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Thank you for getting in touch.

It seems you want to add the user's first name to the notification.

In this case you will need to use the following.

[wpv-user field="user_firstname"]

In cases where you want to display custom field information then this shortcode below will be used.

 [types usermeta="cust_field"][/types]

Given that you are displaying default wordpress user information then you will need to use the [wpv-user] shortcode.

Please let me know if this clears things up for you.

Thanks,
Shane

#1380653

Hi Shane,

Sorry for the delay (weekend + holiday). I've tried both shortcodes but they're not working. I really don't understand why. Here's the code of my user form:

[creduserform class='Form']
[cred_field field='form_messages' class='alert alert-warning']
<div class="Form-row">
<div class="Form-col Form-col--50p">
[cred_field field='first_name' class='Form-inputText' placeholder='Voornaam']
</div><div class="Form-col Form-col--50p Form-col--last">
[cred_field field='last_name' class='Form-inputText' placeholder='Achternaam']
</div>
</div>
<div class="Form-row">
<div class="Form-col Form-col--50p">
[cred_field field='straat' force_type='field' class='Form-inputText' placeholder='Straat']
</div><div class="Form-col Form-col--25p">
[cred_field field='huisnummer' force_type='field' class='Form-inputText' placeholder='Huisnummer']
</div><div class="Form-col Form-col--25p Form-col--last">
[cred_field field='bus' force_type='field' class='Form-inputText' placeholder='Bus']
</div>
</div>
<div class="Form-row">
<div class="Form-col Form-col--25p">
[cred_field field='postcode' force_type='field' class='Form-inputText' placeholder='Postcode']
</div><div class="Form-col Form-col--75p Form-col--last">
[cred_field field='plaats' force_type='field' class='Form-inputText' placeholder='Plaats']
</div>
</div><div class="Form-row">
<div class="Form-col Form-col--100p Form-col--last">
[cred_field field='user_email' class='Form-inputMail' placeholder='E-mailadres']
</div>
</div>
<div class="Form-row">
<div class="Form-col Form-col--100p Form-col--last">
<div class="Form-checkboxInputWrapper">
[cred_field field='krant-2020' force_type='field' class='Form-checkboxInput']
</div>
<p class="Form-note">Ik ga akkoord met hidden link" target="_blank" title="Privacyverklaring" rel="noopener noreferrer">de algemene privacyverklaring en geef toestemming aan communie.be om mijn gegevens door te sturen naar Smartphoto voor mijn geschenk en aanbiedingen op maat. Je kan je steeds uitschrijven door te klikken op de uitschrijflink onderaan elke nieuwsbrief.</p>
</div>
</div>
<div class="Form-row">
<div class="Form-col Form-col--100p Form-col--last">
[cred_field field='form_submit' value='Ga verder' class='Button Button--default']
</div>
</div>
[/creduserform]

Here's the latest code in my confirmation mail:

Dag [types usermeta="first_name"][/types],<br/>
1) [types usermeta="first_name" user_id="%%USER_USERID%%" user_is_author="true"][/types]<br/>
2) [types usermeta="first_name" user_id="%%USER_USERID%%"][/types]<br/>
3) [cred-field value='[types field="first_name"]']<br/>
4) [cred-field value='[types field="first_name"]']<br/>
5) [cred_field field='first_name']<br/>
6) [wpv-user field="user_firstname"],<br/>
7) [cred_field field='first_name' post='user' value='' urlparam='']<br/>
8) [cred_field field='firstname']<br/>
9) [types usermeta="firstname" user_id="%%USER_USERID%%" user_is_author="true"][/types]<br/>
10) [types usermeta="firstname" user_id="%%USER_USERID%%"][/types]<br/>
11) %%USER_USERID%%<br/>
12) [types usermeta="first_name" style="text" user_is_author="true"][/types]<br/>
13) [types usermeta="first_name" style="text" user_id="%%USER_USERID%%" user_is_author="true"][/types]<br/>
14) [types usermeta="straat" style="text" user_is_author="true"][/types]<br/>
15) [wpv-user field="user_firstname"]<br/>
16) [types usermeta="first_name"][/types]<br/>
17) [types usermeta="straat"][/types]<br/>

And this is the output of my confirmation mail:

Dag ,
1)
2)
3) [cred-field value=”]
4) [cred-field value=”]
5) [cred_field field=’first_name’]
6) ,
7) [cred_field field=’first_name’ post=’user’ value=” urlparam=”]
8) [cred_field field=’firstname’]
9)
10)
11) 97
12)
13)
14)
15)
16)
17)

As you can see, the standard first name value stays empty and even the custom field 'straat' have no value in my confirmation mail. I did mention those fields in my user form. Perhaps there's something different that I'm doing wrong? :s

#1381109

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

You email confirmation fields should be



1) [wpv-user field="user_firstname"]<br/>


This should give you the first name of the user.

To get custom field values you will use
[types usermeta="cust_field"][/types]

These are custom fields created in Types.

For default user fields you will use [wpv-user field="user_firstname"]

Would you mind allowing me to have admin access to the website so that I can check on this for you ?

Also please let me know where the form is.

Thanks,
Shane

#1382069

Hi Shane,

As you can see, I used the shortcode in attempt 15) [wpv-user field="user_firstname"]<br/>
But strangely enough it's output is empty.

I'll gave you some admin rights on the website.

The code of the notification email can be found in 'Toolset' => 'User Forms' => 'Registratie (toevoegen)' => 'E-mail notifications' => 'Bevestiging'.

Thanks for checking it out!

#1382201

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

I tried checking on the form but i'm unable to edit anything as it is being locked by another user.

If you're logged in could you log out so that I can run some checks and test the form ?

Thanks,
Shane

#1382793

Hi Shane,

Sorry for that! I am constantly working on the website, but I'll leave the User Form called 'Registratie (toevoegen)' for now. I hope you have access to it? 🙂

#1383281

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hello,

Ok so to get it to you will need to add your items like this.

[wpv-user field="user_firstname" id="%%USER_USERID%%"]

For the custom field items you will add it like this.

[types field='field' item='%%USER_USERID%%'][/types]

Please let me know if this helps.

Thanks,
Shane

#1383331

Oh wow, very happy that it's finally resolved. Thank you!