Skip Navigation

[Resolved] in the form email notification

This support ticket is created 4 years, 8 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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

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 7 replies, has 2 voices.

Last updated by Mario 4 years, 8 months ago.

Assisted by: Shane.

Author
Posts
#1516859

Tell us what you are trying to do?
I have created a notification for a new user registration form.

I want to use the form field - "user_firstname" to display in the email
and a generic field.

I have tried %%first_name%%

#1517129

Shane
Supporter

Languages: English (English )

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

Hi Mario,

Thank you for getting in touch.

Could you try this ?
[wpv-user field="user_firstname"]

Or

%%USER_FIRSTNAME%%

Please let me know if this helps.

Thanks,
Shane

#1521611

Hi Shane
Tried both - nothing displays.

#1521691

Shane
Supporter

Languages: English (English )

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

Hi Mario,

Thank you for trying.

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

The private fields will be enabled for your next response.

Also please let me know the page where i can find the form to test.

Thanks,
Shane

#1525231

Shane
Supporter

Languages: English (English )

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

Hi Mario,

Thank you for the patience.

I've done some testing on your site and you will need to create custom markers for your notifications.

For e.g i've created a custom marker for first name which is %%FIRST_NAME%% using this code below.

add_filter('cred_subject_notification_codes', 'custom_generic_field_notification', 10, 1);
 
add_filter('cred_body_notification_codes', 'custom_generic_field_notification', 10, 1);
 
function custom_generic_field_notification( $defaultPlaceHolders ) {
 
    $newPlaceHolders = array( 
        '%%FIRST_NAME%%' => $_REQUEST['first_name']
    );
  
    return array_merge($defaultPlaceHolders, $newPlaceHolders );
}

To add lets say last name we can do it like this.

add_filter('cred_subject_notification_codes', 'custom_generic_field_notification', 10, 1);
 
add_filter('cred_body_notification_codes', 'custom_generic_field_notification', 10, 1);
 
function custom_generic_field_notification( $defaultPlaceHolders ) {
 
    $newPlaceHolders = array( 
        '%%FIRST_NAME%%' => $_REQUEST['first_name'],
        '%%LAST_NAME%%'=>$_REQUEST['last_name'],
    );
  
    return array_merge($defaultPlaceHolders, $newPlaceHolders );
}

Where last_name is the name of the field on the form.

I've tested this and it works.

Please let me know if this helps.
Thanks,
Shane

#1526845

H Shane,
Tried both the suggested solutions, unfortunately crashes the site.
I placed the code in the plugin my custom functions.

#1526993

Shane
Supporter

Languages: English (English )

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

Hi Mario,

You won't need to re-add the function to the function.php file. I've already added the custom function to the Toolset custom functions in Toolset->settings->custom code.

All you need to do is to modify this code and add the other placeholders.

Thanks,
Shane

#1527039

Hi Shane,
Thank you for the assistance.