OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



adding ms # to email templates

Are you responsible for making OJS work -- installing, upgrading, migrating or troubleshooting? Do you think you've found a bug? Post in this forum.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
What to do if you have a technical problem with OJS:

1. Search the forum. You can do this from the Advanced Search Page or from our Google Custom Search, which will search the entire PKP site. If you are encountering an error, we especially recommend searching the forum for said error.

2. Check the FAQ to see if your question or error has already been resolved.

3. Post a question, but please, only after trying the above two solutions. If it's a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a development question, try the OJS Development subforum.

adding ms # to email templates

Postby jmir » Wed Aug 01, 2007 11:47 am

Is there a solution (a variable, or a patch) for adding the ms # to the subject lines of email templates? Ideally I'd like to be able to see the manuscript number in the subject line, e.g. [JMIR ms #936] ...
jmir
 
Posts: 74
Joined: Mon Feb 26, 2007 12:16 am

Re: adding ms # to email templates

Postby asmecher » Wed Aug 01, 2007 1:34 pm

Hi Gunther,

If you patch your installation with http://pkp.sfu.ca/cvs/cvsweb.cgi/ojs2/classes/mail/ArticleMailTemplate.inc.php.diff?r1=1.22;r2=1.23 (which will be shipped with OJS 2.2), you'll be able to use the {$articleId} variable in any email relating to an article.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8597
Joined: Wed Aug 10, 2005 12:56 pm

Re: adding ms # to email templates

Postby jmir » Thu Aug 02, 2007 8:41 am

Very good, that helps and works.

Is there a way to fiddle the articleId# to the email where it matters most, which is the editor to author email (notify author)? There is no template here, so I'll have to patch the OJS source directly, but couldn't figure out so far where the subject line for this email defined. Which file do I have to patch and how?
jmir
 
Posts: 74
Joined: Mon Feb 26, 2007 12:16 am

Re: adding ms # to email templates

Postby asmecher » Thu Aug 02, 2007 9:21 am

Hi Gunther,

Find the emailEditorDecisionComment function in classes/submission/sectionEditor/SectionEditorAction.inc.php. Near the top, you'll see a line like:
Code: Select all
$email = &new ArticleMailTemplate($sectionEditorSubmission);
This creates a blank email template. If you want to fetch a template by name, change that line to:
Code: Select all
$email = &new ArticleMailTemplate($sectionEditorSubmission, 'EMAIL_TEMPLATE_NAME_GOES_HERE');
...where, of course, EMAIL_TEMPLATE_NAME_GOES_HERE should be the appropriate email template key that you've created in the Journal Manager's "Prepared Emails" page.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8597
Joined: Wed Aug 10, 2005 12:56 pm

Re: adding ms # to email templates

Postby jmir » Fri Aug 03, 2007 3:01 am

asmecher wrote:Find the emailEditorDecisionComment function in classes/submission/sectionEditor/SectionEditorAction.inc.php.


I did this, but it works only "half". The correct email template is used, but the subject line still remains to be the article title, which is what I need to change (our standard subject line should be something like "JMIR ms#....: Editorial Decision", rather than the article title.

I saw the line of code which sets the subject with the article title - commenting out this line seems to work (subject line of email template is used), but are there any adverse side effects?
jmir
 
Posts: 74
Joined: Mon Feb 26, 2007 12:16 am

Re: adding ms # to email templates

Postby jmir » Fri Aug 03, 2007 5:58 am

I now realize that it does NOT work - the variables are not replaced. The subject line reads "[JMIR] JMIR ms#{$articleId}: Editorial Decision ("{$articleTitle}") " - and this is exactly how the email went to the author, without filling in the values for variables (how emarrassing!). Argh..

jmir wrote:
asmecher wrote:Find the emailEditorDecisionComment function in classes/submission/sectionEditor/SectionEditorAction.inc.php.


I did this, but it works only "half". The correct email template is used, but the subject line still remains to be the article title, which is what I need to change (our standard subject line should be something like "JMIR ms#....: Editorial Decision", rather than the article title.

I saw the line of code which sets the subject with the article title - commenting out this line seems to work (subject line of email template is used), but are there any adverse side effects?
jmir
 
Posts: 74
Joined: Mon Feb 26, 2007 12:16 am

Re: adding ms # to email templates

Postby asmecher » Fri Aug 03, 2007 9:16 am

Hi Gunther,

You also need to add a call to $mail->assignParams(); near where you commented out the setSubject function.

Regards,
Alec Smecher
Public Knowledge Project Team
asmecher
 
Posts: 8597
Joined: Wed Aug 10, 2005 12:56 pm


Return to OJS Technical Support

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 2 guests

cron