如何配置Magento实现订单确认邮件与发票自动发送?
Hey there, let's break down how to set up those automatic emails in Magento—both order confirmations and invoices. I've tackled this a bunch of times, so here's the step-by-step that works for most setups:
This is straightforward once you know where to look in the admin:
- Log into your Magento admin panel, then head to
Stores > Configuration > Sales > Sales Emails - Scroll down to the Order section:
- Toggle Enabled to
Yes - Confirm the New Order Confirmation Email template is set (you can stick with the default or use a custom one you've created)
- If you want your internal team to get copies, fill in the Send Email Copy To field—this is optional but useful for tracking
- Hit "Save Config" to lock in your changes
- Toggle Enabled to
This has two parts: enabling the invoice email itself, and configuring when it should trigger automatically.
First: Enable Invoice Email Notifications
- Stay in
Stores > Configuration > Sales > Sales Emails, then navigate to the Invoice section:- Set Enabled to
Yes - Pick your preferred Invoice Email template
- Adjust the copy settings if needed, then save the configuration.
- Set Enabled to
Option A: Auto-generate Invoices + Send Emails (for Instantly Paid Orders)
If you want invoices to create and send automatically when a customer completes a paid order (like credit card payments that go through right away), you need to tweak your payment method settings:
- Go to
Stores > Configuration > Sales > Payment Methods - For each payment method you use (PayPal, Credit Card, etc.):
- Look for settings like Automatic Invoice Creation or Generate Invoice On Order Placement—the label might vary a bit depending on the payment method or extensions you're using
- Enable that option. Once turned on, Magento will auto-generate the invoice and fire off the email to the customer as soon as the order is successfully paid.
Option B: Auto-send Email When Manually Creating an Invoice
If you prefer to create invoices manually but don't want to click "Send Email" every single time:
- When you create an invoice from the order view (
Sales > Orders > Select Your Order > Invoice), look for a checkbox at the bottom labeled Email Copy of Invoice (or similar). By default, this is often checked, but if not, make sure it's ticked before you submit the invoice. - To make this the default behavior for all manual invoices, check your Magento version's Sales Emails config—some versions let you set this globally. If not, a tiny custom module or quick admin tweak can fix it, or just make sure your team knows to always check that box!
- Double-check that your Magento cron jobs are running smoothly—all automatic email triggers and invoice generation depend on cron. You can verify scheduled tasks in
System > Cron > Scheduled Tasks - If emails aren't showing up, check the transactional email logs in
System > Transactional Emailsto see if they're queued or failed. Queued emails usually mean cron is delayed. - Confirm your SMTP settings are correct in
Stores > Configuration > Advanced > System > Mail Sending Settings—this is the most common culprit when emails aren't going out at all.
内容的提问来源于stack exchange,提问作者Mohammed

