• Resolved maryhellen

    (@maryhellen)


    Hi, First thing first: This plugin is awesome!
    My question: is it possible to add another notification template tag that displays post/page title? In this way is simpler for my client to know which page a review refer to – before approval and manually assign to the correct one (not everyone mentions the course name in the review). I know there is an option to display assigned links, but i’d like my client can see the page title (which is, by the way, the same as the name of the course) directly on the notification email. Thanks a lot.

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

    (@geminilabs)

    @maryhellen

    If you can wait for a few days, I’ll add a way to do this via a filter hook in the next release.

    Plugin Author Gemini Labs

    (@geminilabs)

    @maryhellen

    After looking into it further, this probably will not be available until v5.0

    Until then, the following should work:

    /**
     * Adds the {review_assigned_to_title} and {review_assigned_to_link} notification tags
     * @param array $email
     * @return array
     */
    add_filter('site-reviews/email/compose', function ($email) {
        if (!isset($email['template-tags']['review_link'])) {
            return $email;
        }
        $reviewLink = $email['template-tags']['review_link'];
        $reviewId = preg_match('/\?post=(\d+)&/', $reviewLink, $matches);
        if (!empty($matches[1])) {
            $review = glsr_get_review($matches[1]);
            $email['template-tags']['review_assigned_to_link'] = get_permalink($review->assigned_to);
            $email['template-tags']['review_assigned_to_title'] = get_the_title($review->assigned_to);
        }
        return $email;
    });
    
    Thread Starter maryhellen

    (@maryhellen)

    Thanks. I’ll waiting. Thanks again.

    Plugin Author Gemini Labs

    (@geminilabs)

    Okay. FYI: v5.0 will be a week or two until it’s released.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Add a custom notification template tag’ is closed to new replies.