Announcement

Collapse
No announcement yet.

ReplyToAll

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ReplyToAll

    Sometimes you might want to Reply To All from an email which you were either not the To: recipient, or you were not listed at all.

    In this case, I would insert the from: of the original message into to: and then any to: or cc: recipients of the original message, excluding any addresses which are my own into the cc: fields.

    I can do the first part fine, but not strip out my own email addresses.

    Is there a suggestion on how to do this in views/email/detail.js?

  • #2
    Hi

    There is already Reply To All. And you can reply to all for any email. Or do I miss something?

    Comment


    • #3
      You're missing something

      If there are multiple To: recipients, or your own email address is not a To: recipient, not everyone is replied to.

      Only the CC: recipients are copied to CC:, and only the From: recipient is copied to To:

      Comment


      • #4
        Got it.

        Something like this:
        PHP Code:
        attributes['cc'] = this.model.get('cc');

        (
        this.model.get('to')).split(',').forEach(function (item) {
           
        item item.trim();
           if (
        some check whether email is not email of current user) {
               
        attributes['cc'] += ', ' item;
           }
        }); 
        Not sure.

        Comment


        • #5
          Yes that's it exactly. The issue is I can't call
          PHP Code:
          this.getUser().get('emailAddress'
          from inside that scope for some reason. I get error: Uncaught TypeError: undefined is not a function on that call.

          Comment


          • #6
            pass this to forEach

            PHP Code:
            (this.model.get('to')).split(',').forEach(function (item) {
               
            item item.trim();
               if (
            some check whether email is not email of current user) {
                   
            attributes['cc'] += ', ' item;
               }
            }, 
            this); 
            or use bind.

            Comment


            • #7
              Brilliant it's working well - https://github.com/espocrm/espocrm/pull/21

              Comment

              Working...
              X