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

Guests created via Talk don't receive a welcome mail #1037

Open
SystemKeeper opened this issue Jun 30, 2023 · 6 comments
Open

Guests created via Talk don't receive a welcome mail #1037

SystemKeeper opened this issue Jun 30, 2023 · 6 comments
Labels
bug Something isn't working integration Compatibility with other apps/systems

Comments

@SystemKeeper
Copy link
Contributor

Steps to reproduce:

  • Create a talk conversation
  • Enter a mail address in the share tab and select "Invite guest"
  • In the modal add name and create the guest

Expected:

  • The guest receives a mail that he was invited to a talk conversation and has the ability to reset the password

Current:

  • No mail is send to the guest, so the person who created the guest needs to manually reach out to them and tell them to use the "Reset password" functionality to create the credentials

Additional:
Creating guests via file share is working correctly, the guest receive a mail. This is done inside the Hook.php: https://github.com/nextcloud/guests/blob/master/lib/Hooks.php

@SystemKeeper SystemKeeper added the bug Something isn't working label Jun 30, 2023
@nickvergessen
Copy link
Member

Talk is using the PUT ocs/v2.php/…/api/v1/users endpoint, but yeah the GuestManager doesn't seem to send an email there.
It only generates the password reset token:

guests/lib/GuestManager.php

Lines 104 to 155 in 0ab2d2b

public function createGuest(IUser $createdBy, string $userId, string $email, string $displayName = '', string $language = '', ?string $initialPassword = null) : IUser {
if ($initialPassword === null) {
$passwordEvent = new GenerateSecurePasswordEvent();
$this->eventDispatcher->dispatchTyped($passwordEvent);
$password = $passwordEvent->getPassword() ?? $this->secureRandom->generate(20);
} else {
$password = $initialPassword;
}
/** @var IUser */
$user = $this->userManager->createUserFromBackend(
$userId,
$password,
$this->userBackend
);
$user->setEMailAddress($email);
$this->config->setUserValue($userId, 'guests', 'created_by', $createdBy->getUID());
if ($displayName) {
$user->setDisplayName($displayName);
}
if ($language) {
$this->config->setUserValue($userId, 'core', 'lang', $language);
}
if ($initialPassword === null) {
// generate token for lost password so that a link can be sent by email
$token = $this->secureRandom->generate(
21,
ISecureRandom::CHAR_DIGITS .
ISecureRandom::CHAR_LOWER .
ISecureRandom::CHAR_UPPER);
$endOfTime = PHP_INT_MAX - 50000;
$token = sprintf('%s:%s', $endOfTime, $token);
$encryptedValue = $this->crypto->encrypt($token, strtolower($email) . $this->config->getSystemValue('secret'));
$this->config->setUserValue(
$userId,
'core',
'lostpassword',
$encryptedValue
);
}
$user->setQuota('0 B');
return $user;
}

So also guests created via OCC don't receive their email atm.

@SystemKeeper
Copy link
Contributor Author

So I guess we need to move the mail logic to the GuestManager instead of reacting to a share hook?

@nickvergessen
Copy link
Member

not move (it's in a MailService), but just invoke that one also from the GuestManager, yes, and then skip in the email parts that refer to a share, I guess

@SystemKeeper
Copy link
Contributor Author

Yes, that what I meant. Poor wording, sorry.

@Th3l5D
Copy link

Th3l5D commented Feb 21, 2024

Hello,

Still have this issue here. Is there any fix in backlog for this?

@Th3l5D
Copy link

Th3l5D commented Feb 28, 2024

Hey again,

I'm affraid this issue will fall in a black hole :D

Do you think it will be taken in account at some point?

@joshtrichards joshtrichards added the integration Compatibility with other apps/systems label Mar 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working integration Compatibility with other apps/systems
Projects
None yet
Development

No branches or pull requests

4 participants