Pre-requisites
When sending emails through your WordPress site, you have two common options, both of which are covered in posts on this website:
- Sending Emails via Postfix (VPS)
- With this method, your emails are sent directly through Postfix, a mail server installed on your VPS.
- Emails will use your domain signature (e.g.,
wordpress@nathabee.de
). - Learn how to configure this setup in the post: Configure WordPress to Use Postfix.
- Sending Emails via WP Mail SMTP Plugin (Gmail)
- In this method, emails are sent through an external mail server, such as Gmail.
- You need to configure Gmail Workspace credentials to authenticate WordPress for email delivery.
- This is required because Gmail’s secure authentication (e.g., SMS or App Password) doesn’t allow direct email delivery from third-party applications.
- Learn more in the post: Configure WordPress to Use Gmail with WP Mail SMTP.
Automate Welcome Emails for New Users
Ensure that new users automatically receive a welcome email with their login details after registration.
Step 1: Verify WordPress Email Settings
- Go to Settings > General in the WordPress admin dashboard.
- Check that the “Email Address” field contains the sender’s email defined in the pre-requisites:
- Either
wordpress@nathabee.de
(if using Postfix), or nathabee123@gmail.com
(if using WP Mail SMTP).
- Either
Step 2: Use a Plugin to Automate Welcome Emails
Install and configure a plugin like Better Notifications for WP to handle welcome emails for new users.
Configure Better Notifications for WP
- Go to your WordPress dashboard.
- Navigate to
Notifications > Add New Notification
. - Set up the notification:
- Title:
Welcome Email for New Users
- Notification For:
New User – Post-registration Email
- Email Format:
HTML
(Select this option) - Send To:
{user_email}
(Auto-fills the user’s email) - Subject:
Welcome to Nathabee Creations, {username}!
- Message: Use the following HTML content.
- Title:
HTML Email Content for Better Notifications
Copy and paste the following HTML inside the message field in the Better Notifications plugin:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Welcome to Nathabee Creations</title>
<style>
body {
font-family: Arial, sans-serif;
background-color: #f4f4f4;
margin: 0;
padding: 0;
}
.container {
width: 80%;
margin: auto;
background: #ffffff;
padding: 20px;
border-radius: 10px;
box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);
}
.header {
text-align: center;
padding-bottom: 20px;
}
.header img {
max-width: 200px;
}
.content {
font-size: 16px;
color: #333;
line-height: 1.6;
}
.button {
display: inline-block;
background: #EB5510;
color: white;
padding: 10px 20px;
text-decoration: none;
border-radius: 5px;
margin-top: 20px;
}
.footer {
text-align: center;
font-size: 12px;
color: #888;
margin-top: 20px;
}
</style>
</head>
<body>
<div class="container">
<div class="header">
<img src="https://nathabee.de/wp-content/uploads/2025/01/logo.png" alt="Nathabee Creations">
<h2>Welcome to Nathabee Creations, {username}!</h2>
</div>
<div class="content">
<p>Dear {username},</p>
<p>We are thrilled to have you join our community at <strong>Nathabee Creations</strong>. Get ready to explore and contribute!</p>
<p><strong>Your Login Details:</strong></p>
<p>🌟 <strong>Username:</strong> {username}</p>
<p>🔑 <strong>Set Your Password:</strong> <a href="{password_reset_link}" class="button">Click Here</a></p>
<p>🎨 <strong>Explore:</strong> <a href="https://nathabee.de/wordpress">Visit Our Website</a></p>
<p>🛠️ <strong>GitHub Repository:</strong> <a href="https://github.com/nathabee">Our GitHub</a></p>
<p>If you have any questions, feel free to reply to this email.</p>
<p>Best Regards,</p>
<p><strong>Nathabee Creations Team</strong></p>
</div>
<div class="footer">
<p>This is an automated email. Please do not reply.</p>
</div>
</div>
</body>
</html>
Save and Test the Email
- Save the notification in Better Notifications for WP.
- Create a test user (
Users > Add New
). - Check the new user’s email inbox (Spam folder too!).
- Ensure the email is sent in HTML format.
Explanation of the HTML Code
- The email has a logo, personalized username, and styled text.
- It includes a password reset link (
{password_reset_link}
). - Styled “Set Your Password” button for an enhanced look.
- Links to your website and GitHub.
- Mobile-friendly and styled for all email clients.
Final Thoughts
This method ensures your new users receive a professional-looking welcome email instead of the plain default message.
Leave a Reply