a
    [f                     @   sH   d dl Z d dlmZmZmZ d dlmZ d dlmZ G dd deZ	dS )    N)mail_adminsmail_managers	send_mail)BaseCommand)timezonec                   @   s$   e Zd ZdZdZdd Zdd ZdS )CommandzASends a test email to the email addresses specified as arguments.zRYou must specify some email recipients, or pass the --managers or --admin options.c                 C   s4   |j dddd |j dddd |j d	dd
d d S )Nemail*z4One or more email addresses to send a test email to.)nargshelpz
--managers
store_truezBSend a test email to the addresses specified in settings.MANAGERS.)actionr   z--adminsz@Send a test email to the addresses specified in settings.ADMINS.)add_argument)selfparser r   C:\Users\91910\OneDrive\Desktop\vts_admin_rebuild-master\vts\Lib\site-packages\django/core/management/commands/sendtestemail.pyadd_arguments   s    zCommand.add_argumentsc                 O   sP   dt  t f }t|dd |d d |d r:t|d |d rLt|d d S )	NzTest email from %s on %sz*If you're reading this, it was successful.r   )subjectmessageZ
from_emailZrecipient_listZmanagersz)This email was sent to the site managers.Zadminsz'This email was sent to the site admins.)socketgethostnamer   nowr   r   r   )r   argskwargsr   r   r   r   handle    s    
zCommand.handleN)__name__
__module____qualname__r   Zmissing_args_messager   r   r   r   r   r   r      s
   r   )
r   Zdjango.core.mailr   r   r   Zdjango.core.management.baser   Zdjango.utilsr   r   r   r   r   r   <module>   s   