By default, WordPress sends emails using the built-in wp_mail()
function with a generic [email protected]
sender. If you want to modify the sender email and name for Eventin’s ticket emails, you can use a third-party plugin like WP Mail SMTP or add custom code in the theme’s functions.php
file.
Method 1: Using WP Mail SMTP Plugin #
WP Mail SMTP allows you to send emails via an SMTP server, improving deliverability and letting you customize the sender email.
Steps: #
1. Install and Activate WP Mail SMTP #
- Go to Plugins > Add New.
- Search for “WP Mail SMTP”.
- Install and activate the plugin.
2. Configure SMTP Settings #
- Navigate to WP Mail SMTP > Settings.
- Choose PHP mailer as the default mailer
- Set the From Email (e.g.,
[email protected]
). - Set the From Name (e.g.,
Your Brand Name
). - Save changes.
Method 2: Custom Code in functions.php #
If you prefer a code-based approach, you can modify the email headers for Eventin ticket emails directly in your theme’s functions.php
file.
Steps: #
- Open your theme’s
functions.php
file. or use any third party snippet plugin like “Code Snippets” - Add the following code to override the sender details and modify the parameter’s like the from_email, from_name etc.
add_filter( 'eventin_email_headers', 'modify_eventin_email_headers', 11 );
function modify_eventin_email_headers( $headers ) {
$from_email = '[email protected]';
$from_name = 'Your Brand Name';
$reply_to_email = '[email protected]';
$headers[] = 'From: ' . $from_name . ' <' . $from_email . '>';
if ( ! empty( $reply_to_email ) ) {
$headers[] = 'Reply-to: ' . $reply_to_email;
}
return $headers;
}
Conclusion #
By following either of these methods, you can ensure that Eventin ticket emails are sent from a professional email address rather than the default WordPress email. The WP Mail SMTP plugin is recommended for better email deliverability, while the custom code method provides a lightweight solution for developers.