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?

Hi,

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.

Hi,

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

Hi,

Please try this PHP snippet:

add_action(
 'hivepress/v1/emails/listing_submit/send',
 function($email){
  $user_id = get_current_user_id();
  
  if(!$user_id){
   return;
  }
  
  $user = \HivePress\Models\User::query()->get_by_id($user_id);
  
  if(!$user || !$user->get_email()){
   return;
  }
  
  wp_mail($user->get_email(), 'Custom subject', 'Custom text');
 },
 1000
);

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?

Hi,

Please use the Code Snippets plugin to add and manage custom PHP code snippets Code Snippets – WordPress plugin | WordPress.org
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?

Hi,

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 https://fvrr.co/32e7LvY