Commit c65ce897 authored by Michael McAndrew's avatar Michael McAndrew

dev/mail/15 deal better with spaces in from email address

parent 7841d2e1
......@@ -464,9 +464,10 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
$params['reset_default_for'] = array('filter' => "0, " . $params['filter']);
}
//make sure we should has to have space, CRM-6977
//make sure we only have a single space, CRM-6977 and dev/mail/15
if ($this->_gName == 'from_email_address') {
$params['label'] = str_replace('"<', '" <', $params['label']);
preg_match("/^\"(.*)\" *<([^@>]*@[^@>]*)>$/", $params['label'], $parts);
$params['label'] = "\"{$parts[1]}\" <$parts[2]>";
}
}
......
......@@ -5,7 +5,7 @@
// the available "From:" addrs. Records are like the underlying OptionValues -- but add "email"
// and "author".
angular.module('crmMailing').factory('crmFromAddresses', function ($q, crmApi) {
var emailRegex = /^"(.*)" <([^@>]*@[^@>]*)>$/;
var emailRegex = /^"(.*)" *<([^@>]*@[^@>]*)>$/;
var addrs = _.map(CRM.crmMailing.fromAddress, function (addr) {
var match = emailRegex.exec(addr.label);
return angular.extend({}, addr, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment