• Resolved the_webscaper

    (@the_webscaper)


    Hey Stephen,

    Not sure if this is a support request or a feature request, so I’m posting it here.

    Had an issue this morning regarding how the Email Volunteers function works in the plugin, and unless I’m blatantly missing something, I think this is something that should be changed.

    Although under settings in the PTA Sign Up Sheets plugin you can set the FROM email address for confirmation and reminders, that email address apparently does NOT carry through to the Email Volunteers function.

    An event chair needed to urgently cancel at the last minute an event today due to bad weather, so she contacted me (the website consultant), because she doesn’t have access to the admin dashboard (most one-time event chairs do not).

    I sent out the urgent cancellation email, putting her email address in the reply-to line. All of the emails went out with the giant phishing warning due to MY email address not matching the domain of the reply-to address; screenshot here:
    https://prntscr.com/nug4ez

    So I resent with my email address as the reply-to as well (despite the fact that my email address should NOT be used anywhere for school communication – I’m a consultant, not a PTO member). Then we got the spoofing warning instead, because my email address doesn’t match the domain. screenshot: https://prntscr.com/nug8hw

    I’m not sure why the Email Volunteers function forces to send from the email address of the person LOGGED IN rather than the email address set up in the Sign Up Sheets email settings; or at least give the option to change it on the Email Volunteers screen. There are many scenarios where the person who has rights to log in and manage sheets/emails/whatever is not the person who the email from address should be. Furthermore, even if those volunteers DO have the access to send their own, MOST of them do NOT have email addresses at the domain of the website – they’re just using their personal email addresses, so they would have the same problem that I am.

    At the very least, the default email address for the website (settings > General) should be used by default OR at least be an option to select, since that email address IS a domain-branded email.

    Thanks for reading and considering.

    Kym

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author DBAR Productions

    (@dbar-productions)

    You are mistaken. My plugin is not forcing to send from the email address of the person logged in.

    Most likely, you have some other plugin that you are using to replace the WordPress wp_mail function, such as some kind of SMTP plugin to send emails via SMTP, and you have that configured wrong, or it is not working correctly. My plugin does NOT actually send emails, but it puts the info together and passes it to the WordPress wp_mail function. Many people choose to replace the wp_mail function with SMTP plugins (or some other mail service, like Mailgun), and I can’t control what any of those other plugins are doing. They should still honor the parameters passed to the wp_mail function for the addresses/headers.

    You can look at my emails class code, which generates all the info to pass to wp_mail, and see exactly what I’m passing, which is taken from the options set in the settings (has nothing to do with whoever is logged in). In particular, these bits of code show where the email addresses come from for the “from” and “reply-to” addresses:

    
    $from = apply_filters('pta_sus_from_email', $this->email_options['from_email'], $signup, $task, $sheet, $reminder, $clear);
            if (empty($from)) $from = get_bloginfo('admin_email');
    
    
    if(isset($this->email_options['replyto_chairs']) && true == $this->email_options['replyto_chairs'] && !empty($chair_emails)) {
    	        $replyto = apply_filters('pta_sus_replyto_chair_emails', $chair_emails, $signup, $task, $sheet, $reminder, $clear);
    	    } else {
    		    $replyto = apply_filters('pta_sus_replyto_email', $this->email_options['replyto_email'], $signup, $task, $sheet, $reminder, $clear);
    	    }
    	    
    	    if (empty($replyto)) $replyto = get_bloginfo('admin_email');
    

    In both cases, my code is checking the various options to see if you have set a from or reply-to address (or set the option to reply to the “chairs” for an event). If none of those have been set, then it defaults to the admin_email for your WordPress site.

    So, the short answer is, you need to look elsewhere, because it’s not my plugin that is changing those. I’m setting it up exactly the way you specified in your email.

    Plugin Author DBAR Productions

    (@dbar-productions)

    Ooops! Sorry! Read your post too quickly, before having my coffee, and my brain isn’t functioning yet. =)

    I missed the part that you were using the simple form to email volunteers from the admin side, which, of course, makes sense based on what you were trying to do.

    Yes, the admin form ignores the settings for the automated emails as it’s a separate thing. That form was a feature request from someone else, that was added in the last year or so, and we kept it simple. At the time, it was assumed that they wanted the From address to be the email of the person actually filling out and sending the form, which is why it uses the logged in user’s email (although you can specify a reply-to, and that is working as it should).

    But, in light of “overly protective” services like Gmail that like to put those warnings in your emails when things don’t match what it expects, that is something I can revisit as a new feature request, and add a field where you could specify the from email on that form itself (since it doesn’t use the above mentioned functions and code that the automated emails use).

    Thread Starter the_webscaper

    (@the_webscaper)

    Hi Stephen,

    Appreciate the quick response, and please understand I’m not pointing fingers here. Just letting you know about a situation we’re having and appreciate any help.

    I understand what you’re saying and while I’m not a programmer, I can see that it appears that ‘admin_email’ should be sending the email (if I’m reading that code correctly). That’s definitely not what happened; the email came from my personal email address.

    However, there are no SMTP mailer plugins installed on this website, nor any plugins that would have any reason to be changing the FROM email address. I’ve pasted all of the plugins installed on the website at the bottom of this email for your reference. Even if we DID have an SMTP plugin, we would never configure it to use my personal email address on anything.

    So I wanted to do a second test to see if we can figure out what is happening. I created a secondary Admin account with a different email address, and a dummy sign up sheet so I could test sending a volunteer reminder while logged into that secondary admin account.

    This time, I got an error when trying to send the reminder:
    THE WORDPRESS MAIL FUNCTION REPORTED A PROBLEM SENDING ONE OR MORE EMAILS.
    screenshot: https://prntscr.com/nuhd1z

    I then checked the “Send Individual Emails” box (which is what I had used the first time), and the email DID send, but as you can see below, it sent from the email address of the logged in user again:
    https://prntscr.com/nuhfxp

    The fact that the error says “WordPress Mail Function…” tells me that it is indeed WordPress sending the emails (which I knew, as we don’t have any SMTP plugins).

    Again, I understand what you’re saying that your plugin should be working in the way I originally described, but for some reason, it is not on this site.

    Any thoughts would be appreciated!

    Kym

    Plugins installed on the website:

    gravityperks/gravityperks.php, gravityforms/gravityforms.php, all-in-one-event-calendar/all-in-one-event-calendar.php, backupbuddy/backupbuddy.php, black-studio-tinymce-widget/black-studio-tinymce-widget.php, bulk-actions-pro-for-gravity-forms/bulk-actions-pro-for-gravity-forms.php, classic-editor/classic-editor.php, conditional-tags-shortcode/init.php, duplicate-post/duplicate-post.php, erident-custom-login-and-dashboard/er-custom-login.php, foobox-image-lightbox/foobox-free.php, foogallery/foogallery.php, genesis-simple-sidebars/plugin.php, gp-limit-submissions/gp-limit-submissions.php, gp-nested-forms/gp-nested-forms.php, gravity-forms-pdf-extended/pdf.php, gravityformspaypal/paypal.php, gravityformsstripe/stripe.php, gravitywp-css-selector/gravitywp-css-selector.php, mailchimp-for-wp/mailchimp-for-wp.php, mainwp-child-reports/mainwp-child-reports.php, mainwp-child/mainwp-child.php, members/members.php, pta-volunteer-sign-up-sheets/pta-volunteer-sign-up-sheets.php, recent-posts-widget-extended/rpwe.php, sg-cachepress/sg-cachepress.php, shortcodes-ultimate/shortcodes-ultimate.php, soliloquy/soliloquy.php, sucuri-scanner/sucuri.php, svg-support/svg-support.php, ultimate-auction-pro/ultimate-auction-pro.php, ultimate-member/ultimate-member.php, user-role-editor/user-role-editor.php, velvet-blues-update-urls/velvet-blues-update-urls.php, widget-options/plugin.php

    Thread Starter the_webscaper

    (@the_webscaper)

    Hey Stephen – just saw you replied while I was typing so our messages crossed.

    Glad I’m not crazy at least!

    Yes, if you could consider this for a future update, that would be great. Again, even when *I*, the consultant, am not the one trying to send out, even if it’s the actual event chair sending out the reminder, 9 times out of 10 they do NOT have a branded email address matching the site domain, so Google is going to scream and holler and throw reminders in the spam folder.

    We did use the reply-to feature – but again, if the event chair doesn’t have a branded email, it’s still going to make Google mad. Even so I think it’s preferable to send the email from the Admin (or other domain-branded email address – like the VP of Volunteers) and then use the reply-to optionally. Giving the option what email address it sends from – with the default email address (either admin, OR the email address set in the Sign Up Sheets Email Settings) being pre-filled.

    Thank you!!!

    Kym

    Plugin Author DBAR Productions

    (@dbar-productions)

    You probably were typing your reply when I sent my other reply about adding a from email address field, which is relatively easy to do, and something I already did and will release as an update later (haven’t pushed out an update for a while, so need to update the test up to WP version as well).

    However, also note that the “error” message you just got when trying to send all the emails at once is something that my plugin generates if it receives a FALSE value back from the wp_mail function. It doesn’t mean that you can’t have another plugin still replacing the wp_mail function. I had that issue come up with another site that was using a third party email service that wasn’t returning a true or false value to let my plugin know that emails were sent without any errors. Since the wp_mail function returns true or false type values, then any other plugin/function that replaces it should also do the same (this particular one did not, and they ended up fixing theirs after I pointed this out).

    But, since you aren’t using any other plugins to take over email, that means that you encountered the problem that some servers seem to have with not liking the way that multiple emails are formatted in the CC or BCC header fields. Although I do it exactly the way that the WordPress codex for the wp_mail function specifies, there are certain server configurations that don’t like that (by default, WordPress is using the simple PHP Sendmail to send email as your server, which is a horrible way to do things anyway, and why I usually recommend to use a SMTP plugin anyway for more reliable delivery). This is why I have included the option to send emails one at a time instead of trying to put multiple emails into a CC or BCC field… it’s just a small number of server configurations where this seems to be an issue. This has happened several times, so I made a sticky post on my site with much more detail:

    https://stephensherrardplugins.com/support/topic/error-sending-email/

    Plugin Author DBAR Productions

    (@dbar-productions)

    In the code I just updated (not released yet), I have it set so that the FROM email address will get filled with the email of the user currently logged in (so it still matches how it worked before), but you can either replace that with another email, or set it to blank to use the admin email.

    Thread Starter the_webscaper

    (@the_webscaper)

    Thanks, Stephen — I appreciate the super quick replies, all of your information/explanation, and adding the functionality to override the email address!

    Thank you!!

    Kym

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Email Volunteers – From Email address’ is closed to new replies.