djangoから非同期でメールを送信するのに最適な方法であると思われるため、django-mailerを実装しました。
何らかの理由で、django-mailerは、受信者の電子メールアドレスの各文字に対してdbエントリを作成しており、「To」フィールドには1文字が含まれています。スクリーンショットは次のとおりです。
http://i.imgur.com/Pqbx3oq.gif
完全なアドレスが表示されないように残りのエントリを切り取りましたが、すべてのエントリの「宛先」フィールドがユーザーの電子メールアドレスに加算されると言えば十分です。(明確にするために、1つの電子メールを送信すると、電子メールアドレスの文字ごとにオブジェクトが作成されます)。
メールを生成するコードは次のとおりです。
from mailer import send_mail
from notifications.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 Notification'
theMessage = render_to_string('notification-email.txt',
{'the_score': the_score,
'name': name,
'user': user,
'user_email': user_email})
send_mail(theSubject, theMessage, SERVER_EMAIL,\
user_email)
通知メールに出力user_email
するとメールアドレス全体が正しく表示されるので、これはdjango-mailerの保存機能の問題だと思います。
どんなポインタにもとても感謝しています。