def send_button(self, **input): if mail_form.validate(input): if 'ENCRYPT' in input: try: send_secure( input['RECIPIENT'], input['SUBJECT'], input['MESSAGE'] ) message('encrypted message sent') return home() except RecipientKeyMissing, e: error('Missing pulic key for %s'%e.message) else: if 'ATTACHMENT' in input and hasattr(input['ATTACHMENT'], 'filename'): send( input['RECIPIENT'], input['SUBJECT'], input['MESSAGE'], [Attachment( input['ATTACHMENT'].filename, input['ATTACHMENT'].file, )], ) message('message sent with attachment') else: send(input['RECIPIENT'], input['SUBJECT'], input['MESSAGE']) message('message sent') return home()
def send_button(self, *args, **input): if mail_form.validate(input): if False and 'attachment' in input and hasattr( input['attachment'], 'filename'): send( input['recipient'], input['subject'], input['message'], [ Attachment( input['attachment'].filename, input['attachment'].file, ) ], ) success('message sent with attachment') else: send_as( (input['from_name'], input['from_email']), input['recipient'], input['subject'], input['message'], ) success('message sent') return home('mail')
def initiate_password_reset(email, fake=False): """creates and sends a token to the user""" token = make_token(email) message = make_message(token) if fake: return message send(email,'Password reset', message)
def send_button(self, **input): if mail_form.validate(input): if 'ENCRYPT' in input: try: send_secure(input['RECIPIENT'], input['SUBJECT'], input['MESSAGE']) message('encrypted message sent') return home() except RecipientKeyMissing, e: error('Missing pulic key for %s' % e.message) else: if 'ATTACHMENT' in input and hasattr(input['ATTACHMENT'], 'filename'): send( input['RECIPIENT'], input['SUBJECT'], input['MESSAGE'], [ Attachment( input['ATTACHMENT'].filename, input['ATTACHMENT'].file, ) ], ) message('message sent with attachment') else: send(input['RECIPIENT'], input['SUBJECT'], input['MESSAGE']) message('message sent') return home()
def send_button(self, **input): if mail_form.validate(input): if 'ENCRYPT' in input: try: send_secure( input['RECIPIENT'], input['SUBJECT'], input['MESSAGE'] ) message('encrypted message sent') return home() except RecipientKeyMissing, e: error('Missing pulic key for %s'%e.message) else: send( input['RECIPIENT'], input['SUBJECT'], input['MESSAGE'] ) message('message sent') return home()