Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notification incorrect from email - FIXED #26

Merged
merged 1 commit into from
Mar 23, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions change_log.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v1.0.6
Notification incorrect from email - FIXED

v1.0.5
Email notifications not working - FIXED
Compliment line break and clickable support removed. Use filter to override - CHANGED
Expand Down
36 changes: 35 additions & 1 deletion includes/bp-compliments-notifications.php
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,40 @@ function bp_compliments_new_compliment_email_notification($args = array()) {
%s', 'bp-compliments' ), $settings_link );
}

// check for GeoDirectory plugin settings first
if (function_exists('geodir_sendEmail')) {
$sitefromEmail = get_option('site_email');
$sitefromEmailName = get_site_emailName();
} else {
$sitefromEmail = get_option( 'admin_email' );
$sitefromEmailName = stripslashes(get_option('blogname'));
}


/**
* Filters the notification from email.
*
* @since 1.0.6
* @package BuddyPress_Compliments
*
* @param string $sitefromEmail Notification from email.
*/
$sitefromEmail = apply_filters( 'bp_compliments_notification_from_email', $sitefromEmail );

/**
* Filters the notification from name.
*
* @since 1.0.6
* @package BuddyPress_Compliments
*
* @param string $sitefromEmail Notification from name.
*/
$sitefromEmailName = apply_filters( 'bp_compliments_notification_from_name', $sitefromEmailName );

$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n";
$headers .= 'From: ' . $sitefromEmailName . ' <' . $sitefromEmail . '>' . "\r\n";

// Send the message

/**
Expand Down Expand Up @@ -224,7 +258,7 @@ function bp_compliments_new_compliment_email_notification($args = array()) {
* @param string $compliment_link Compliment Link.
*/
$message = apply_filters( 'bp_compliments_notification_message', $message, $sender_name, $compliment_link );
wp_mail( $to, $subject, $message );
wp_mail( $to, $subject, $message, $headers );
}

/**
Expand Down