The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Search
Close
AI Search
Classic Search
 Search Phrase:
 Search Type:
Advanced search options
 Search in Forums:
 Search in date period:

 Sort Search Results by:

AI Assistant
How can I include c...
 
Notifications
Clear all

Question [Solved] How can I include custom field to actual message

11 Posts
3 Users
3 Reactions
5,506 Views
(@validhan)
Posts: 6
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 
[#5298]

How can I include custom field to actual notification or email message?

For example if I choose department and post comment it is displayed on comment. 

But on the notification message there's no custom field, only comment content.

So how can I include custom fields on comment content?

Thank you

Screenshot 13

 


 
Posted : 07/10/2022 1:19 pm
Asti
 Asti
(@asti)
Posts: 8260
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@validhan,

How can I include custom field to actual notification or email message?

Please clarify a bit what kind of email you mean. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 07/10/2022 2:12 pm
(@validhan)
Posts: 6
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hello @asti,

I mean about actual notification sent to particular user. I'm using WpDiscuz for custom fields.

For example UserA posts comment "@UserB test" and choses IT department (custom dropdown field).

A mail notification has been sent to UserB's email address. As a result, the actual content of the notification displays as "test" without including the custom field "IT Department".

Is there any way to show custom dropdown fields in that message that was sent to UserB?

Maybe I can do it with Meta keys?

Screenshot 13
Screenshot 12

 


 
Posted : 07/10/2022 2:52 pm
Asti
 Asti
(@asti)
Posts: 8260
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Thank you for the clarification @validhan,

I'm going to ask the developers if there is a solution we can provide you. I'll update this topic once I get some news for you. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 07/10/2022 3:18 pm
Validhan reacted
(@validhan)
Posts: 6
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hi @asti Maybe you can help me with alternative solution.

How can I copy value from dropdown once I select it to comment area as text?

Maybe you can show me code on how to copy dropdown value to comment area once I select it? For example if I select IT department I want it to appear in comment text area like: Comment section( "IT Department:"...comment ...)

Screenshot 14

 


 
Posted : 10/10/2022 1:15 pm
Asti
 Asti
(@asti)
Posts: 8260
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@validhan,

The previous option is easier. We'll provide you a solution with the next version of the wpDiscuz plugin. Please wait for the next update. I'll update this topic with the new hook-code. So the mail will include the value of the custom field. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 10/10/2022 1:34 pm
(@validhan)
Posts: 6
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hi @asti There's an update

Comments – wpDiscuz v7.5 – 12.10.2022

But I custom fields still does not appear in Email


 
Posted : 13/10/2022 2:11 pm
Asti reacted
Asti
 Asti
(@asti)
Posts: 8260
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@validhan,

Please follow the steps below: 

1. Put the following hook code in the functions.php file of the active theme:

add_filter('comment_notification_text', function($notify_message, $comment_ID){
	$customFiled = get_comment_meta($comment_ID, 'key',  true);
	if($customFiled){
		$notify_message .= "\n" ;
		$notify_message .= "Department : " . $customFiled;
	}
	return $notify_message;
}, 9, 2);

This instruction should be helpful for you: https://www.wpbeginner.com/plugins/how-to-easily-add-custom-code-in-wordpress-without-breaking-your-site/

2. Replace the red-marked "key" value with the custom field's meta key. This video shows how to get the meta key of the custom field: 

3. The red-marked "Department" phrase also can be changed as you like. 


In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 13/10/2022 2:25 pm
(@validhan)
Posts: 6
Active Member
Topic starter
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

Hi @asti  Thanks for all information and hook code. I test it on my wordpress but unfortunately it does not worked. I even tried to implement it on new installed wordpress with only WPDiscuz plugin but still it does not work as well.

Please can you check and test the code again if it is correct.

Note please I tried to implement it directly from functions.php and plugin that you suggested as well. I even tried to specify my own meta key value for custom field and put it into key  field. 

Please can you provide some solution.


 
Posted : 17/10/2022 11:27 am
Asti
 Asti
(@asti)
Posts: 8260
Illustrious Member Support
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

@validhan,

We've checked it several times, it works fine. Please see the screenshot: 

image

In case you want to say thank you! 🙂
We'd really appreciate if you leave a good review on the plugin page.
This is the best way to say thank you to this project and the support team.

 
Posted : 17/10/2022 12:10 pm
(@zohan)
Posts: 2
New Member
Translate
English
Spanish
French
German
Italian
Portuguese
Russian
Chinese
Japanese
Korean
Arabic
Hindi
Dutch
Polish
Turkish
Vietnamese
Thai
Swedish
Danish
Finnish
Norwegian
Czech
Hungarian
Romanian
Greek
Hebrew
Indonesian
Malay
Ukrainian
Bulgarian
Croatian
Slovak
Slovenian
Serbian
Lithuanian
Latvian
Estonian
 

I'm also in similar situation and wondering perfect answer about it. I get lot of ans through peoples and internet but all are useless. But thanks to all you guys for giving best answer according this issue.


 
Posted : 13/02/2023 8:25 pm
Asti reacted