Changeset 5409
- Timestamp:
- 06/17/2014 04:04:29 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/includes/common/functions.php
r5311 r5409 983 983 984 984 /** 985 * Get the "Do Not Reply" email address to use when sending subscription emails. 986 * 987 * We make some educated guesses here based on the home URL. Filters are 988 * available to customize this address further. In the future, we may consider 989 * using `admin_email` instead, though this is not normally publicized. 990 * 991 * @since bbPress (r5409) 992 * 993 * @return string 994 */ 995 function bbp_get_do_not_reply_address() { 996 $email = 'noreply@' . str_replace( 'www.', '', ltrim( get_home_url(), '^(http|https)://' ) ); 997 return apply_filters( 'bbp_get_do_not_reply_address', $email ); 998 } 999 1000 /** 985 1001 * Sends notification emails for new replies to subscribed topics 986 1002 * … … 1063 1079 $reply_url = bbp_get_reply_url( $reply_id ); 1064 1080 $blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); 1065 $do_not_reply = '<noreply@' . ltrim( get_home_url(), '^(http|https)://' ) . '>';1066 1081 1067 1082 // For plugins to filter messages per reply/topic/user … … 1096 1111 /** Users *****************************************************************/ 1097 1112 1098 // Array to hold BCC's 1099 $headers = array(); 1113 // Get the noreply@ address 1114 $no_reply = bbp_get_do_not_reply_address(); 1115 1116 // Setup "From" email address 1117 $from_email = apply_filters( 'bbp_subscription_from_email', $no_reply ); 1100 1118 1101 1119 // Setup the From header 1102 $headers [] = 'From: ' . get_bloginfo( 'name' ) . ' ' . $do_not_reply;1120 $headers = array( 'From: ' . get_bloginfo( 'name' ) . ' <' . $from_email . '>' ); 1103 1121 1104 1122 // Get topic subscribers and bail if empty … … 1123 1141 1124 1142 // Custom headers 1125 $headers = apply_filters( 'bbp_subscription_mail_headers', $headers ); 1143 $headers = apply_filters( 'bbp_subscription_mail_headers', $headers ); 1144 $to_email = apply_filters( 'bbp_subscription_to_email', $no_reply ); 1126 1145 1127 1146 do_action( 'bbp_pre_notify_subscribers', $reply_id, $topic_id, $user_ids ); 1128 1147 1129 1148 // Send notification email 1130 wp_mail( $ do_not_reply, $subject, $message, $headers );1149 wp_mail( $to_email, $subject, $message, $headers ); 1131 1150 1132 1151 do_action( 'bbp_post_notify_subscribers', $reply_id, $topic_id, $user_ids ); … … 1203 1222 $topic_url = get_permalink( $topic_id ); 1204 1223 $blog_name = wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ); 1205 $do_not_reply = '<noreply@' . ltrim( get_home_url(), '^(http|https)://' ) . '>';1206 1224 1207 1225 // For plugins to filter messages per reply/topic/user … … 1236 1254 /** User ******************************************************************/ 1237 1255 1238 // Array to hold BCC's 1239 $headers = array(); 1256 // Get the noreply@ address 1257 $no_reply = bbp_get_do_not_reply_address(); 1258 1259 // Setup "From" email address 1260 $from_email = apply_filters( 'bbp_subscription_from_email', $no_reply ); 1240 1261 1241 1262 // Setup the From header 1242 $headers[] = 'From: ' . get_bloginfo( 'name' ) . ' ' . $do_not_reply;1263 $headers[] = array( 'From: ' . get_bloginfo( 'name' ) . ' <' . $from_email . '>' ); 1243 1264 1244 1265 // Get topic subscribers and bail if empty … … 1263 1284 1264 1285 // Custom headers 1265 $headers = apply_filters( 'bbp_subscription_mail_headers', $headers ); 1286 $headers = apply_filters( 'bbp_subscription_mail_headers', $headers ); 1287 $to_email = apply_filters( 'bbp_subscription_to_email', $no_reply ); 1266 1288 1267 1289 do_action( 'bbp_pre_notify_forum_subscribers', $topic_id, $forum_id, $user_ids ); 1268 1290 1269 1291 // Send notification email 1270 wp_mail( $ do_not_reply, $subject, $message, $headers );1292 wp_mail( $to_email, $subject, $message, $headers ); 1271 1293 1272 1294 do_action( 'bbp_post_notify_forum_subscribers', $topic_id, $forum_id, $user_ids );
Note: See TracChangeset
for help on using the changeset viewer.