OJS: How to disable email when publish a new issue?

Is there any way to disable email sending when publish a new issue?

Our magazine send manually.

version: OJS 2.4.8.0

Thank you.

Hi @tiago_agostinho,

Do you mean disabling notifications for readers who have specifically signed up for “new issue published” notifications? To do that, you’d need to edit the code (specifically pages/editor/IssueManagementHandler.inc.php in the publishIssue function).

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher,

thanks for the answer.

Analyzing the function publishIssue, I understand that I can comment the lines 973-994, as follows:

// Send a notification to associated users import('classes.notification.NotificationManager'); $notificationManager = new NotificationManager(); $roleDao =& DAORegistry::getDAO('RoleDAO'); $notificationUsers = array(); $allUsers = $roleDao->getUsersByJournalId($journalId); while (!$allUsers->eof()) { $user =& $allUsers->next(); $notificationUsers[] = array('id' => $user->getId()); unset($user); } foreach ($notificationUsers as $userRole) { $notificationManager->createNotification( $request, $userRole['id'], NOTIFICATION_TYPE_PUBLISHED_ISSUE, $journalId ); } $notificationManager->sendToMailingList($request, $notificationManager->createNotification( $request, UNSUBSCRIBED_USER_NOTIFICATION, NOTIFICATION_TYPE_PUBLISHED_ISSUE, $journalId ) );

Can I do this?

Regards,

Tiago

Hi @tiago_agostinho,

At a glance, yes, that should be OK.

Regards,
Alec Smecher
Public Knowledge Project Team

Hello @asmecher and @tiago_agostinho

We’d also like to disable – then re-enable – the email notification for new launch, however our current version is OJS 2.4.4.1

Are the instructions the same for this version?

Is re-enabling a matter of restoring the edited code to the original?

Thanks for your help

MSJ

Hi @msengulj,

I haven’t checked specifically, but yes, OJS 2.4.4-1 should be the same in this respect.

Regards,
Alec Smecher
Public Knowledge Project Team

Thank you @asmecher I hope it goes okay :worried:

hey @asmecher and @tiago_agostinho

Where in Cpanel can I find the PublishIssue directory? I’m poking around and not having much luck. Thanks in advance.

MSJ

Oh! I see you gave directory directions already, @asmecher sorry for the redundancy.

Hey @asmecher I have a question. I “commented out” using /** the code related to automatic notification in pages/editor/IssueManagementHandler.inc.php – but now the “Create issue” isn’t working, I get an error message that says “Expecting T FUNCTION”. Would you help me trouble shoot? Do you think I missed/messed up something else??

Hi @msengulj,

Can you describe exactly what you changed?

Regards,
Alec Smecher
Public Knowledge Project Team

Thanks @asmecher for asking. So I went into the cpanel and opened up that file and found the “Send notification to associated users” section of the code (line 955) and put /** in front of it to “comment out” that section. I’m attaching a screenshot of my Bracket’s file, however I ended up actually editing the file directly in cpanel (and doing the same thing) rather than deleting the file and reuploading my file. Not sure if that makes a difference either. But when I got the failure message, I just pasted in a copy of the original code and I did not get the error message any longer. As a side note, I’ve got more know-how using CSS/HTML than php, so maybe commenting out doesn’t work this way in such a file? Thanks in advance for your help.

Hi @msengulj,

You also need to end the comment using */; that should happen at the end of line 977, just squinting at the image.

Regards,
Alec Smecher
Public Knowledge Project Team

So strange, even when I closed it I still get this error message :frowning:

Hi @msengulj,

That means that there’s a typo in there somewhere. Can you post exactly what your modifications are? The last image was helpful.

Regards,
Alec Smecher
Public Knowledge Project Team

Those are all my mods: the opening /** and the closing */ … attaching another brackets screenshot.

Hi @msengulj,

You need to end the comment at the end of line 977, not line 981.

Regards,
Alec Smecher
Public Knowledge Project Team

You are wonderful I will sing you praises!! Especially if I can actually get this to work (er… not work in the case of the automatic emails)

One final question, does the */ go before or after the ; ) on line 977?

I THINK I GOT IT TO WORK! THIS IS AMAZING!! THANK YOU!!!

(The bold is to relay total excitement … not yelling).

Hi @msengulj,

Glad to hear it’s working! If you’re not getting an error message, then it’s pretty likely you got this right.

Regards,
Alec Smecher
Public Knowledge Project Team