Forum Replies Created

Viewing 14 replies - 1 through 14 (of 14 total)
  • Thread Starter no10design

    (@no10design)

    Many thanks for your help and really fast response. I really appreciate it.

    Would that just mean adding the custom code on this page to the custom review template?:

    https://developer.ww.wp.xz.cn/reference/functions/do_shortcode/

    Thread Starter no10design

    (@no10design)

    Many thanks! I’m going try each of those changes this week and will let you know the results 🙂

    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.

    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.

    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, 9 months ago by no10design.
    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)

    /**
     * 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 );
    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, 9 months ago by Jan Dembowski.
    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

    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, 9 months ago by no10design.
    Thread Starter no10design

    (@no10design)

    Thank you. That really helps.

    Thread Starter no10design

    (@no10design)

    Thank you so much for your amazing reply. I really appreciate it and the amazing work you’ve done on this plugin. I will give each of your solutions a try.

    Is there an estimated time for the add-ons for v3? Really excited to see it 🙂

    Thread Starter no10design

    (@no10design)

    Thank you Harish. Very much appreciate all your help. I will test that now and send a reply asap. Many thanks again for your great support and for creating a great plugin.

    Thread Starter no10design

    (@no10design)

    Hi,

    Is anyone able to help?

Viewing 14 replies - 1 through 14 (of 14 total)