django-mailer creates multiple db entries from email address -


"itemprop =" text ">

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 :. import mailer notifications send_mail .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)

outputting User_email Full Email Address Notification - Email Correct C, I function a problem with Django- save that is assuming Mailer ....?

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.

send_mail A list of recipients is necessary What should I do:

  send_mail (subject, message, SERVER_EMAIL, [user_email]) < / Code>  

Note the square bracket for the user - Email this one list ..... now everything is fine.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -