Skip Navigation

[Resolved] Can I pass an extra fied in the user form into the notification email

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.

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 9 months, 1 week ago.

Author
Posts
#2695038

Tell us what you are trying to do?
I am trying to create a process to add users(members) to the website. These members will be requesting to have a specific role for the website (delegated editors for a community website).
I have created a page to request setting up a user and have created a role called pending which I automatically assign the user to. I want to have an email notification sent, on form submission, to the website admin with the form data including the extra field (generic field, multiple lines) in the form. Using %%FORM_DATA%% does not have the extra field. Is there a way (preferably without coding) to pass this data to the email?

Here is the email body of the notification to the website admin:
You have received a request for a new member.
Please go and look at pending users in wordpress and assign the user the correct role AFTER contacting the nominated editor of that requested area.

Thanks.

%%FORM_NAME%%
%%FORM_DATA%%

%%DATE_TIME%%

Is there any documentation that you are following? I have followed the documentation to create a user. I have also looked at this but I do not find the field I am looking for, created in the form. https://toolset.com/course-lesson/send-notifications-when-someone-submits-the-form/

Is there a similar example that we can see?

What is the link to your site? haddington.info/my-account > create user

Thanks

#2695039

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

If the fields are user custom fields that are saved against the user profile (i.e. user fields that you created with Types), rather than generic fields that are discarded once the form is processed, then that means you can output values of those fields using the wpv-user shortcode, where you need to specify the slug of the field, and also the ID of the user.

The ID of the user would be set using a forms placeholder, %%USER_USERID%%

Putting that together, try this in your notification (editing your field slug):

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

Can you check that and see if it works.

#2695598

On reading your reply, I thought I would have a rethink of the adding user process. I now have a custom post type for contact forms and will add pending users into this post type. Passing info into the email notification is then easy because I simply pass across that data into the notification.
Thank you for your rapid response.