Can't type email address in the To/Cc/Bcc  in quick compose Email

It seems that in the out-of-the-box email quick compose in v7 you can't just type in an email address in the To line, it must be a contact/account/user and it must be typed by name to select the person to write to. Same for Cc and Bcc.

This is totally counter-intuitive as most of the time we are used to using email address in the To line.

Not only that, but when working a case the "+" on the Emails subpanel has the same issue.
We may want to log an email on the case requesting developer input without having to have all our developers be sugarCRM users.

And, in our environment, not everyone who submits a case should be a contact/lead/target in our system; yet we should be able to reply to them.

Is there a way to override the To, Cc and Bcc lines and have them simply accept an email address like any e-mail editor would?

thanks,
FrancescaS
  • Hello Francesca,

    I've filed a Defect for this issue.  You can track this item, #72141, using the following link: https://web.sugarcrm.com/support/issues/72141

    I found the root cause, in my case, to be a large number of entries in the 'email_addresses' and 'email_addr_bean_rel' tables.  There's a script that runs behind the scenes, looking for a related record based on the entered value.  In larger datasets, that script times out, which is dependent on your PHP settings.

    One thing to note, after the search timed out, the email address I manually entered was put into the To, Cc, Bcc field.

    Regards,

    Dan Kallish
    Advanced Support Engineer
    SUGARCRM

    Learning Resources: http://support.sugarcrm.com | http://university.sugarcrm.com | http://community.sugarcrm.com
  • Thanks Dan! Glad to hear it's a bug and not a 'feature' :)
    We certainly qualify as having a LOT of email addresses in our email_address table and email_addr_bean_rel table.

    On the subject of emails that are not related to a bean, is there a way to pass an email address that is not linked to a bean to the drawer compose? (See: https://community.sugarcrm.com/sugarcrm/topics/how-do-you-prepopulate-value-recipient-in-email-compo... )

    thanks,
    FrancescaS
  • Got an answer on the drawer compose on the linked thread.

    thanks,
    FrancescaS
  • Hi Francesca,

    It looks like extending the recipients.js is going to be the best way to workaround this defect. I would recommend making a small change in the loadOptions method to set a timeout for the request to the database. The specific timeout needed may take some fine tuning to get perfect, but essentially if the timeout is shorter than the current default, the AJAX call to the database will be cancelled and the email address manually entered will be able to be added to the recipient list. Please see my example code below for ./custom/modules/Emails/clients/base/fields/recipients/recipients.js

    ({      extendsFrom: 'EmailsRecipientsField',        initialize: function (options) {          this._super("initialize", [options]);      },        /**       * Fetches additional recipients from the server.       *       * See [Select2 Documentation of 'query' parameter](ivaynberg.github.io/.../ *       * @param {Object} query Possible attributes can be found in select2's       *   documentation.       */      loadOptions: _.debounce(function(query) {            var self = this,              data = {                  results: [],                  // only show one page of results                  // if more results are needed, then the address book should be used                  more: false              },              options = {},              callbacks = {},              url;            // add the search term to the URL params          options.q = query.term;          // the first 10 results should be enough          // if more results are needed, then the address book should be used          options.max_num = 10;            var custom_options = {              timeout: 2000,          };          // build the URL for fetching recipients that match the search term          url = app.api.buildURL('Mail', 'recipients/find', null, options);          // create the callbacks          callbacks.success = function(result) {              // the api returns objects formatted such that sidecar can convert them to beans              // we need the records to be in a standard object format (@see RecipientsField::format) and the records              // need to be converted into beans before we can format them              var records = app.data.createMixedBeanCollection(result.records);              // format and add the recipients that were found via the select2 callback              data.results = self.format(records);          };          callbacks.error = function() {              // don't add any recipients via the select2 callback              data.results = [];          };          callbacks.complete = function() {              // execute the select2 callback to add any new recipients              query.callback(data);          };          app.api.call('read', url, null, callbacks, custom_options);      }, 300),    })

    The only changes to the loadOptions method are the inclusion of a custom options variable:
    var custom_options = {     timeout: 2000,  };

      And adding that variable to the app.api.call parameter list:
    app.api.call('read', url, null, callbacks, custom_options);
    Keep in mind that if the timeout is set too low it will never allow the database to return values to match on if they exist. You may be able to find a happy medium timeout that allows the database to return when an entry exists and also fails quickly when it doesn't. 

    Please let me know if you have any further questions!

    -Mark
  • Wonderful! Thank you for addressing this so quickly!
    Works like a charm!

    FrancescaS