Skip to content

Commit

Permalink
Merge pull request #5795 from Automattic/develop
Browse files Browse the repository at this point in the history
Staging release v20240813.2
  • Loading branch information
rebeccahum authored Aug 13, 2024
2 parents 2a778b9 + 861d8aa commit 1c8279e
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions vip-dashboard/vip-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* Domain Path: /languages/
*/

const VIP_SUPPORT_EMAIL = '[email protected]';

/**
* Boot the new VIP Dashboard
*
Expand Down Expand Up @@ -97,7 +99,6 @@ function vip_contact_form_handler() {
die();
}

$vipsupportemailaddy = '[email protected]';
$cc_headers_to_kayako = '';

$current_user = wp_get_current_user();
Expand Down Expand Up @@ -177,16 +178,18 @@ function vip_contact_form_handler() {

// Filter from name/email. NOTE - not un-hooking the filter because we die() immediately after wp_mail()
add_filter( 'wp_mail_from', function () use ( $email ) {
return $email;
return VIP_SUPPORT_EMAIL;
}, PHP_INT_MAX );

add_filter( 'wp_mail_from_name', function () use ( $name ) {
return $name;
}, PHP_INT_MAX );

$headers = "From: \"$name\" <$email>\r\n";
$headers = "From: \"$name\" <" . VIP_SUPPORT_EMAIL . ">\r\n";
$headers .= "Reply-To: $email\r\n"; // Add the Reply-To header so ZD can map correct email

// phpcs:ignore WordPressVIPMinimum.Functions.RestrictedFunctions.wp_mail_wp_mail
if ( wp_mail( $vipsupportemailaddy, $subject, $content, $headers . $cc_headers_to_kayako ) ) {
if ( wp_mail( VIP_SUPPORT_EMAIL, $subject, $content, $headers . $cc_headers_to_kayako ) ) {
$return = array(
'status' => 'success',
'message' => __( 'Your support request is on its way, we will be in touch soon.', 'vip-dashboard' ),
Expand Down Expand Up @@ -247,7 +250,7 @@ function vip_echo_mailto_vip_hosting( $linktext = 'Send an email to VIP Hosting.
$url = add_query_arg( array(
'subject' => rawurlencode( __( 'Descriptive subject please', 'vip-dashboard' ) ),
'body' => rawurlencode( $email ),
), 'mailto:[email protected]' );
), 'mailto:' . VIP_SUPPORT_EMAIL );

$html = '<a href="' . esc_url( $url ) . '">' . esc_html( $linktext ) . '</a>';

Expand Down

0 comments on commit 1c8279e

Please sign in to comment.