Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OJS] Users import/export plugin doesn't include notification functionality #2166

Closed
jmacgreg opened this issue Jan 9, 2017 · 5 comments
Closed
Assignees
Labels
Hosting Bug reports and feature requests from Publishing Services's hosted clients.

Comments

@jmacgreg
Copy link
Contributor

jmacgreg commented Jan 9, 2017

It appears that the user notification functionality in the users import/export plugin hasn't been ported over. This is problematic, as users can be imported, but won't be notified of their username/password.

@asmecher
Copy link
Member

This is implemented in OJS 2.x in...

https://github.com/pkp/ojs/blob/ojs-stable-2_4_8/plugins/importexport/users/UserXMLParser.inc.php#L287..L297

It's not implemented in OJS 3.x here: https://github.com/pkp/pkp-lib/blob/ojs-stable-3_0_1/plugins/importexport/users/filter/UserXmlPKPUserFilter.inc.php#L132

The "notify" flag would need to be added to the UI somewhere, but otherwise it would be a relatively quick addition.

@rcgillis
Copy link

rcgillis commented Dec 15, 2017

Is it possible to get this assigned to a future release, especially if it is an easy fix? Have been talking to some folks who have been asking about it.

@jmacgreg jmacgreg added the Hosting Bug reports and feature requests from Publishing Services's hosted clients. label Jan 11, 2018
@asmecher
Copy link
Member

Already implemented as part of #3462.

@brueyd
Copy link

brueyd commented Aug 13, 2019

Hello @asmecher,

I seem to be running into this issue (or one like it) on a new installation of OJS 3.1.2-1 from the OJS downloads page.

When I import a user using the XML below (but with a real email address), I get a message that says a notification was sent to the email address. However, no email is received. I am using Gmail SMTP to send emails, and no email is present in the email account's Sent box. The user is imported into OJS, and when I send a test email from the Users page, it is successfully delivered.

Any ideas about why the import notification is not being sent?

        <user>
            <givenname locale="en_US">Test</givenname>
            <familyname locale="en_US">User</familyname>
            <country>US</country>
            <email>[email protected]</email>
            <username>test-user-gmail</username>
            <password encryption="plaintext" is_disabled="false" must_change="true">
                <value>TestPassword987</value>
            </password>
            <date_registered>2018-01-05 07:23:37</date_registered>
            <date_last_login>2019-08-04 18:46:17</date_last_login>
            <inline_help>true</inline_help>
            <user_group_ref>Reader</user_group_ref>
        </user>
  • Import/Export errors:
    The imported user "test-user-gmail" password could not be imported as is. A new password is been send to the user email. The user has been imported.

@asmecher
Copy link
Member

@brueyd, the two most likely situations are

  1. OJS not even trying to send the message, or
  2. Gmail SMTP not delivering the message.

To determine which, I'd suggest adding error_log statements to the code that should be sending the message. That's lib/pkp/plugins/importexport/users/filter/UserXmlPKPUserFilter.inc.php in the parseUser function:

// send USER_REGISTER e-mail only if it is a new inserted/registered user
// else, if the user already exists, its metadata will not be change (just groups will be re-assigned below)
if ($password) {
    import('lib.pkp.classes.mail.MailTemplate');
    $mail = new MailTemplate('USER_REGISTER');
    $mail->setReplyTo($context->getSetting('contactEmail'), $context->getSetting('contactName'));
    $mail->assignParams(array('username' => $user->getUsername(), 'password' => $password, 'userFullName' => $user->getFullName()));
    $mail->addRecipient($user->getEmail(), $user->getFullName());
    $mail->send();
}

If you can confirm that $mail->send() is being called (by adding an error_log call around here and watching for the message to show up in your PHP log), it suggests that OJS is delivering the message, but Gmail's SMTP service is choosing not to.

Next time, it's probably better to post questions like this in the support forum -- https://forum.pkp.sfu.ca -- rather than on old/closed issues like this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Hosting Bug reports and feature requests from Publishing Services's hosted clients.
Projects
None yet
Development

No branches or pull requests

4 participants