From 5b8e26b5d5601fa0c62c07a9fb4b9d8526d08416 Mon Sep 17 00:00:00 2001 From: Seamus Lee Date: Fri, 1 Mar 2019 11:28:00 +1100 Subject: [PATCH] Fix up e-notice error when using a user from email address same issue as dev/core#644 --- CRM/Contribute/Form/Task/PDF.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CRM/Contribute/Form/Task/PDF.php b/CRM/Contribute/Form/Task/PDF.php index 2ded1e46f365..f29751970c0a 100644 --- a/CRM/Contribute/Form/Task/PDF.php +++ b/CRM/Contribute/Form/Task/PDF.php @@ -200,8 +200,12 @@ public function postProcess() { $values = array(); if (isset($params['from_email_address']) && !$elements['createPdf']) { + // If a logged in user from email is used rather than a domain wide from email address + // the from_email_address params key will be numerical and we need to convert it to be + // in normal from email format + $from = CRM_Utils_Mail::formatFromAddress($params['from_email_address']); // CRM-19129 Allow useres the choice of From Email to send the receipt from. - $fromDetails = explode(' <', $params['from_email_address']); + $fromDetails = explode(' <', $from); $input['receipt_from_email'] = substr(trim($fromDetails[1]), 0, -1); $input['receipt_from_name'] = str_replace('"', '', $fromDetails[0]); }