Tag Info

Hot answers tagged

22

Hi @helenyhou: You can set the header, just not with a parameter. WordPress uses "hooks" and the hooks you need are 'wp_mail_from' and 'wp_mail_from_name' hooks. Here are the hooks you might add to your theme's functions.php file to modify the "From:" header when using wp_mail() to the email address Helen Hou-Sandi <helenyhou@example.com>: ...


22

the new user email is sent using wp_new_user_notification() function which is pluggable meaning that you can overwrite it: // Redefine user notification function if ( !function_exists('wp_new_user_notification') ) { function wp_new_user_notification( $user_id, $plaintext_pass = '' ) { $user = new WP_User($user_id); $user_login = ...


17

I use a very similar approach like John P Bloch and Bainternet, just a little bit more flexible, so I don’t have to change the mail address for any client: <?php # -*- coding: utf-8 -*- /* * Plugin Name: T5 Filter System From Mail * Description: Sets the WP from mail address to the first admin’s mail and the from name to blog name. * Plugin URI: ...


10

There's a few plugins that handle email notifications, but they all seem to act like a subscription service for (all) WordPress users. To notify just you when a post or page is published, it's literally a few lines of code. function __notify_admin_on_publish( $new_status, $old_status, $post ) { if ( $new_status != 'publish' || $old_status == 'publish' ...


7

you got the first part right about using personal_options_update but to be on the safe side add edit_user_profile_update also. and as for sending emails within WordPress the best way would be to use wp_mail, So something like this: add_action( 'personal_options_update', 'notify_admin_on_update' ); add_action( ...


5

You can change them using a filter. The filter hooks you want to use are: For the first email message (confirming they really want to reset the password): 'retrieve_password_title' 'retrieve_password_message' For the follow-up email message (sending the new username and password): 'password_reset_title' 'password_reset_message' ...


5

Like SickHippie posted this functionality is native to WordPress but only for a multisite setup so here is the two functions you need to get this to work on a single site setup which are mostly code one for one from the core /wp-admin/user-edit.php file function custom_send_confirmation_on_profile_email() { global $errors, $wpdb; $current_user = ...


4

The best WordPress plugin for email subscriptions to your blog without using third party services like Feedburner is the WP Responder Email Newsletter and Autoresponder Plugin


4

SB Welcome Email Editor works by replacing wp_new_user_notification() with an own version. The original version can be found in wp-includes/pluggable.php, the plugin uses an elaborate replacement with all kinds of options. You can do this to: create a new plugin (just a PHP file in wp-content/plugins/), and define wp_new_user_notification($user_id, ...


4

wp_users is the primary table, with a fixed list of columns. wp_usermeta is an additional table for storing arbitrary information (custom fields). The wp_users table already has a user_email column, so I don't know why the plugin uses wp_usermeta. I guess the best person to ask would be the plugin author himself.


4

This is actually not all that hard to do using the imap functions in PHP: http://php.net/manual/en/book.imap.php Basically, he has some script somewhere which runs every hour or so. I have not seen this script, but I can venture a good guess about how it works. First, it connects to his email system, probably using imap. Second, it performs some set of ...


4

As far as I know stats are not really inherent feature of email. In comments under Email Graphs post about this feature Otto says that stats are pulled out of database. So they are somehow tracked in first place, which has little to do with WordPress. It depends on what you use for your email account and server (if not from some free service).


4

There's a great plugin that does this for you called Send From. However, if you want to roll this yourself, it's dead simple. To change the email address add a filter on 'wp_mail_from' like so: function just_use_my_email(){ return 'my.email@domain.com'; } add_filter( 'wp_mail_from', 'just_use_my_email' ); And you can also change the sender's name using ...


4

First add your email processing function and hook it to wp_ajax hooks like this using your functions.php: //if you want only logged in users to access this function use this hook add_action('wp_ajax_mail_before_submit', 'send_AJAX_mail_before_submit'); //if you want none logged in users to access this function use this hook ...


4

global $wpdb, $post; $query = sprintf("SELECT comment_author_email FROM {$wpdb->comments} JOIN {$wpdb->posts} ON {$wpdb->posts}.ID = {$wpdb->comments}.comment_post_ID WHERE comment_post_ID = %d AND comment_approved = '1'", $post->ID); ...


4

When a post is submitted by email and published WordPress Runs an action hook named 'publish_phone' so you can get the post there and change its type like this: add_action('publish_phone','custom_type_by_mail'); function custom_type_by_mail($post_id){ $p = get_post($post_id,'ARRAY_A'); $p['post_type'] = "YOUR_CUSTOM_TYPE_NAME_HERE"; ...


4

Your best bet would be a plugin called WP Mail SMTP, though it's only marked as being compatible as of WP 3.2.1 (but it should reasonably work with WP 3.3.1). Just to define the process ... Visitor enters site and fills out form on your page. User submits the form, which is transmitted to your server via a secure connection (HTTPS). Your server packages ...


4

You need to use wp_update_user() for the email, as it is not user-meta but core user data. The code should look something like this: $args = array( 'ID' => $current_user->id, 'user_email' => esc_attr( $_POST['user_email'] ) ); wp_update_user( $args ); Note: that's untested, but it should work out of the box.


4

It's possible, you must change the filter for the name. // remove the default filter remove_filter( 'authenticate', 'wp_authenticate_username_password', 20, 3 ); // add custom filter add_filter( 'authenticate', 'fb_authenticate_username_password', 20, 3 ); function fb_authenticate_username_password( $user, $username, $password ) { // If an email ...


4

No need for plugin here are a few lines of code you can modify and paste in your themes functions.php file and you will get a new email whenever a post is published: add_action('publish_post', 'send_admin_email'); function send_admin_email($post_id){ $to = 'admin@email.here'; $subject = 'mail subject here'; $message = "your message here ex: new ...


4

Function wp_new_user_notification is pluggable. It means that you can override it by declaring your version of this function in your plugin/theme. So, if you wish to disable all notifications completely, do it like this: if ( !function_exists( 'wp_new_user_notification' ) ) : function wp_new_user_notification( $user_id, $plaintext_pass = '' ) { return; ...


3

Well, if you're using the From: "Your Name" <youremail@example.com>\r\n format in your headers, you shouldn't be having a problem (unless you have a plugin installed which overrides the wp_mail function). However, as Mike said, you can filter the ultimate values with those filters, or you can just install this plugin: Send From It'll give you an ...


3

There are a few plugins that offer that capability. Look at Postie for example. Austin Passy did presentations at a couple WordCamps last year demonstrating how to set up the plugin. There's a video on wordpress.tv of his presentation at WordCamp PDX.


3

Dirty hack, feel free to modify. Only admins or users with edit_users cap "can change" email, others can't. Theme functions.php: class Edit_Email { function start() { ob_start(); } function footer() { $content = ob_get_contents(); ob_end_clean(); $this->replace( $content ); echo $content; } ...


3

here: //email from name function function my_wp_mail_from_name($name) { return 'Name'; } //email from email function function my_wp_mail_from($content_type) { return 'email@Domain.com'; } add_filter('wp_mail_from','my_wp_mail_from'); add_filter('wp_mail_from_name','my_wp_mail_from_name'); Change Name to the name you want and email@Domain.com ...


3

I'd say there's three specific requirements here; Allow users to choose notification times, timezone aware Hook into transition_post_status to listen up for new posts, and then take action Find a decent SMS API For 1), hook into show_user_profile to output your time picker field(s), and personal_options_update to save them. You could detect the user's ...


3

You'll need to set up a cron job that checks once a day to see if the latest post is more than seven days old. So, some where in a plugin file. Schedule a new event. Then hook into that event. Grab the post date, turn it into a unix time stamp, and compare that with the current time. <?php register_activation_hook( __FILE__, 'wpse29671_activation' ...


3

You are probably looking for the user_exists function. http://codex.wordpress.org/Function_Reference/email_exists This function will check whether or not a given email address ($email) has already been registered to a username, and returns that users ID (or false if none exists). If the email address does not exist (user_exists returns false), you may ...


3

If you plan to use this code on frontend, I would check if email is free to use. Otherwise, you are creating a security hole. if (isset( $_POST['email'])) { // check if user is really updating the value if ($user_email != $_POST['email']) { // check if email is free to use if (email_exists( $_POST['email'] )){ // ...


3

First: Don’t use mail(). Use wp_mail() instead. wp_mail( // Send it to yourself get_option( 'admin_email' ), 'Your subject', 'Your message', // extra headers array ( 'Bcc:' . implode( ",", $usersarray ), 'From:' . get_option( 'admin_email' ) ) );



Only top voted, non community-wiki answers of a minimum length are eligible