Skip Navigation

[Resolved] User fields and Usermeta fields in form notification emails

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 1 reply, has 2 voices.

Last updated by Minesh 1 year, 4 months ago.

Assisted by: Minesh.

Author
Posts
#2631443

Tell us what you are trying to do?

I want to have a notification sent when a user (not the user whose record is being edited) edits a user's metadata using a Toolset edit user form.

I'd like a notification which goes to the user who has been edited containing some of the usermeta fields for them and a notification to a specified email address stating the data and the user first and last name of the user who edited the record.

Something like these two:

----------------------------------------------------
To the user whose record was edited (not the user who edited the record)...

Dear [wpv-user field="user_firstname"]

You have been issued on [types usermeta='access-issued' style='text' format='F j, Y' ][/types] with a key, fob (number [wpv-user field="wpcf-access-fob-number" ])
----------------------------------------------------

To the specific email address (the premises manager)....

Key and fob (number [wpv-user field="wpcf-access-fob-number"] were issued to [wpv-user field="user_firstname" ] [wpv-user field="user_lastname" ] on [types usermeta='access-issued' style='text' format='F j, Y' ][/types].

This record was updated by %%USER_FIRST_NAME%% %%USER_LAST_NAME%%
-------------------------------------------------------

I have a feeling that I am mixing up user fields which relate to the user who edited the record and the user whose record was edited. I can't understand when "placeholders" are used and when user fields are used.

#2631631

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Here is the doc that shows the information about how you can add the Types shortcode inside email notification.
- https://toolset.com/course-lesson/send-notifications-when-someone-submits-the-form/#displaying-post-and-user-fields-in-notifications

You can use the attribute user_id="%%USER_USERID%%" to display the information about user you are editing.
For example:

[types usermeta='access-issued' style='text' format='F j, Y' user_id="%%USER_USERID%%"][/types]

To display the loggedin user information, you can use the shortcode [wpv-current-user].
- https://toolset.com/documentation/programmer-reference/views/views-shortcodes/#wpv-current-user

For example:

[wpv-current-user info="lastname"]

This record was updated by %%USER_FIRST_NAME%% %%USER_LAST_NAME%%
==>
the above placeholder should also display the loggedin user firstname and last name.