Here’s the code you can call this code whenever the order is placed by the user you don’t need to automate
If you are using django you can use this:
from django.core.mail import send_mail
send_mail(
'Subject here',
'Here is the message.',
'[email protected]',
['[email protected]'],
fail_silently=False,
)
Without django you can use this :
import smtplib
sender = '[email protected]'
receivers = ['[email protected]']
message = “This is a test e-mail message."
try:
smtpObj = smtplib.SMTP('localhost')
smtpObj.sendmail(sender, receivers, message)
print "Successfully sent email"
except SMTPException:
print "Error: unable to send email"
cronjobto be every 30 minutes, 1 hours, or whatever you want.celery