title = __('Google Reviews', 'notificationx'); $this->module_title = __('Google Reviews', 'notificationx'); $this->themes = [ 'total-rated' => [ 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/wporg/total-rated.png', 'image_shape' => 'square', 'show_notification_image' => 'greview_icon', 'template' => [ 'first_param' => 'tag_rated', 'custom_first_param' => __('Someone', 'notificationx'), 'second_param' => __('people rated', 'notificationx'), 'third_param' => 'tag_place_name', 'custom_third_param' => __('Anonymous Place', 'notificationx'), 'fourth_param' => 'tag_rating', 'custom_fourth_param' => __('Some time ago', 'notificationx'), ], ], 'reviewed' => [ 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/wporg/reviewed.png', 'image_shape' => 'circle', 'show_notification_image' => 'greview_avatar', 'template' => [ 'first_param' => 'tag_username', 'custom_first_param' => __('Someone', 'notificationx'), 'second_param' => __('just reviewed', 'notificationx'), 'third_param' => 'tag_place_name', 'custom_third_param' => __('Anonymous Place', 'notificationx'), 'fourth_param' => 'tag_rating', 'custom_fourth_param' => __('Some time ago', 'notificationx'), ] ], 'review-comment' => [ 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/wporg/review-with-comment.jpg', 'image_shape' => 'rounded', 'show_notification_image' => 'greview_avatar', 'template' => [ 'first_param' => 'tag_username', 'custom_first_param' => __('Someone', 'notificationx'), 'second_param' => __('just reviewed', 'notificationx'), 'third_param' => 'tag_place_review', 'custom_third_param' => __('Anonymous Place', 'notificationx'), 'fourth_param' => 'tag_time', 'custom_fourth_param' => __('Some time ago', 'notificationx'), ] ], 'review-comment-2' => [ 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/wporg/review-with-comment-2.jpg', 'image_shape' => 'circle', 'show_notification_image' => 'greview_avatar', 'template' => [ 'first_param' => 'tag_username', 'custom_first_param' => __('Someone', 'notificationx'), 'second_param' => __('just reviewed', 'notificationx'), 'third_param' => 'tag_place_review', 'custom_third_param' => __('Anonymous Place', 'notificationx'), 'fourth_param' => 'tag_time', 'custom_fourth_param' => '', ] ], 'review-comment-3' => [ 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/wporg/review-with-comment-3.jpg', 'image_shape' => 'circle', 'show_notification_image' => 'greview_avatar', 'template' => [ 'first_param' => 'tag_username', 'custom_first_param' => __('Someone', 'notificationx'), 'second_param' => __('just reviewed', 'notificationx'), 'third_param' => 'tag_place_review', 'custom_third_param' => __('Anonymous Place', 'notificationx'), 'fourth_param' => 'tag_time', 'custom_fourth_param' => __('Some time ago', 'notificationx'), ] ], 'maps_theme' => array( 'is_pro' => true, 'source' => NOTIFICATIONX_ADMIN_URL . 'images/extensions/themes/pro/google-review-map.png', 'image_shape' => 'square', 'show_notification_image' => 'greview_map_image', 'template' => [ 'first_param' => 'tag_rated', 'custom_first_param' => __('Someone', 'notificationx'), 'second_param' => __('people rated', 'notificationx'), 'third_param' => 'tag_place_name', 'custom_third_param' => __('Anonymous Place', 'notificationx'), 'fourth_param' => 'tag_rating', 'custom_fourth_param' => __('Some time ago', 'notificationx'), ], ), ]; $this->templates = [ "{$this->id}_template_new" => [ 'first_param' => [ 'tag_username' => __('Username', 'notificationx'), 'tag_rated' => __('Rated', 'notificationx'), ], 'third_param' => [ 'tag_place_name' => __('Place Name', 'notificationx'), 'tag_place_review' => __('Review', 'notificationx'), ], 'fourth_param' => [ 'tag_rating' => __('Rating', 'notificationx'), 'tag_time' => __('Definite Time', 'notificationx'), ], '_themes' => [ "{$this->id}_maps_theme", "{$this->id}_total-rated", "{$this->id}_reviewed", "{$this->id}_review-comment", "{$this->id}_review-comment-2", "{$this->id}_review-comment-3", ], ], ]; $this->popup = [ "denyButtonText" => __("More Info", "notificationx"), "confirmButtonText" => __("Upgrade to PRO", "notificationx"), "html"=> __(' Google reviews provide helpful information and make your business stand out. ', 'notificationx') ]; } public function preview_entry($entry, $settings){ if($settings['show_notification_image'] === "greview_icon" ){ $entry = array_merge($entry, [ "image_data" => [ "url" => "https://maps.gstatic.com/mapfiles/place_api/icons/v1/png_71/generic_business-71.png", "alt" => "", "classes" => "greview_icon" ], ]); } return $entry; } public function doc(){ $url = admin_url('admin.php?page=nx-settings&tab=tab-api-integrations#google_reviews_settings_section'); return sprintf(__('
Make sure that you have configured your Google Reviews API key, to showcase your reviews. For further assistance, check out our step by step documentation.
👉NotificationX Integration with Google Reviews.
', 'notificationx'), $url, 'https://notificationx.com/docs/collect-api-key-from-google-console', 'https://notificationx.com/docs/google-reviews-with-notificationx/' ); } }