Multiple e-mail templates for one action?


recently our Editor-in-Chief has to deal with quite a number of papers being withdrawn. Our workflow for dealing with a withdrawal request is basically the same as when handling an unsuitable submission:

  • Go to Submission Summary page
  • Use Reject and Archive link, a pre-defined e-mail is displayed
  • Delete the pre-defined template text (which normally explains the reasons why the manuscript is considered unsuitable)
  • Open a text editor and copy-and-paste another pre-defined text stating that the submission has been archived and is considered withdrawn.

The last two steps are not very user friendly and for a moment I was considering merging both templates and asking the EiC to always delete the part that does not apply - but then I am pretty sure that sooner or later the EiC will send the full e-mail without editing.

Hence my two questions:

  • Is there another, better way how to deal with this issue?
  • Is it possible to extend OJS to be able to handle more than a single e-mail template for one action? If it is not too complicated, could someone point me to places that would require patching/editing to add a dropdown menu that would in turn use AJAX to fetch the appropriate template text from the database?



Hi @jprk,

OJS doesn’t have a facility for this out of the box, but you should be able to hack something in fairly quickly. I’d suggest something like this…

OJS uses a single email template form for almost all of its email templates. So when you modify its behavior, you’ll need to ensure you’re only affecting the use cases you want to. The template is lib/pkp/templates/email/email.tpl.

On the PHP side, the function you’re looking for is in classes/submission/sectionEditor/ in the emailEditorDecisionComment function.

I’d suggest adding a dropdown and a little bit of Javascript to the email.tpl template that, when PHP supplies it, permits the user to choose text from the dropdown and have it populate the email body field.

On the PHP side, you’d just need to fetch a list of templates and assign them to the template manager.

If you make the template behavior conditional on the presence of data available to it, then nothing would change for other uses of that template file.

Alec Smecher
Public Knowledge Project Team