OJS OCS OMP OHS

You are viewing the PKP Support Forum | PKP Home Wiki



Change Body of Email

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

Moderators: jmacgreg, michael, John

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

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. Please note that this FAQ is OJS-centric, but most issues are applicable to both platforms.

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 OCS Conference Support and Discussion subforum; if you have a development question, try the OCS Development subforum.

Change Body of Email

Postby hksatay » Mon Sep 24, 2007 1:49 am

Hi All,
Does anyone have any idea to change the content (dynamic value) of email?
I knew, i could change it inside the email template, e.g.MANUAL_PAYMENT_NOTIFICATION
================================================================================================================================
A manual payment needs to be processed for the conference {$schedConfName} and the user {$userFullName} (username "{$userName}").
The item being paid for is "{$itemDescription}".
The cost is {$itemCost} ({$itemCurrencyCode}).
This email was generated by Open Conference Systems' Manual Payment plugin.
================================================================================================================================
Moreover, there is a function called assignParams($paramArray); in mail\mialTemplate.inc.php
and i can see that there is a foreach loop to replace the $key to $value
foreach ($paramArray as $key => $value) {
if (!is_object($value)) {
$subject = str_replace('{$' . $key . '}', $value, $subject);
$body = str_replace('{$' . $key . '}', $value, $body);
}

However, how can i add an new value insid the email, e.g. {Sponsors Name}
Which pages are involved?

Thank You~
hksatay
 
Posts: 10
Joined: Wed Aug 22, 2007 3:17 am

Re: Change Body of Email

Postby asmecher » Mon Sep 24, 2007 9:39 am

Hi hksatay,

You can change the wording of emails using the Conference Manager's "Prepared Emails" interface. Then, to add a new parameter, you'll have to search the code for the email key by name. In a Linux environment, I use:
Code: Select all
fgrep -l MANUAL_PAYMENT_NOTIFICATION `find /path/to/ocs -name \*.php`
This turns up:
  • plugins/paymethod/manual/ManualPaymentPlugin.inc.php
In that file, the relevant code is:
Code: Select all
                $mail = &new MailTemplate('MANUAL_PAYMENT_NOTIFICATION');
                $mail->setFrom($contactEmail, $contactName);
                $mail->addRecipient($contactEmail, $contactName);
                $mail->assignParams(array(
                        'schedConfName' => $schedConf->getFullTitle(),
                        'userFullName' => $user?$user->getFullName():('(' . Locale::translate('common.none') . ')'),
                        'userName' => $user?$user->getUsername():('(' . Locale::translate('common.none') . ')'),
                        'itemDescription' => $queuedPayment->getDescription(),
                        'itemCost' => $queuedPayment->getAmount(),
                        'itemCurrencyCode' => $queuedPayment->getCurrencyCode()
                ));
                $mail->send();
You can add a new parameter, e.g. the paper sponsor, by adding it to the call to $mail->assignParams.

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

Re: Change Body of Email

Postby tshore » Sun Dec 02, 2007 7:04 am

I am trying to change the text in the SUBMISSION_PAPER_ACCEPT email template, but I am having difficulty. First, the default text that comes up both for subject and in the body of the email is not what appears when I go into "Conference Site Management > Prepared Emails > Edit Email". And, predictably, when I make changes to the subject or body of the email with this interface, the changes are not reflected when I go to send an acceptance email from director/emailDirectorDecisionComment.

I thought it might be a caching issue, so I deleted several cache files, but this didn't help.

Help please.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Change Body of Email

Postby asmecher » Sun Dec 02, 2007 9:51 am

Hi tshore,

Have you recorded an ACCEPT decision before trying to send the email? The latest decision defines what template is used. Otherwise, could you post the first sentence of the mail template that comes up when you compose the message?

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

Re: Change Body of Email

Postby tshore » Sun Dec 02, 2007 9:47 pm

Yes, I have recorded an ACCEPT.

The subject line of the template is just the {$paperTitle}, nothing else.

Here is the start of the body:

{$presenterName}:

Congratulations, your submission my title has been accepted for presentation at {$conferenceName} (should be schedConf, I think) which is being held 2007-10-24 (wrong date - this is when I set submissions to open, I think, it's not the start of the conference) at {$locationCity}.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Change Body of Email

Postby asmecher » Sun Dec 02, 2007 10:17 pm

Hi Trudy,

Depending on the submission/review model you've chosen in your conference setup, a different email template might be getting used -- try modifying SUBMISSION_ABSTRACT_ACCEPT to see if that's the appropriate template.

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

Re: Change Body of Email

Postby tshore » Mon Dec 03, 2007 3:29 am

Right, but of course the admin system should be modifying the correct template, so it looks like this might be a bug? In the meantime, where are the templates? The one in:

dbscripts/xml/data/locale/en_US/email_templates_data.xml

matches what appears in the admin system (that is, before I modified it), but it doesn't match what I see when I compose an acceptance email.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Change Body of Email

Postby asmecher » Mon Dec 03, 2007 9:49 am

Hi Trudie,

The dbscripts/xml/data/locale/en_US/email_templates_data.xml file contains the stock email templates; when a conference (in OCS) or a journal (in OJS) is created, these are loaded as defaults. The "live" versions of the templates, whether they're the defaults or they've been modified, are stored in the database in the email_templates_... tables. The admin system (I assume you mean the "Prepared Emails" pages) allows you to modify any template; if that interface isn't working as expected, could you describe the problem a little further?

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

Re: Change Body of Email

Postby tshore » Tue Dec 04, 2007 1:30 am

I found the email templates in the DB. The one I changed is the only entry in both the email_templates and email_templates_data tables, so the admin system (prepared emails) seems to be working fine. The problem is that director/emailDirectorDecisionComment is grabbing a different template (from where, I have no idea?) when filling in the initial values for the subject and body of the email. I tried looking through the code in a number of files to find where it was looking, but I gave up.

Help please.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Change Body of Email

Postby asmecher » Tue Dec 04, 2007 2:08 pm

Hi Trudie,

I suspect you're still looking at the wrong email template; have you tried both SUBMISSION_ABSTRACT_ACCEPT and SUBMISSION_PAPER_ACCEPT? One of these two will be used depending on your conference configuration.

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

Re: Change Body of Email

Postby tshore » Tue Dec 04, 2007 2:24 pm

I just double-checked (via the Prepared Emails interface) and neither of the two templates you mentioned matches what I see when I am on director/emailDirectorDecisionComment.

Trudy
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Change Body of Email

Postby asmecher » Fri Dec 07, 2007 11:52 am

Hi Trudy,

I'm still having difficulty reproducing this. Would it be possible for you to set me up with a temporary account including a Conference Manager role? If so, please PM it to me.

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

Re: Change Body of Email

Postby tshore » Tue Dec 11, 2007 4:01 am

I was able to modify the template called SUBMISSION_PAPER_ACCEPT at the following URL: http://imrf.mcmaster.ca/IMRF/ocs/index. ... PER_ACCEPT

The modification, when made, showed up OK at the URL: http://imrf.mcmaster.ca/IMRF/ocs/index. ... ?paperId=3

Do you see the same thing? Am I misunderstanding the problem?


No, I don't see the same thing. When I look at the roles table, this is what I see:

conference_id, sched_conf_id, user_id, role_id
1, 0, 44, 16 <--- this is you
1, 1, 2, 64 <--- this is my test director

I can see now that we don't have the same roles assigned and you are not assigned any role associated with my scheduled conference. I am very confused by the implementation of the whole role thing. As admin, I can change the email templates, but they aren't the email templates that you modified as a conference manager. Also, they are not the templates that get used when I am logged in as a conference director. And, as far as I can tell, as admin, I can't even go to the page where the emails are sent out for accepting and rejecting proposals.
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Re: Change Body of Email

Postby asmecher » Tue Dec 11, 2007 10:38 am

Hi Trudy,

Each user can have multiple roles, so if you want your admin user to have Director access (e.g. to accept or decline a submission), you'll need to enroll them using the Conference Management functions. I'm still not sure I'm following what you mean when you write:
As admin, I can change the email templates, but they aren't the email templates that you modified as a conference manager. Also, they are not the templates that get used when I am logged in as a conference director.
Could you describe this in a bit more detail?

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

Re: Change Body of Email

Postby tshore » Thu Dec 13, 2007 5:04 am

Ok, I think that I've figured out the problem here. I am able to edit the body of the standard email and the changes show up fine when I go to send an acceptance email. However, it's the subject lines that don't match. On manager/editEmail/SUBMISSION_PAPER_ACCEPT, the subject line is "Editorial Decision on Paper", but on director/emailDirectorDecisionComment, the subject is {$paperTitle}.

Also, as I mentioned earlier in this thread, the template body calls for {$conferenceDate}, but the date that's displayed is the go live date for the website.

And one more thing. The account I created for you was a Conference Manager account - this allows you to edit the email templates - but, when I login as you, I can't even get to that 2nd URL you listed:

http://imrf.mcmaster.ca/IMRF/ocs/index.php/meetings/2008/director/emailDirectorDecisionComment?paperId=3

because you are not a Conference Director. Just wondering how you got there? Maybe I also had you designated as a director and then took that away?
tshore
 
Posts: 264
Joined: Fri Nov 18, 2005 12:48 pm
Location: Hamilton, Ontario

Next

Return to OCS Technical Support

Who is online

Users browsing this forum: No registered users and 3 guests