django-mailer creates multiple db entries from email address -
I just executed the Django-Mailer as it seemed to send mail asynchronously from Django as the best way Have done For some reason, the DB entry is being created for each letter of the recipient's email address, in which the "to do" field contains a letter .... Here is a screenshot: I have cut the remaining entries so that the full address can not be shown, but it is enough to say that the "to" field of all entries adds the user's email address ( An email to clarify Creates an object for each letter of the e-mail address as soon as is) The code generated mail :. outputting Thank you very much for any hints given. OK, after all, I have done my job and, of course, I made a serious mistake is. Note the square bracket for the user - Email this one list ..... now everything is fine. .models import EmailNotifications users_to_email = EmailNotifications.objects.filter (\ Product = Product) If users_to_email: for user_to_email in users_to_email: the_score = self.rating user = user_to_email .user name = '% s% s'% (STR (user.first_name), \ str (user.last_name)) user_email = user.email theSubject = 'score notifications' TheMessage = Render_to_string ( 'notification email.txt', { "The_score 'The_score," name ": name": user,' USER_EMAIL ': user_email}) send_mail (theSubject, theMessage, SERVER_EMAIL, \ user_email)
User_email Full Email Address Notification - Email Correct C, I function a problem with Django- save that is assuming Mailer ....?
send_mail A list of recipients is necessary What should I do:
send_mail (subject, message, SERVER_EMAIL, [user_email]) < / Code>
Comments
Post a Comment