• Resolved no10design

    (@no10design)


    Hi,

    Firstly, credit where it’s due – this has to be hands down one of the best plugins ever created. Like many others, I’ve used 1000s of plugin on WordPress sites and know the difference between good and bad ones. This plugin you’ve created is not only simple to use, but also does an amazing job with ease. Fantastic work and a great achievement you should be very proud of.

    I am hoping for some help on a few questions I had and to ideally make this amazing plugin even more fantastic for use on my website.

    1. Is there a way of enabling a notifications system for the plugin whereby (1) an email is sent to the reviewer immediately after they submit a review and as a double opt-in to verify the users email address and (2) an automatic email to the reviewer once a response is submitted from the back-end?

    2. The code snippets advice you had for another reviewer was fantastic. I’m now able to edit the contents of a review.

    3. Is it possible to have custom review submission forms for different pages and with different fields?

    4. Is there a way to introduce ‘Login via Facebook or Sign up with Email’ before a user can complete the review form?

    5. Is it possible to manually edit the name that appears in ‘Response from…’ in the front-end when showing a reply and using custom fields? Also, is it possible to add a author image to a reply/response? I know the response name is taken from the user logged in name, but it would be great if it was possible to just manually change it as an admin in the back-end.

    6. Is it possible to include drop-down menus in the review form?

    I think that’s it with the main questions I had. Thank you in advance for your help and again for creating such an amazing plugin.

    NP

