OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Custom email templates: how to use them?

Are you an Editor, Author, or Journal Manager in need of help? Want to talk to us about workflow issues? This is your forum.

Moderators: jmacgreg, michael, vgabler, John

Forum rules
This forum is meant for general questions about the usability of OJS from an everyday user's perspective: journal managers, authors, and editors are welcome to post questions here, as are librarians and other support staff. We welcome general questions about the role of OJS and how the workflow works, as well as specific function- or user-related questions.

What to do if you have general, workflow or usability questions about OJS:

1. Read the documentation. We've written documentation to cover from OJS basics to system administration and code development, and we encourage you to read it.

2. take a look at the tutorials. We will continue to add tutorials covering OJS basics as time goes on.

3. Post a question. Questions are always welcome here, but if it's a technical question you should probably post to the OJS Technical Support subforum; if you have a development question, try the OJS Development subforum.

Custom email templates: how to use them?

Postby mgscano » Thu Nov 12, 2009 4:22 am

Hi there, it's all in the subject ... I can create email templates, insert variables and so on, but then, it's not clear how to effectively MAKE USE of them.

How can a user (IE an Editor) recall a prepared email to use?

thanks
mgscano
 
Posts: 72
Joined: Tue Jan 27, 2009 3:22 am
Location: Brescia, Italy

Re: Custom email templates: how to use them?

Postby jmacgreg » Mon Nov 16, 2009 3:20 pm

Hi Marco,

I believe you can supply links to the prepared email using the email template call as part of a URL:

Code: Select all
http://pathToJournal/index.php/journal/user/email?template=CUSTOM_EMAIL_KEY


You should be able to use this kind of link to create hyperlinks, which can then be added anywhere OJS accepts HTML input in fields. If this doesn't suffice, you can embed the link in any given Smarty template, or probably do it a bit more intelligently with Smarty. Let us know if you need any further pointers.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: Custom email templates: how to use them?

Postby mgscano » Wed Nov 18, 2009 11:12 am

Okay, that was the fisrt thing I came out with, since in the Prepared emails page, there's a link made up exactly like that on the left of each line.
I just wondered if there was a way to make use of them without hard-coding, which would be another modification to carry on at every software update. I already have really too many.

The scenario is his: on the Submission Summary page, the Editor has the option to directly arhive an Unsuitable submission, and that's okay. But many many times the submissions are simply not compliant with the Guidelines, IE image files not in PMC suitable format.
So I just needed to provide the Editors a single-clic tool to just provide the author with the "typical image files format reminder", with links and precompiled text.

No other way to do that without recoding a bunch of core files?
mgscano
 
Posts: 72
Joined: Tue Jan 27, 2009 3:22 am
Location: Brescia, Italy

Re: Custom email templates: how to use them?

Postby jmacgreg » Sun Nov 22, 2009 5:21 pm

Hi Marco,

To do what you want, all you really need to do is add one line to /templates/sectionEditor/submission/status.tpl linking to the custom mail template, optionally as a message key that calls text from locale.xml. Otherwise, you could suggest that your editors use the email link beside the authors/submitter names at the top of the Summary page, but of course they wouldn't have the custom text then. I don't think there are any other possible solutions, but the code modification here is fairly minimal and easy to maintain.

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: Custom email templates: how to use them?

Postby iedge » Fri Apr 09, 2010 12:15 am

Have gone through the above thread but did not find much of use in my case.

