本文整理汇总了Python中myrobogals.rgmessages.models.EmailMessage.sender_id方法的典型用法代码示例。如果您正苦于以下问题:Python EmailMessage.sender_id方法的具体用法?Python EmailMessage.sender_id怎么用?Python EmailMessage.sender_id使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类myrobogals.rgmessages.models.EmailMessage
的用法示例。
在下文中一共展示了EmailMessage.sender_id方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: check_default_pass
# 需要导入模块: from myrobogals.rgmessages.models import EmailMessage [as 别名]
# 或者: from myrobogals.rgmessages.models.EmailMessage import sender_id [as 别名]
def check_default_pass():
users = User.objects.all()
for u in users:
if check_password("newrg123", u.password):
message = EmailMessage()
message.body = "Dear " + u.first_name + ",\n\nYou are recieving this automated email because your myRobogals account is still set to use the default password. This is a security risk and exposes your myRobogals account to potentially being used by others.\n\nPlease login at http://my.robogals.org using the following credentials:\nUsername: " + u.username + "\nPassword: newrg123\n\nOnce you have logged in, please change your password.\n\nThankyou,\n\nmyRobogals password nagging bot :)"
message.subject = "Warning: Account is using default password"
message.from_address = "[email protected]"
message.from_name = "myRobogals"
message.reply_address = "[email protected]"
message.html = False
message.status = -1
message.sender_id = 168
message.save()
recipient = EmailRecipient()
recipient.message = message
recipient.user = u
recipient.to_name = u.get_full_name()
recipient.to_address = u.email
recipient.save()
message.status = 0
message.save()