Skip to content

Conversation

@exner104
Copy link
Contributor

@exner104 exner104 commented Jan 8, 2020

Wrong email sender in app sharebymail when sending password to owner fix #18730

Wrong email sender in app sharebymail when sending password to owner fix nextcloud#18730
Copy link
Member

@rullzer rullzer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@kesselb
Copy link
Collaborator

kesselb commented Jan 8, 2020

$instanceName = $this->defaults->getName();
$senderName = $this->l->t(
'%1$s via %2$s',
[
$initiatorDisplayName,
$instanceName
]
);
$message->setFrom([\OCP\Util::getDefaultEmailAddress($instanceName) => $senderName]);

Probably not bad to have the same sender name as the other email. xyz via nextcloud.

@rullzer
Copy link
Member

rullzer commented Jan 8, 2020

Good point @kesselb
Could you fix that @exner104 ?

@kesselb
Copy link
Collaborator

kesselb commented Jan 8, 2020

@rullzer we failed 🙈 \OCP\Util::getDefaultEmailAddress($instanceName) but $instanceName was undefined without the additional senderName logic.

@exner104
Copy link
Contributor Author

exner104 commented Jan 8, 2020

@kesselb indeed I used in my first approch the variables $instanceName and $senderName without initializing them.
With the additional code from your advice these variables are defined, so I think the code is now correct.

@rullzer
Copy link
Member

rullzer commented Jan 8, 2020

Gave it a quick spin and it works.

@exner104 normally we require commits to be signed off. See https://github.com/nextcloud/server/pull/18733/checks?check_run_id=379067761.
But let me merge this and or your next PR you can :)

@rullzer rullzer merged commit 7e95c88 into nextcloud:master Jan 8, 2020
@welcome
Copy link

welcome bot commented Jan 8, 2020

Thanks for your first pull request and welcome to the community! Feel free to keep them coming! If you are looking for issues to tackle then have a look at this selection: https://github.com/nextcloud/server/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22
Most developers hang out on IRC. So join #nextcloud-dev on Freenode for a chat!

@rullzer rullzer mentioned this pull request Jan 9, 2020
1 task
@exner104 exner104 deleted the patch-1 branch January 9, 2020 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Wrong email sender in app sharebymail when sending password to owner

3 participants