Hi Minesh
"Well - first thing you should note down is that - we never encourage using View within the email notification."
My response:
If Views are "not encouraged" to be used in Email Notifications, then why is the option to add a View available? Either Views work or they don't, and the button should be there or not there and be supported or not supported accordingly. I've never come across this advice before.
I need to include at least some views to get other information, from other records created by the post author. Eg in the case of this ticket, a typical family user creates a user (wp_users), then the creates a post type family record (wp_posts, wp_postmeta), then the Job Ad (also wp_posts, wp_postmeta). The only link I have between all 3 is the post author.
Would it be valid then to include the other Views from the user and family data, but add the contents of the Job Ad record, directly in the Email notification? Your suggested solution seems to be complicating the process even further with extra Content Templates which were not necessary previously.
"Also - you replaced the custom field with the content template I believe that is why the issue happen."
My response:
I was following guidance found in other support tickets on populating the post_content field using generic fields, since we do not want the users to have a WYSIWYG editor:
Example post from Toolset forum:
https://toolset.com/forums/topic/disabling-rich-text-wysiwyg-editor-on-certain-forms-form-fields-completely/#post-1480753
In this post, you advised replacing the normal post content field with the code:
[cred_generic_field field='post_content' type='textarea' class='' urlparam='']
{
"required":1,
"validate_format":0,
"default":""
}
[/cred_generic_field]
In the same thread https://toolset.com/forums/topic/disabling-rich-text-wysiwyg-editor-on-certain-forms-form-fields-completely/page/2/#post-1482679, you advised to use the following code:
[wpv-post-body view_template="None"]
In another post from Nigel: https://toolset.com/forums/topic/disable-wysiwyg-editor-for-post-content-in-cred-forms/#post-2211943, which corresponds with a post from Waqar: https://toolset.com/forums/topic/how-to-disable-the-wysiwyg-editor/#post-2680931
they advise to use the following code in an Edit form:
[cred_generic_field type='textarea' field='post_content']
{
"required":0,
"default":"[wpv-post-body template='None']",
"persist":1
}
[/cred_generic_field]
Also Nigel advises to use a "persist" option, which is not present in your code. He says: "Note that where I added the generic field I included a "persist" option, which means that the field value will be saved. (Ordinarily they are not, and should be processed with server-side PHP using one of the Forms API hooks such as cred_save_data.)"
So I hope you can appreciate my confusion with the conflicting advice. Moving forward, what is correct? In your version, there is class='' and urlparam='', in Nigel's version not. In Nigel's version, the default is defined as "[wpv-post-body template='None']", in yours it's defined as "default":"".
In the documentation https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_generic_field, the following parameters are not explained:
- persist
- validate_format
Please provide clarification of
1) what the correct code is for capturing a large text field without the WYSIWYG editor into the post_content field in
a) a Post Form for creating content
b) a Post Form for editing content
Also please provide descriptions of what the "persist" and "validiate_format" arguments are designed to do, and whether they should be present in the Post Create Forms and/or the Post Edit Forms.
Thanks and kind regards
Simon