rohmann / global-smtp

WordPress Global SMTP
62 stars 27 forks source link

Still overwrites GLOBAL_SMTP_FROM and GLOBAL_SMTP_FROM_NAME #5

Closed Surbma closed 9 years ago

Surbma commented 9 years ago

Hi,

I thought I open a new issue for the version 2.0. So my problem is the same, it is still overwrites a contact form's sender details, like reported in this issue: https://github.com/rohmann/wp-multisite-smtp/issues/1

The solution is the same for now, I have commented out the 2 variables. I hope there will be a fix for this issue!

Thank you very much!

Surbma commented 9 years ago

I think these filters should be used: wp_mail_from wp_mail_from_name

nickd32 commented 9 years ago

I had this same problem. Emails being sent from a child site still show the primary site as the sender. As a bit of a hack, I modified lines 71 and 72 of smtp.php to pull the name/email from the child site instead.

// 'GLOBAL_SMTP_FROM' => get_site_option('admin_email','',true),
// 'GLOBAL_SMTP_FROM_NAME' => get_site_option('site_name','WordPress',true),
'GLOBAL_SMTP_FROM' => get_option('admin_email',''),
'GLOBAL_SMTP_FROM_NAME' => get_option('blogname','WordPress'),

This partially works. It fixes the name, but the sender email is still the global email we set up. Perhaps I'll just add something like this:

'GLOBAL_SMTP_REPLYTO_FROM' => get_option('admin_email',''),
Surbma commented 9 years ago

@nickd32 This issue is about OVERWRITING, not about wrong datas. You have a different problem, so you need to open a new issue for your problem.

My problem is, that when I use a form on my site and I give a sender for the notification email, this plugin is overwriting the form's settings. At least it is happening with Gravity Forms.

@rohmann This problem is reported on Oct 6 2013 by me. Is there a chance to have a solution for this? I would pay for this also, as I use this plugin on a very high traffic multisite with a lot of client websites. Please let me know!

Thank you!

rohmann commented 9 years ago

Hey guys,

I'm sorry I let this go unmaintained for so long. Fix incoming. This plugin will now use those filters to set the from email and name via the constants. It does so early on so other plugins will have a chance to provide new values.

Surbma commented 9 years ago

Hi @rohmann,

thank you for the update!

It seems everything is working now IF GLOBAL_SMTP_FROM and GLOBAL_SMTP_FROM_NAME is defined in the wp-config.php file. If they are not defined, the mail is not sent.

rohmann commented 9 years ago

Can you check spam? I tested this and it works without those constants defined. It will use whatever is passed through the WordPress filters. The default "from name" is "WordPress" and the default "from address" would be your site admin address. If that site admin address doesn't have SPF records configured on the domain you could have the emails going to spam.

Surbma commented 9 years ago

Yes, spam was checked also. No mail has been sent, when those constants are not defined.

rohmann commented 9 years ago

Let's continue over on #8 so we're not having separate conversations.