• Resolved ImageAethon

    (@aethon)


    I believe that it’s currently using my admin email – which is a gmail address and not using the domain of our site. Combined with WP Mail SMTP, and using Office 365 to send our domain emails, my gmail address is causing mail errors.

    I could possibly get a new admin email at the domain itself, but it would be a bit of a hassle — and if I can simply tell WPForms to use a different FROM email, that would be simplest.

    Csn I do this? We are using WPForms Lite, for the record.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support ImageRalden Souza

    (@rsouzaam)

    Hi @aethon,

    I understand that you want to change the “From Email” for the Weekly WPForms Summary Emails. We don’t currently have a built-in feature for this.

    However, you should be able to change the “From Email” address for summary emails using a code snippet like this one:

    /**

    * This function runs right before the WPForms summary email is generated.

    * It adds a filter to change the default 'From' address.

    */

    function wpf_add_summary_from_address_filter() {

    add_filter( 'wpforms_emails_mailer_get_from_address', 'wpf_set_custom_summary_from_address' );

    }

    // Hook before the WPForms function runs (priority < 10).

    add_action( 'wpforms_email_summaries_cron', 'wpf_add_summary_from_address_filter', 5 );

    /**

    * This is the callback function that actually sets our desired 'From' address.

    *

    * @param string $from_address The original 'From' address.

    * @return string The new 'From' address.

    */

    function wpf_set_custom_summary_from_address( $from_address ) {

    // --> IMPORTANT: Change this to your desired sending email address.

    // This should be an address on your domain, e.g., 'no-reply@your-domain.com'.

    return 'wordpress@your-domain.com';

    }

    /**

    * This function runs after the WPForms summary email has been sent.

    * It removes our custom filter to ensure it doesn't affect any other emails.

    */

    function wpf_remove_summary_from_address_filter() {

    remove_filter( 'wpforms_emails_mailer_get_from_address', 'wpf_set_custom_summary_from_address' );

    }

    // Hook after the WPForms function has run (priority > 10).

    add_action( 'wpforms_email_summaries_cron', 'wpf_remove_summary_from_address_filter', 20 );

    This ensures the emails are sent from a valid address on your domain (like noreply@yourdomain.com) instead of the WordPress admin’s email.

    In case it helps, here’s our tutorial with the most common ways to add custom code like this.

    For the most beginner-friendly option in that tutorial, I’d recommend using the WPCode plugin.

    I hope that helps!

    Plugin Support ImageRalden Souza

    (@rsouzaam)

    Hi @aethon,

    We haven’t heard back from you in a few days, so I’m going to go ahead and close this thread for now. But if you’d like us to assist further, please feel welcome to continue the conversation.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.