예제 #1
0
def send_allocation_approve_owner_email(allocation_request):
    try:
        notifier=MailNotifier.objects.get(name='NotifyOwnerApprove')
        ctx={'allocation_request':allocation_request}
        msg=notifier.send(context=ctx,to_addrs=[allocaiton_request.primary_investigator.email])
        mail_log=MailLog(
            reference_name='NotifyOwnerApprove',email_object=msg,
            recipient_email=allocation_request.primary_investigator.email,from_host=socket.gethostname()
        )
        mail_log.save()
    except MailNotifier.DoesNotExist:
        pass
예제 #2
0
def send_allocation_request_admin_email(allocation_request):
    try:
        notifier=MailNotifier.objects.get(name='NotifyAdminsRequest')
        ctx={'allocation_request':allocation_request}
        msg=notifier.send(context=ctx,to_addrs=['*****@*****.**'])
        mail_log=MailLog(
            reference_name='NotifyAdminsRequest',email_object=msg,
            recipient_email='*****@*****.**',from_host=socket.gethostname()
        )
        mail_log.save()
    except MailNotifier.DoesNotExist:
        pass