• I know that there are plugins out there that will override the default “wordpress@” when mail is sent, however, I’ve tried several of them and found that they override ALL emails sent by the site. this is undesirable as things like contact form 7 send mail as the user filling out the form rather than as the site (so you can reply). I was wondering if there was a plugin, or a way to tweak a plugin to detect if it’s set, and only override it if it isn’t (like how the core does it). would be so much easier if the folks at WP would just make the from name and from address be a configurable option rather than having it hardcoded in wp-includes/pluggable.php

    thank you in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • By convention, functions in ‘pluggable.php’ can be overwritten by you. That is why they are “pluggable”. You can copy the function to, say, your functions.php, change it as you like, and it should work.

    However, you also have the ‘wp_mail’, ‘wp_mail_from’, and ‘wp_mail_from_name’ hooks (and some you don’t need) to work with.

    Thread Starter luckdragon

    (@luckdragon)

    right, however the wp_mail_from and wp_mail_from_name override all emails, I don’t know how to pass the “from” information to them so that they can determine whether it’s set or not

    Put var_dump(get_defined_vars()); in a function, hook it to ‘wp_mail_from’ and see what you have to work with by default. Then try, for example, global $_POST; or global $_REQUEST; until you find something you can use. Then you build an if/elseif/else conditional, or a switch conditional.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘wp_mail "wordpress" override’ is closed to new replies.