Fix up e-notice error when using a user from email address same issue as dev/core#644
authorSeamus Lee <seamuslee001@gmail.com>
Fri, 1 Mar 2019 00:28:00 +0000 (11:28 +1100)
committerSeamus Lee <seamuslee001@gmail.com>
Fri, 1 Mar 2019 02:14:46 +0000 (13:14 +1100)
CRM/Contribute/Form/Task/PDF.php

index 2ded1e46f365a9ab3ce96575ff675ac36d41c234..f29751970c0a4ffe59c3618125e24a4dbe233297 100644 (file)
@@ -200,8 +200,12 @@ AND    {$this->_componentClause}";
 
       $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]);
       }