• Resolved tenp

    (@tenp)


    For branding reasons I’d like to be able to change this to the company name and specific email address rather than just have it pulled from the admin settings.

    Where exactly would I need to make these edits?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael Beckwith

    (@tw2113)

    The BenchPresser

    We don’t have anything set up for that header for emails, so the best I can offer is filtering the following from right at the top of the wp_mail() function.

    /**
      * Filters the wp_mail() arguments.
      *
      * @since 2.2.0
      *
      * @param array $args A compacted array of wp_mail() arguments, including the "to" email,
      *                    subject, message, headers, and attachments values.
      */
      $atts = apply_filters( 'wp_mail', compact( 'to', 'subject', 'message', 'headers', 'attachments' ) );
    

    If I’m understanding it correctly, a callback for the filter will receive a single array that holds values from each param in the compact() call.

    BuddyPress Registration Options only sets a to, subject, and message in our usage, so the headers array index will be empty for the emails we send out, unless something is filtered in by you.

    DO note that adding a callback to this would affect ALL emails going out, unless you can work out a way to conditionally set them. I realize that our plugin doesn’t help there at the moment, but we also don’t get many requests for this type of thing, so it just never came up.

    Thread Starter tenp

    (@tenp)

    Thanks so much for your help, Michael.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change ‘From’ WordPress@ in emails’ is closed to new replies.