Variables in "Prepared Emails" templates

OJS development discussion, enhancement requests, third-party patches and plug-ins.

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

Forum rules
The Public Knowledge Project Support Forum is moving to

This forum will be maintained permanently as an archived historical resource, but all new questions should be added to the new forum. Questions will no longer be monitored on this old forum after March 30, 2015.
Posts: 113
Joined: Fri Mar 30, 2007 3:32 pm

Variables in "Prepared Emails" templates

Postby rmichael » Wed Jul 09, 2008 6:57 am


One feature/improvement I'd like to suggest is the availability/handling of variables in email templates.

For example, we prefer to have our salutation using the family name only (no prename), so I use {$authorLastName} after modifying the assignParams array via:

Code: Select all

'authorLastName' => $user->getLastName()

However, this means I must modify OJS everywhere the $mail setup occurs. It would be nice if the entire user profile was available consistently in every template. Then, I'd simply write my templates without wondering which user data was available to me.

Perhaps this can be done in the mail constructor (a second constructor with additional arguments)?

(I can add this to my own "things I never seem to have time for with OJS" todo list, such as my plugins and other modifications. :-))


Posts: 4191
Joined: Tue Feb 14, 2006 10:50 am

Re: Variables in "Prepared Emails" templates

Postby jmacgreg » Thu Jul 10, 2008 12:05 pm

Hi Richard,

I like the sound of this, too -- and to extend the idea a bit, it would be nice to see a list of variables to pick and choose from when editing Prepared Email templates.

I'm not sure how quickly the developers would be able to get to it, but you are welcome to post this as a feature request to Bugzilla. Alternatively, if you do develop code for this we would be very happy to take a look.


Return to “OJS Development”

Who is online

Users browsing this forum: No registered users and 1 guest