nylas / nylas-mail

:love_letter: An extensible desktop mail app built on the modern web. Forks welcome!
https://nylas.com/nylas-mail/
MIT License
24.8k stars 1.38k forks source link

Feature Request - Select the right email alias when replying #3462

Open yehiasalam opened 7 years ago

yehiasalam commented 7 years ago

Hello,

Super useful, found in Gmail and Inbox. When im replying to an email to send to an alias, the from field when im composing is automatically send with the alias it was send to.

I'll try when I have time to fork and do a pull request. Very neat product btw.

yehiasalam commented 7 years ago

well, it looks likes i should change something along the below lines in the draft factory in draft-factory.js, however not sure if there will be any affected areas

    DraftFactory.prototype.createOrUpdateDraftForReply = function(arg) {
      var behavior, message, thread, type;
      message = arg.message, thread = arg.thread, type = arg.type, behavior = arg.behavior;
      if (type !== 'reply' && type !== 'reply-all') {
        throw new Error("createOrUpdateDraftForReply called with " + type + ", not reply or reply-all");
      }
      return this.candidateDraftForUpdating(message, behavior).then((function(_this) {
        return function(existingDraft) {
          if (existingDraft) {
            return _this.updateDraftForReply(existingDraft, {
              message: message,
              thread: thread,
              type: type
            });
          } else {
            return _this.createDraftForReply({
              message: message,
              thread: thread,
              type: type
            });
          }
        };
      })(this));
    };
yehiasalam commented 7 years ago

submitted a hot fix here https://github.com/nylas/nylas-mail/pull/3473, please merge 👍