Allow reply-to individual instead of topic/forum (mailing list feature)

(Tobias Eigen) #41

Thanks Tarek!

Can you remove the reply all button change?

My second point is just that there is no reply to sender functionality. If I were to hit reply it would go to discourse, not directly to the sender by email, bypassing diacourse. Make sense?

(Tarek Loubani) #42

try editing this file:

(Tobias Eigen) #43

thanks, tarek! what about the second point? if I’m right then there’s no need for me even to have this plugin turned on. Mailing list mode seems to not be affected.

I’ll watch it for a few days and let you know what happens. :rocket:

(Tarek Loubani) #44

I’m not sure how that comes to pass for you. For me, obviously it works as advertised. Did you perhaps not enable the plugin? settings > plugins > replyto-individual enabled

(Tobias Eigen) #45

yep - it’s enabled.

does the plugin work with mailing list mode turned on?

(Tarek Loubani) #46

Yes. Not sure what’s happening on your installation there.

(Tobias Eigen) #47

ok - we’ll let it play out for a few days. it’s a quiet, new forum and there haven’t been any posts since I enabled your plugin.

I did update just now to change them as follows - but the topic button still says “reply all” not “reply”.

(Tarek Loubani) #48

Hello all,

For those using this plugin, it is currently known to be broken. I’m working on fixing it at the moment.


Did it break a while ago, or did 2.1.2 break it? Wondering if I should hold off upgrading.

(Tarek Loubani) #50

It broke in ~ August. It’s now fixed, so go ahead.

(Tarek Loubani) #51

The plugin is now working again. Here’s the issue if for some reason one is bored and interested:

(Tarek Loubani) #52

I spoke too soon about this bug being fixed. For some reason, I cannot get a “Reply-To” header added into my email properly.

The current lines in question are these:

      if allow_reply_by_email?
        result[ALLOW_REPLY_BY_EMAIL_HEADER] = true
        if @opts[:private_reply] == true
          result['Reply-To'] = reply_by_email_address
          p = Post.find_by_id @opts[:post_id]
          result['Reply-To'] = "#{} <#{}>"
          result['CC'] = reply_by_email_address
        result['Reply-To'] = from_value

This section is taken from the Email::MessageBuilder class.

If I leave the Reply-To set to its default ( reply_by_email_address), then all is well. However, if it is set to anything else (even "", then it will simply disappear from the end email headers. Similarly, if I replace Reply-To with something else like CC, then for some reason it does not build, and instead displays: replies+%{reply_key} (note, the %{reply_key} is correctly fixed in the Reply-To.

I really have no idea a) why this behaviour is happening; and b) Why it’s happening now after working for so long - what am I missing here in the API?

(Tarek Loubani) #53

I managed to fix the problem with the reply_key not being substituted using this commit, which modifies the set_reply_key method in the Email::Sender class. However, I still can’t figure out why Reply-To becomes null when I change it to anything but ‘reply_by_email_address’. It is set correctly at the end of the header_args method, but I can’t figure out where it is unset.

Any thoughts? I think @featheredtoast is the staff member I see with the most recent edits to Email::MessageBuilder

Edit: After some debugging, this appears to happen somewhere in lib/mail/sender.rb before line 86, though not sure exactly where…

Edit #2: After further debugging, I found the problem to be the following line in the Email::Sender::set_reply_key method:

      @message.header['Reply-To'] =
        header_value('Reply-To').gsub!("%{reply_key}", reply_key)

This method was causing a Reply-To without a reply_key to be wiped. I added a simple if statement to exclude the function if there was no “reply_key” in it. As of this moment, the plugin is back to fully working status.