Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
plugins-topic
Post By Email: From/Reply-To Address
Avatar
chris.crabtree
Member
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 2:36 pm

Also I wonder if the problem could be related to the $replyto = apply_filters() call. No other code in my installation refers to the tag: 'sph_subscriptions_email_replyto' at all, so I wonder if I'm missing a necessary component for $replyto to actually be populated or if somehow this is an incorrect tag?

Not sure--just speculating. I am still very new to PHP and WordPress so I'm very much guessing here.

Thanks!

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 7:40 pm

late to the game, but we do not fill in the replyto field... its an optional field...  most emails are returned to the from field...  you can use replyto to override the standard/default reply address...

so question, do you really mean the replyto?  is the from address the wordpress@yoursite.com?

if so, that would make the question why is the from field not getting the right address...  can you tell me what you have for the fields on forum - options - email settings?

and something else that might be worth testing... grab an smtp plugin for wp and see if that matters... we usually recommend HGK SMTP...

Avatar
chris.crabtree
Member
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 8:32 pm

I understand--I would rather the From be from the forum-specific address anyway.

Current Settings

I believe the forum-specific email is set correctly. It's in the sfforums table in the forum_email column, in the UI, and also the little code test I made picks it up correctly when it sets reply-to.

Here are the settings for Forum/Options/Email settings in this screenshot (password blurred of course):

https://www.evernote.com/shard.....75271eb835

And for the forum itself in this one:

https://www.evernote.com/shard.....42e87c39f1

SMTP Plugin

Open to testing the SMTP plugin, although I'm not sure why it would make any difference. I will try it in a bit.

Code That Sets From?

Finally, my casual trip through the code doesn't reveal where the From address is being set by either PBE or Subscriptions. If convenient, I'd appreciate a pointer to where it is being set. Knowing that, maybe I can help resolve the issue with some tactical debug logging.

Thanks!

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 8:53 pm

are those email addresses on the same server?  you are telling sp to generally use an email address of:

corinne@phit-n-phat.com 

but the forums PBE stuff is to use

tech.support.issues@phit-n-phat.mailgun.org

two different domains... just want to make sure they are correct...

as to the from, you will have to look inside wp... we dont send the emails, wp does... so function wp_mail()...  in there you will see it assigning the from as WordPress@yourserver.com...  and slightly later will be these filters

    $phpmailer->From     = apply_filters( 'wp_mail_from'     , $from_email );
    $phpmailer->FromName = apply_filters( 'wp_mail_from_name', $from_name  );

and you will see we hook into this in sp_send_email()

which is probably the reason actually...  just notice on the the forum - options - email settings page, you didnt check the option to use the forum email settings...

 

Avatar
chris.crabtree
Member
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 9:03 pm

Ah, that certainly sounds like it could be the problem. :-)

Forgive my apparent blindness, however. I still do not even see the option there. I'm looking at the Forum/Options/Email Settings page, which includes three sections: New User Email, Email Address Settings, and Post By Email Settings.

I don't see any option on that page that refers to 'Use forum email settings'.

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 9:13 pm

on forum - options - email settings... the upper right hand corner section...  email address settings... option is 'use the following email settings'...

without that, you get the wp settings (ie wordpress@yoursite.com) or that added by another plugin such as smtp plugin...

Avatar
chris.crabtree
Member
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 9:32 pm

Oh, I had that turned off thinking that was what was making PBE use the global setting and not the per-forum From address.

Turning it back on now and testing, it is using the email address specified in Email Address Settings as the From address. This is not surprising, but it's also not what we want, right? We want the From address to be the forum-specific address.

In other words, the post I just received has this as its From header:

From: Phit-N-Phat <corinne@phit-n-phat.com>

And no Reply-To header (I removed the small code mod I had made).

And shouldn't it be the following for replies to work?
From: Phit-N-Phat <tech.support.issues@phit-n-phat.mailgun.org>

Should I blank out 'The email from name' and 'The email domain name' values so that it will pick up the forum-specific values maybe?

Thanks!

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 9:49 pm

I think I need Andy to weigh in tomorrow morning... 

looking through the code, it seems to me that the PBE plugin is missing a filter on the reply too...  or more exactly, it looks like the hook used in subscriptions changed at some point...  we extensively use the admin notifications PBE but dont personally use the subs one...

I need to run - Andy will get back with you... but if you want to try quick test, find this line in the pbe main plugin file:

add_filter('sph_email_replyto',                                        'sp_emailpost_replyto', 1, 2);

right after it, try adding this line:

add_filter('sph_email_replyto',                                        'sph_subscriptions_email_replyto', 1);

and see if that helps...  Andy will see if that is correct and enough...

Avatar
chris.crabtree
Member
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 10:12 pm

No change in behavior after applying the change. That 'sph_subscriptions_email_replyto' string is mysterious to me anyway, as referenced above. No other code references that filter tag, except for the sp_subscriptions_do_post_notifications() function and the code just added. And there is no function by that name.

So Reply-To here is still empty, which leaves only the sfmail options account as the From and therefore no forum-specific addresses.

It looks to me like sp-subscriptions-components.php/function sp_subscriptions_do_post_notifications() wants a real ReplyTo where it says:

# send the notification
$replyto = apply_filters('sph_subscriptions_email_replyto', '');

And so PBE should register a filter function on 'sph_subscriptions_email_replyto' to give it a forum-specific reply-to value. And maybe the same logic would apply for From values (not sure if filter ordering would make this tricky).

I see where you would not want to do the hack that I did to always give a forum-specific reply-to inside of the subscriptions code--this is exactly why you would want PBE to register its own filter, I think. (I have not actually gotten to filters yet in my PHP/WordPress learning, but that's my suspicion).

Thanks!

 

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Jan 22, 2013 - 10:39 pm

leave it me to type it in a rush as I had to run... what I wanted you to enter is

add_filter('sph_subscriptions_email_replyto',                                        'sp_emailpost_replyto', 1, 2);

but that wont be enough since it expects two args...   you would need to also edit subscriptions... find

            $replyto = apply_filters('sph_subscriptions_email_replyto', '');

and change to

            $replyto = apply_filters('sph_subscriptions_email_replyto', '', $newpost);

think that will do it...

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17363
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625