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])
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()
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)] )
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])
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, '*****@*****.**'])
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, '*****@*****.**', ['*****@*****.**'])