I have custom modules which send email using Email.php in logic hooks. Currently using Sugar5.2.0.k CE on LAMP. I am testing for an upgrade to 5.5.2 and am finding my email fails for my custom modules. The line I am getting an error in is 256 of file modules/Email/Email.php in the upgrade version of 5.5.2 CE. I noticed a change in files from 5.2.0 to 5.5.2:
//This is from 5.2.0k CE in Email.php
function email2ParseAddresses($addresses) {
$addresses = from_html($addresses);
$addresses = str_replace(",", ";", $addresses);
$exAddr = explode(";", $addresses);
//This is from 5.5.2 CE in Email.php
function email2ParseAddresses($addresses) {
$addresses = from_html($addresses);
$addresses = $this->et->unifyEmailString($addresses);
$pattern = '/@.*,/U';
preg_match_all($pattern, $addresses, $matchs);
if (!empty($matchs[0])){
$total = $matchs[0];
foreach ($total as $match) {
$convertedPattern = str_replace(',', '::;::', $match);
$addresses = str_replace($match, $convertedPattern, $addresses);
} //foreach
}
$exAddr = explode("::;::", $addresses);
The error is in $addresses = $this->et->unifyEmailString($addresses);
PHP Fatal error: Call to a member function unifyEmailString() on a non-object in
.../crm-upgrade/modules/Emails/Email.php on line 256
I found a comment for the declaration of the $et variable. It is the Email UI. Because I am not using the UI to send emails, what is the recommended way to do so now? Do I need to initialize this object just for that method to be used? If so, can I get an example to do so? Or, is there an alternative/preferred way to send email?
Thanks in advance,
Bryan


LinkBack URL
About LinkBacks



Reply With Quote
Before I send the email, I call email2init(). This initializes that very object needed to unify the string.

Bookmarks