post_author); $author = anno_user_display($author); if (!empty($single_user->ID)) { $single_user_id = $single_user->ID; } else { $single_user_id = $single_user; } if (!empty($single_user)) { $single_user = anno_user_display($single_user); } // Used in determining a user's recommendation $authors = anno_get_authors($post->ID); $author_names = array_map('anno_user_display', $authors); $edit_link = get_edit_post_link($post->ID, null); $title = $post->post_title; $excerpt = strip_tags($post->post_excerpt ? $post->post_excerpt : $post->post_content); if (strlen($excerpt) > 255) { $excerpt = substr($excerpt,0,252) . '...'; } $reviewer_instructions = _x('To review this article, please visit the URL above and navigate to the Reviews section. You may leave comments and questions in this section as well as providing a general review of \'Approve\', \'Reject\' or \'Request Revisions\' from the dropdown.', 'Instructions sent to reviewers via email notification', 'anno'); $notification = array('subject' => '', 'body' => ''); switch ($type) { // Status change to: submitted case 'submitted': $notification = array( 'subject' => sprintf(_x('New Submission: %s by %s.', 'Email notification subject', 'anno'), $title, $author), 'body' => sprintf(_x( 'The following article has been submitted for review: -------------------- Title: %s Author(s): %s Excerpt: %s %s %s', 'Email notification body', 'anno'), $title, implode(',', $author_names), $excerpt, $edit_link, $footer) ); break; // Status change to: in_review from submitted case 'in_review': $notification = array( 'subject' => sprintf(_x('%s now in review.', 'Email notification subject', 'anno'), $title), 'body' => sprintf(_x( 'Review has begun for: %s %s %s', 'Email notification body', 'anno'), $title, $edit_link, $footer) ); break; // Status change to: in_review from draft (revisions have occured) case 're_review': $notification = array( 'subject' => sprintf(_x('%s now in review.', 'Email notification subject', 'anno'), $title), 'body' => sprintf(_x( 'Revisions have been made for %s and we ask you to please re-review the article. %s %s', 'Email notification body', 'anno'), $title, $edit_link, $footer), ); break; // Status change to: approved case 'approved': $notification = array( 'subject' => sprintf(_x('%s review is complete. APPROVED.', 'Email notification subject', 'anno'), $title), 'body' => sprintf(_x( 'Thank you for your contribution to %s. We are pleased to inform you that the article, %s, has been approved! You will receive an additional notification when the article is published. Thank you. %s', 'Email notification body', 'anno'), $title, $title, $footer), ); break; // Status change to: rejected case 'rejected': $notification = array( 'subject' => sprintf(_x('%s review is complete.', 'Email notification subject', 'anno'), $title), 'body' => sprintf(_x( 'Thank you for contributing to %s. After our review process, we have decided not to accept the article at this time. -------------------- Title: %s %s %s', 'Email notification body', 'anno'), $title, $title, $edit_link, $footer), ); break; // Status change to: draft (from in_review) case 'revisions': $notification = array( 'subject' => sprintf(_x('%s review is complete. CHANGES REQUESTED.', 'Email notification subject', 'anno'), $title), 'body' => sprintf(_x( 'Thank you for contributing to %s. After reviewing your article, we would like to request some changes. Please open the article here: %s and refer to the comments listed. Once you have updated your submission in accordance with the comments, please resubmit your article. Thank you. %s', 'Email notification body', 'anno'), $title, $edit_link, $footer), ); break; // Status change to: published case 'published': $notification = array( 'subject' => sprintf(_x('%s has been published.', 'Email notification subject', 'anno'), $title), 'body' => sprintf(_x( 'The following article has been published: %s %s %s', 'Email notification body', 'anno'), $title, $edit_link, $footer) ); break; case 'reviewer_added': $notification = array( 'subject' => sprintf(_x('%s has been invited to review %s by %s', 'Email notification subject', 'anno'), $single_user, $title, $author), 'body' => sprintf(_x( '%s has been invited to review the following article: -------------------- Title: %s Author(s): %s Excerpt: %s %s %s %s', 'Email notification body', 'anno'), $single_user, $title, implode($author_names), $excerpt, $edit_link, $reviewer_instructions, $footer), ); break; case 'co_author_added': $notification = array( 'subject' => sprintf(_x('%s has been invited to co-author %s by %s', 'Email notification subject', 'anno'), $single_user, $title, $author), 'body' => sprintf(_x( '%s has been invited to co-author %s by %s. %s %s', 'Email notification body', 'anno'), $single_user, $title, $author, $edit_link, $footer), ); break; case 'primary_author': $notification = array( 'subject' => sprintf(_x('%s is now the primary author on %s', 'Email notification subject', 'anno'), $author, $single_user), 'body' => sprintf(_x( '%s is now the primary author on %s. %s %s', 'Email notification body', 'anno'), $author, $title, $edit_link, $footer), ); break; case 'review_recommendation': global $anno_review_options; //Get user review $review_key = annowf_get_user_review($post->ID, $single_user_id); switch ($review_key) { // Translate here so the entire sentence can be a translated string instead of bits and pieces case 1: $action_text = sprintf(_x('%s has reviewed %s and has accepted the article for publication.', 'Email review action text', 'anno'), $single_user, $title); break; case 2: $action_text = sprintf(_x('%s has reviewed %s and has rejected the article for publication.', 'Email review action text', 'anno'), $single_user, $title); break; case 3: $action_text = sprintf(_x('%s has reviewed %s and has requested revisions be made to the article prior to publication.', 'Email review action text', 'anno'), $single_user, $title); break; default: $action_text = ''; break; } $notification = array( 'subject' => sprintf(_x('%s has reviewed %s', 'Email notification subject', 'anno'), $single_user, $title), 'body' => sprintf(_x( '%s %s %s', 'Email notification body', 'anno'), $action_text, $edit_link, $footer), ); break; default: break; } if (!empty($comment)) { $comment_author = anno_user_display($comment->user_id); $comment_edit_link = get_edit_post_link($comment->comment_post_ID, null).'#comment-'.$comment->comment_ID; switch ($type) { case 'general_comment': $notification = array( 'subject' => sprintf(_x('New internal comment on %s', 'Email notification subject', 'anno'), $title), 'body' => sprintf(_x( 'The following comment was submitted on %s by %s. -------------------- %s -------------------- %s %s', 'Email notification body', 'anno'), $title, $comment_author, $comment->comment_content, $comment_edit_link, $footer), ); break; case 'review_comment': $notification = array( 'subject' => sprintf(_x('New reviewer comment on %s', 'Email notification subject', 'anno'), $title), 'body' => sprintf(_x( 'The following comment was submitted on %s by %s. -------------------- %s -------------------- %s %s', 'Email notification body', 'anno'), $title, $comment_author, $comment->comment_content, $comment_edit_link, $footer), ); break; default: break; } } return apply_filters('annowf_notfication', $notification, $type, $post, $comment); } ?>