Edit notificationContents template

Hi! I’m using OJS 3.3.0.6 as Journal Manager.

An Editor-in-chief ask to me if it’s possible to edit the Notification email received when a new paper is submitted. This one:

You have a new notification from {$siteTitle}:

{$notificationContents}

Link: {$url}

{$principalContactSignature}

Usually the $notificationContents is something like: A new article has been submitted to which an editor needs to be assigned.

He’d like to read in this email the author’s name and the submission’s title and abstract. For me it’s a good idea because he could, for example, read the abstract from his phone on the bus and assign it to a section editor later, in the office. The actual email is, in my opinion, too generic to be useful for real.

I tried to add some variable as {$authorName} or {$submissionTitle} in the email template, but they aren’t read as codes and they wasn’t replaced.

Is there a way to edit the $notificatonContents message? If yes, is there a way to edit the $notificatonContents message without change the php code? :grinning_face_with_smiling_eyes:

Hi @Michevole,

Good question! I spoke with one of our developers who said:

I think that one would require code editing. That’s a generic template that just injects a message. Wherever it is used we want to replace it with a proper notification.

So, modifying this would indeed require some code modification. If you do manage to do it and could share in this post, that would be appreciated.

Best regards,

Roger
PKP Team

Thanks @rcgillis for the previous reply.
I took my time but now I’m coming back with the result. I share it here, if it could interest someone else.

I noticed that some notifications already contained submission’s title, so I found the file that managed this reference and I added two new calls to the abstract and the author’s name too.

The file is: /lib/pkp/classes/notification/managerDelegate/SubmissionNotificationManager.inc.php
I edited the rows from 36 to 44 in this way:

		switch ($notification->getType()) {
			case NOTIFICATION_TYPE_SUBMISSION_SUBMITTED:
				return __('notification.type.submissionSubmitted', array('title' => $submission->getLocalizedTitle(), 'abstract' => $submission->getLocalizedAbstract(), 'author' => $submission->getAuthorString()));
			case NOTIFICATION_TYPE_METADATA_MODIFIED:
				return __('notification.type.metadataModified', array('title' => $submission->getLocalizedTitle()));
			case NOTIFICATION_TYPE_SUBMISSION_NEW_VERSION:
				return __('notification.type.submissionNewVersion');
			case NOTIFICATION_TYPE_EDITOR_ASSIGNMENT_REQUIRED:
				return __('notification.type.editorAssignmentTask', array('title' => $submission->getLocalizedTitle(), 'abstract' => $submission->getLocalizedAbstract(), 'author' => $submission->getAuthorString()));

(Actually I just added two items in row 38 and 44, but to avoid punctuation problems I suggest to copy and paste the entire section).

Now I got the {$title}, {$abstract} and {$author} variables for my notifications, but I had to insert them in the messages. So I edited the /locale/en_US/locale.po file, and namely the notification.type.submissionSubmitted and notification.type.editorAssignmentTask entries. If you’re not interested in change it for all your journals you can use the evergreen Custom Locale Plugin and it works only for one journal.

I can’t share the complete message because I actually edited it in Italian language for my journals’ editors. Now it’s done!

There’s just a downside: these messages are the same for the editor’s mail (my goal) and the notification center (the window you can read clicking on the bell in the dashboard’s top right corner). Then you can easily read the submission’s abstract in the mail you received, but there isn’t enough space to contain it in the notification center, so the message is interrupted. To me it’s ok, but maybe not for everyone.

I hope it could be useful for someone. Best regards!

1 Like

This topic was automatically closed after 12 days. New replies are no longer allowed.