Permalink
Browse files

fix(email): always default to site email

If no email is passed to elgg_send_email(), we now always default
to using site email
  • Loading branch information...
hypeJunction committed Mar 7, 2018
1 parent 9dea1af commit 23ffef3d0e9a2b9cefd0727afc727c1eb5b06283
Showing with 5 additions and 1 deletion.
  1. +5 −1 engine/classes/Elgg/Email.php
@@ -258,7 +258,11 @@ public function getAttachments() {
* @throws InvalidParameterException
*/
protected static function prepareFrom($from) {
if ($from instanceof ElggEntity) {
if (empty($from)) {
// get the site email address
$site = elgg_get_site_entity();
$from = new Address($site->getEmailAddress(), $site->getDisplayName());
} else if ($from instanceof ElggEntity) {
// If there's an email address, use it - but only if it's not from a user.
if (!$from instanceof ElggUser && $from->email) {
$from = new Address($from->email, $from->getDisplayName());

0 comments on commit 23ffef3

Please sign in to comment.