Email notification for paid listing confirmation and listing submission

How do I make that after buying a paid listing package the user should receive an email with the information?
How do i make that after submitting a Listing (when it goes to the admin to approve) the user should receive an email notification?


Unfortunately, there are no such email events, it would require a custom implementation.

But you can use other email events when the listing is rejected or approved, also, you can customize the final message page, for example, the listing submitted page.

do you mind to explain, thanks

if you anyway have the event trigger of “listing submitted” that sends an email to the admin why not enable it for the sender too, I think there is quite a demand for it on the threads.


Currently, there is no such feature because we do not send a message to the person who initiates the action, when the user has successfully created his listing, the last page will display the text “Thank you, your listing is submitted.”

Also, you can try to create a code snippet using the hook of this email event.

Can you share such a snippet? thanks


Please try this PHP snippet:

  $user_id = get_current_user_id();
  $user = \HivePress\Models\User::query()->get_by_id($user_id);
  if(!$user || !$user->get_email()){
  wp_mail($user->get_email(), 'Custom subject', 'Custom text');

Please note that you may require additional customizations in the future.

Thank you so much,
Should I just paste this snippet into the code snippet plugin and edit the ‘custom subject’ and ‘custom text’?
in the custom text can I include tokens the same way I do it in the email settings?


Please use the Code Snippets plugin to add and manage custom PHP code snippets Code Snippets – WordPress plugin |
Also, you can check this doc How to add custom code snippets - HivePress Help Center

thanks, I did so, but nothing is showing up and no email is being sent, do i need to add anything?


We checked this snippet from our side, and it seems okay.

Please ensure that you add this snippet to Code Snippets plugin, as shown in the screenshot Awesome Screenshot. You can check your spam folder in your mail too.

Also, please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, ensure that caching is disabled for logged-in users.

Please note that this is a sample and custom snippet it is behind our scope, so in the future, you may need additional customizations.
If customizations are required for your site, please try customizing it using the collection of code snippets Search · user:hivepress · GitHub and other developer resources, or consider hiring someone for custom work

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.