def on_up(self): # retrieves the complete set of contacts and sends # an mail about the server up for the email to the # the various email addresses for notification instance_id = self.server.instance_id contacts = contact.Contact.find(enabled=True, instance_id=instance_id) for _contact in contacts: quorum.send_mail_a( subject="Your server %s, is back online" % self.server.name, sender="Pingu Mailer <*****@*****.**>", receivers=["%s <%s>" % (_contact.name, _contact.email)], plain="email/up.txt.tpl", rich="email/up.html.tpl", context=dict(server=self.server), )
def confirm(self): # creates a new account in order to obtain the new build # values (include obfuscated email value) restores the # confirmation values that has been removed (private value) account = self.copy(build=True) account.confirmation = self.confirmation # sends a mail about the confirmation of the email to the # the email address associated with the current account quorum.send_mail_a( subject="Welcome to Metrium, please confirm you email", sender="Metrium Mailer <*****@*****.**>", receivers=["%s <%s>" % (self.username, self.email)], plain="email/confirm.txt.tpl", rich="email/confirm.html.tpl", context=dict(account=account), )
def confirm(self): # creates a new account in order to obtain the new build # values (include obfuscated email value) restores the # confirmation values that has been removed (private value) account = self.copy(build = True) account.confirmation = self.confirmation # sends a mail about the confirmation of the email to the # the email address associated with the current account quorum.send_mail_a( subject = "Welcome to Pingu, please confirm you email", sender = "Pingu Mailer <*****@*****.**>", receivers = ["%s <%s>" % (self.username, self.email)], plain = "email/confirm.txt.tpl", rich = "email/confirm.html.tpl", context = dict( account = account ) )