For me I have made a template { http://ijict.org/index.php/ijoat/manage ... S_COMMENTS }

which I need the Editors to pass on to Author, as Editor's Decision

When the Editor is in Review Section ::
http://ijict.org/index.php/ijoat/editor ... nReview/27

under Heading { Editor Decision }
the eMail icon has href for { http://ijict.org/index.php/ijoat/editor ... ticleId=27 }

which leads to a blank eMail form page.

How can I populate it with http://ijict.org/index.php/ijoat/manage ... S_COMMENTS

??
iedge
 
Posts: 14
Joined: Sun Feb 14, 2010 10:46 pm

Re: Custom email templates: how to use them?

Postby mcrider » Thu Apr 15, 2010 5:10 pm

Hi ledge,

Well, I get an error when I click on the first link--you should resolve that before proceeding (btw, these URLs won't display much to us, as we don't have accounts). Anyways, this technique is not going to work if the user sending the email does not have a Journal Manager account. You'll need to modify the system to achieve what you want, by editing the emailEditorDecisionComment function in classes/submission/sectionEditor/SectionEditorAction.inc.php, and replacing the email template names (e.g. 'EDITOR_DECISION_ACCEPT') you want replaced with the name of your custom template.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Custom email templates: how to use them?

Postby iedge » Thu Apr 15, 2010 7:50 pm

Thanks Matt,

I am aware that you wont be able to see those links, since they require admin privileges.

Anyway I tried to make changes to emailEditorDecisionComment function in classes/submission/sectionEditor/SectionEditorAction.inc.php

original line was

$email = &new ArticleMailTemplate($sectionEditorSubmission);

which I changed to (in fact appended the new prepared email template)

$email = &new ArticleMailTemplate($sectionEditorSubmission, 'REVIEWERS_COMMENTS');

When Editor clicks on the eMail icon, the mail body now gets populated, :D (thanks a lot for that)

but now the issue is that {$authorName} and {$articleTitle} are not getting auto-populated. They remain as it is. i.e. $var is not converted to Values. Though the link (eMail icon) href is passing on the article id as (http://ijict.org/index.php/ijoat/editor ... ticleId=35)

Cheers
iEdge
iedge
 
Posts: 14
Joined: Sun Feb 14, 2010 10:46 pm

Re: Custom email templates: how to use them?

Postby mcrider » Fri Apr 16, 2010 3:27 pm

hi iedge,

You have to make sure those parameters are assigned to the email--see for example the call to $email->assignParams() (at line 1940 in my version of ojs)--this is assigning 'authorName', so i'm not sure why that's not getting populated in your email, but you'll also have to make sure any other variables you need in the email are assigned there.

Cheers,
Matt
mcrider
 
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Re: Custom email templates: how to use them?

Postby iedge » Fri Apr 16, 2010 10:18 pm

Matt :

You are genius. :idea: You just pin pointed to the right place. :D

Yes, the said function { emailEditorDecisionComment } was missing assignParams().

And this is juat what I did

$paramArray = array(
'authorName' => $authorUser->getFullName()
);
$email->assignParams($paramArray);

AND IT WORKED :P

Thanks once again

iEdge
iedge
 
Posts: 14
Joined: Sun Feb 14, 2010 10:46 pm

Re: Custom email templates: how to use them?

Postby jlaherty » Thu Oct 14, 2010 7:06 am

Hello,
I'm not a technical person but am wondering if there is an easy to understand step by step guide on how to create custom emails and attach them to specific workflows within the OJS system? In particular we need a form email for editors to use to decline submissions and the version we're on 2.2.2 does not include that form email.
If this requires some programming and database skills, I'll pass this on to our technical staff, but I'm hoping there is an easy way for a journal manager to add this.
Thank you!
Jennifer Laherty
jlaherty
 
Posts: 42
Joined: Mon Feb 16, 2009 1:15 pm

Re: Custom email templates: how to use them?

Postby jmacgreg » Fri Oct 15, 2010 3:52 pm

Hi Jennifer,

Unfortunately, there's no way to create *and* attach emails to particular workflows without at least a bit of programming. If you are looking for individual/custom email templates for the Editor Notification of Review emails in particular, I would encourage you to upgrade to 2.3.3-1, as those are included (although largely empty by default, and still need to be filled in via the Prepared Email interface, though no programming necessary).

Cheers,
James
jmacgreg
 
Posts: 4190
Joined: Tue Feb 14, 2006 10:50 am

Re: Custom email templates: how to use them?

Postby csabbah » Wed Sep 04, 2013 6:53 am

Hello,

I would like to use {$authorName} in the prepared emails REVIEW REQUEST.
I have tried the recipe to modify SectionEditorAction.inc.php by adding the first line in
$paramArray = array(
'authorName' => $authorUser->getFullName(),
'reviewerName' => $reviewer->getFullName(),
etc.,

but then I get the error:
Fatal error: Call to a member function getFullName() on a non-object in /var/www/html/ojs-2.3.8/classes/submission/sectionEditor/SectionEditorAction.inc.php on line 243

Did I forget something?
Thank you for help.

Claude
csabbah
 
Posts: 9
Joined: Sat Feb 09, 2013 11:13 am

Re: Custom email templates: how to use them?

Postby asmecher » Wed Sep 04, 2013 9:36 am

Hi Claude,

Yes, the $authorUser variable doesn't exist in the context you're using it. See elsewhere in SectionEditorAction.inc.php for how to fetch that object.

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

Re: Custom email templates: how to use them?

Postby csabbah » Thu Sep 05, 2013 1:22 am

Thanks a lot, Alec.
I have replaced

$paramArray = array(
'reviewerName' => $reviewer->getFullName(),
'weekLaterDate' => $weekLaterDate,
etc.

with

$authorUser =& $userDao->getUser($sectionEditorSubmission->getUserId());
$paramArray = array(
'authorName' => $authorUser->getFullName(),
'reviewerName' => $reviewer->getFullName(),
'weekLaterDate' => $weekLaterDate,
etc.

I hope this is the correct way. It produces the activation of the variable authorName in the REVIEW REQUEST emails.

Best
Claude
csabbah
 
Posts: 9
Joined: Sat Feb 09, 2013 11:13 am


Return to OJS Editorial Support and Discussion

Who is online

Users browsing this forum: No registered users and 2 guests