Viewing 15 replies - 1 through 15 (of 18 total)
  • Plugin Author Gemini Labs

    (@geminilabs)

    1a. To send a notification to the review author when a new review is submitted: https://pastebin.com/1tjXdkhB

    1b. To send a notification to the review author when their review has been approved (if you have the “Require Approval” setting enabled): https://pastebin.com/ykZSBH2N

    1c. To send a notification to the review author after responding to their review: https://pastebin.com/AQNgCwNv

    3. Use the hide option in the [site_reviews_form] shortcode. Please see the “Site Reviews > Documentation > Shortcodes” page for more information.

    4. You can show the submission form to registered users, and use a third-party Facebook login plugin for visitors. Please see: https://pastebin.com/EcZ0bmF0

    5. The response uses your website name, not the logged-in user name. To modify the HTML: https://pastebin.com/H0yNUizV

    6. Please see: https://pastebin.com/4fvKErcp

    Thread Starter no10design

    (@no10design)

    Thank you so much for those amazing answers and the quick response! I will go through the information send over the next 24hrs and will come back to you asap if I have any more questions.

    Thank you again!

    • This reply was modified 6 years, 10 months ago by no10design.
    Thread Starter no10design

    (@no10design)

    Hi,

    Sorry to bother you again. I’ve just got a small issue. I successfully followed your instructions at https://pastebin.com/AQNgCwNv for sending a notification to the review author once a response is submitted. The email gets sent successfully but for some reason it is sent twice in identical form, however one is sent with the review response and the other without the review response. Is there something that would be causing this duplicate issue?

    I have added successfully added the code using the code snippets plugin.

    Many thanks!

    NP

    Plugin Author Gemini Labs

    (@geminilabs)

    It works correctly for me.

    Have you copy/pasted exactly as given?

    Try changing the subject line to see if you have duplicated the function elsewhere. Also, select “Only run in administration area” in the snippet (although this really shouldn’t affect the result).

    • This reply was modified 6 years, 10 months ago by Gemini Labs.
    Thread Starter no10design

    (@no10design)

    The code I used was as follows. I can’t seem to find where the issue could be.

    
    /**
     * Send an email notification to the review author after responding to a review
     * This will only send an email if the response value was previously empty.
     * Paste this in your active theme's functions.php file.
     * @param int $metaId
     * @param int $postId
     * @param string $metaKey
     * @param mixed $metaValue
     * @return void
     */
    add_action( 'update_postmeta', function( $metaId, $postId, $metaKey, $metaValue ) {
        $review = apply_filters( 'glsr_get_review', null, $postId );
        if( empty( $review->ID ) || !empty( $review->response ) || $metaKey != 'response' )return;
        $from = get_option( 'admin_email' );
        $to = $review->email;
        $subject = sprintf( 'Reply to your review', $review->author );
        $message = "Hi, \n\n Congratulations, your recent review submitted. \n\n
    Review Response:\n\n
    $metaValue \n\n
    You can respond directly to your review by emailing [email protected]. Your reply will be sent directly and for them to respond to you by email.\n\n
    Would you like to revise your review and rating? Please get in touch with our team at [email protected].\n\n
    Best Regards, \n\n"
       ; $headers = ['from: '.$from, 'reply-to: '.$from];
        if( !( wp_mail( $to, $subject, $message, $headers ))) {
            apply_filters( 'glsr_log', null, 'The email notification for your response was not sent. Please verify that your server is able to send emails correctly through Review Your Politician.' );
        }
    }, 10, 4 );
    
    • This reply was modified 6 years, 10 months ago by Jan Dembowski.
    Plugin Author Gemini Labs

    (@geminilabs)

    Please use the code button on the editor when pasting php code.

    Plugin Author Gemini Labs

    (@geminilabs)

    You can do this in two ways:

    1. Select the text first then press the code button
    2. Or, press the code button, paste your text, then press the /code button again to finish.

    Thread Starter no10design

    (@no10design)

    /**
     * Send an email notification to the review author after responding to a review
     * This will only send an email if the response value was previously empty.
     * Paste this in your active theme's functions.php file.
     * @param int $metaId
     * @param int $postId
     * @param string $metaKey
     * @param mixed $metaValue
     * @return void
     */
    add_action( 'update_postmeta', function( $metaId, $postId, $metaKey, $metaValue ) {
        $review = apply_filters( 'glsr_get_review', null, $postId );
        if( empty( $review->ID ) || !empty( $review->response ) || $metaKey != 'response' )return;
        $from = get_option( 'admin_email' );
        $to = $review->email;
        $subject = sprintf( 'Reply to your review', $review->author );
        $message = "Hi, \n\n Congratulations, your recent review submitted has received a response. \n\n
    Review Response:\n\n
    $metaValue \n\n
    You can respond directly to your review by emailing [email protected]. Your reply will be sent directly and for them to respond to you by email.\n\n
    Would you like to revise your review and rating? Please get in touch with our team at [email protected].\n\n
    Best Regards, \n\n"
       ; $headers = ['from: '.$from, 'reply-to: '.$from];
        if( !( wp_mail( $to, $subject, $message, $headers ))) {
            apply_filters( 'glsr_log', null, 'The email notification for your response was not sent. Please verify that your server is able to send emails correctly through Review Your Politician.' );
        }
    }, 10, 4 );
    Plugin Author Gemini Labs

    (@geminilabs)

    @no10design

    The code above is intended to notify someone when you have added a response to their existing review. It is not intended (and will not work) for new review submissions.

    Since you are using the snippets plugin, the recommended way to troubleshoot this is:

    1. Disable all snippets.
    2. Submit a new review.
      There should NOT be any email notification sent to the review email.
    3. Edit the review you submitted and add a response.
      There should NOT be any email notification sent to the review email.
    4. Enable only the snippet above
    5. Submit a new review.
      There should NOT be any email notification sent to the review email.
    6. Edit the review you submitted and add a response.
      There SHOULD be exactly 1 email notification sent to the review email.
    7. Edit your response.
      There should NOT be any email notification sent to the review email.

    Can you confirm this?

    Thread Starter no10design

    (@no10design)

    Hi,

    Many thanks. Does that mean I’m not able to have two rules using https://pastebin.com/1tjXdkhB and https://pastebin.com/AQNgCwNv together so that a user receives an email first to say thank you for submitting a review and then another email after they receive a response? Is there any way to allow both these rules to exist?

    Thread Starter no10design

    (@no10design)

    I tried uploading an email using the email address e.g. [email protected]. The user then receives a message to say thank you. Then, when I add a response to the review in the dashboard, the user receives at e.g. [email protected] to say they’ve received a response.

    • This reply was modified 6 years, 10 months ago by no10design.
    Plugin Author Gemini Labs

    (@geminilabs)

    Yes. If you are using both codes, then the first one sends a notification only when a new review is submitted. The second, only when you respond to an existing review.

    Thread Starter no10design

    (@no10design)

    Hi sorry if there was confusion. I have setup and added the two codes, it is only with the https://pastebin.com/AQNgCwNv that the reviewer gets a duplicate message. The first notification is fine.

    Plugin Author Gemini Labs

    (@geminilabs)

    So you followed the 7 steps above and the results were different than each step said they should be?

    Thread Starter no10design

    (@no10design)

    Unfortunately yes. I followed the 7 steps, disabling the first ‘Thank You’ email after submitting a review. I have only enabled the ‘send email after responding to a review’ code in snippets. The notification again gets sent successfully to the user, but is sent twice, once with the response and one without the response. That is the only difference in the email and otherwise identical. Very strange issue!

    Thank you so much for your amazing support on this and to find the issue. I really appreciate it.

Viewing 15 replies - 1 through 15 (of 18 total)

The topic ‘Email Notifications + Other Features’ is closed to new replies.