ReplyToAll

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • alasdaircr
    Active Community Member
    • Aug 2014
    • 525

    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?
  • yuri
    Member
    • Mar 2014
    • 8627

    #2
    Hi

    There is already Reply To All. And you can reply to all for any email. Or do I miss something?
    If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

    Comment

    • alasdaircr
      Active Community Member
      • Aug 2014
      • 525

      #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

      • yuri
        Member
        • Mar 2014
        • 8627

        #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.
        If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

        Comment

        • alasdaircr
          Active Community Member
          • Aug 2014
          • 525

          #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

          • yuri
            Member
            • Mar 2014
            • 8627

            #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.
            If you find EspoCRM good, we would greatly appreciate if you could give the project a star on GitHub. We believe our work truly deserves more recognition. Thanks.

            Comment

            • alasdaircr
              Active Community Member
              • Aug 2014
              • 525

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

              Comment

              Working...