Changing “From” and Email Address on RSVP Emails

When an email is sent from a WordPress site, then usually the sender shows up like this:

From: WordPress <wordpress@yourdomain.com>

This will also be the case if the website visitors RSVP to an event. They will get a confirmation from the above email address, which might be confusing because, well, who is this “WordPress” person, right?

The below snippet will help you change that to something more recognizable.

Usage

Copy the below code into your theme’s functions.php file (or wherever you usually put custom code.

Plugins

  • Event Tickets

Snippet

// Add a custom "from" name and email to the rsvps
add_filter( 'tribe_rsvp_email_headers', function() {
	// Set the from name
	$name  = 'Name';

	// Set the from email address
	$email = 'email@domain.com';

	return 'Content-type: text/html' . "\r\n" . "From: $name <$email>" . "\r\n";
} );

Notes

  • Originally written in November 2018
  • Tested with Event Tickets 4.11.3.1
  • Author: András Guseo

Table of Contents

Details

Report an issue