示例#1
0
 def send_notification(self):
     subject = _('You have been added to a proposal at LCO.global')
     message = render_to_string('proposals/added.txt', {
         'proposal': self.proposal,
         'user': self.user,
     })
     send_mail.delay(subject, message, '*****@*****.**',
                     [self.user.email])
示例#2
0
    def send_invitation(self):
        subject = _('You have been added to a proposal at LCO.global')
        message = render_to_string('proposals/invitation.txt', {
            'proposal': self.proposal,
            'url': reverse('registration_register')
        })

        send_mail.delay(subject, message, '*****@*****.**', [self.email])
        self.sent = timezone.now()
        self.save()
示例#3
0
def userrequest_notifications(userrequest):
    if userrequest.state == 'COMPLETED':
        message = render_to_string(
            'proposals/userrequestcomplete.txt',
            {'userrequest': userrequest}
        )
        send_mail.delay(
            'Request {} has completed'.format(userrequest.group_id),
            message,
            '*****@*****.**',
            [u.email for u in users_to_notify(userrequest)]
        )
示例#4
0
 def send_approved_notification(self):
     subject = _('Your proposal at LCO.global has been approved')
     message = render_to_string(
         'sciapplications/approved.txt', {
             'proposal':
             self.proposal,
             'semester':
             self.call.semester,
             'semester_already_started':
             self.call.semester.start < timezone.now(),
         })
     send_mail.delay(subject, message, '*****@*****.**',
                     [self.proposal.pi.email])
示例#5
0
文件: views.py 项目: LCOGT/valhalla
def ddt_submitted_email(sciproposal):
    message = render_to_string('sciapplications/ddt_submitted.txt',
                               {'ddt': sciproposal})
    send_mail.delay('LCO Director\'s Discretionary Time Submission', message,
                    '*****@*****.**',
                    [sciproposal.submitter.email, '*****@*****.**'])
示例#6
0
 def send_email(self, user):
     message = 'User {0} would like their account removed.\nReason:\n {1}'.format(
         user.email, self.cleaned_data['reason'])
     send_mail.delay('Account removal request submitted', message,
                     '*****@*****.**', ['*****@*****.**'])