当前位置: 首页>>代码示例>>Python>>正文


Python mail.email函数代码示例

本文整理汇总了Python中zkpylons.lib.mail.email函数的典型用法代码示例。如果您正苦于以下问题:Python email函数的具体用法?Python email怎么用?Python email使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了email函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _new

    def _new(self):
        if c.funding_status == 'closed':
            return render("funding/closed.mako")
        elif c.funding_status == 'not_open':
            return render("funding/not_open.mako")

        funding_results = self.form_result['funding']
        attachment_results1 = self.form_result['attachment']

        c.person = h.signed_in_person()

        c.funding = Funding(**funding_results)
        c.funding.status = FundingStatus.find_by_name('Pending')
        c.funding.person = c.person

        if not c.funding.type.available():
            return render("funding/type_unavailable.mako")

        meta.Session.add(c.funding)

        if attachment_results1 is not None:
            attachment = FundingAttachment(**attachment_results1)
            c.funding.attachments.append(attachment)
            meta.Session.add(attachment)

        meta.Session.commit()
        email(c.funding.person.email_address, render('funding/thankyou_email.mako'))

        h.flash("Funding submitted!")
        return redirect_to(controller='funding', action="index", id=None)
开发者ID:noisymime,项目名称:zookeepr,代码行数:30,代码来源:funding.py

示例2: _edit

    def _edit(self, id):
        # We need to recheck auth in here so we can pass in the id
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_submitter(id), h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        if not h.auth.authorized(h.auth.has_organiser_role):
            if c.paper_editing == 'closed' and not h.auth.authorized(h.auth.has_late_submitter_role):
                return render("proposal/editing_closed.mako")
            elif c.paper_editing == 'not_open':
                return render("proposal/editing_not_open.mako")

        c.proposal = Proposal.find_by_id(id)
        for key in self.form_result['proposal']:
            setattr(c.proposal, key, self.form_result['proposal'][key])

        c.proposal.abstract = self.clean_abstract(c.proposal.abstract)

        c.person = self.form_result['person_to_edit']
        if (c.person.id == h.signed_in_person().id or
                             h.auth.authorized(h.auth.has_organiser_role)):
            for key in self.form_result['person']:
                setattr(c.person, key, self.form_result['person'][key])
            p_edit = "and author"
        else:
            p_edit = "(but not author)"

        meta.Session.commit()

        if lca_info['proposal_update_email'] != '':
            body = "Subject: %s Proposal Updated\n\nID:    %d\nTitle: %s\nType:  %s\nURL:   %s" % (h.lca_info['event_name'], c.proposal.id, c.proposal.title, c.proposal.type.name.lower(), "http://" + h.host_name() + h.url_for(action="view"))
            email(lca_info['proposal_update_email'], body)

        h.flash("Proposal %s edited!"%p_edit)
        return redirect_to('/proposal')
开发者ID:PaulWay,项目名称:zookeepr,代码行数:35,代码来源:proposal.py

示例3: _forgotten_password

    def _forgotten_password(self):
        """Action to let the user request a password change.

        GET returns a form for emailing them the password change
        confirmation.

        POST checks the form and then creates a confirmation record:
        date, email_address, and a url_hash that is a hash of a
        combination of date, email_address, and a random nonce.

        The email address must exist in the person database.

        The second half of the password change operation happens in
        the ``confirm`` action.
        """
        c.email = self.form_result['email_address']
        c.person = Person.find_by_email(c.email)

        if c.person is not None:
            # Check if there is already a password recovery in progress
            reset = PasswordResetConfirmation.find_by_email(c.email)
            if reset is not None:
                return render('person/in_progress.mako')

            # Ok kick one off
            c.conf_rec = PasswordResetConfirmation(email_address=c.email)
            meta.Session.add(c.conf_rec)
            meta.Session.commit()

        email(c.email, render('person/confirmation_email.mako'))

        return render('person/password_confirmation_sent.mako')
开发者ID:iseppi,项目名称:zookeepr,代码行数:32,代码来源:person.py

示例4: _new

    def _new(self):
        # Do we allow account creation?
        if Config.get('account_creation'):
            """Create a new person submit.
            """

            # Remove fields not in class
            results = self.form_result['person']
            del results['password_confirm']
            c.person = Person(**results)
            c.person.email_address = c.person.email_address.lower()
            meta.Session.add(c.person)

            #for sn in self.form_result['social_network']:
            #   network = SocialNetwork.find_by_name(sn['name'])
            #   if sn['account_name']:
            #       c.person.social_networks[network] = sn['account_name']

            meta.Session.commit()

            if Config.get('confirm_email_address', category='rego') == 'no':
                redirect_to(controller='person', action='confirm', confirm_hash=c.person.url_hash)
            else:
                email(c.person.email_address, render('/person/new_person_email.mako'))
                # return render('/person/thankyou.mako')
                return self.finish_login(c.person.email_address)
        else:
            return render('/not_allowed.mako')
开发者ID:iseppi,项目名称:zookeepr,代码行数:28,代码来源:person.py

示例5: void

    def void(self, id):
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_attendee(id), h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        c.invoice = Invoice.find_by_id(id, True)
        if c.invoice.is_void:
            h.flash("Invoice was already voided.")
            return redirect_to(action='view', id=c.invoice.id)
        elif len(c.invoice.payment_received) and h.auth.authorized(h.auth.has_organiser_role):
            h.flash("Invoice has a payment applied to it, do you want to " + h.link_to('Refund', h.url_for(action='refund')) + " instead?")
            return redirect_to(action='view', id=c.invoice.id)
        elif len(c.invoice.payment_received):
            h.flash("Cannot void a paid invoice.")
            return redirect_to(action='view', id=c.invoice.id)
        elif h.auth.authorized(h.auth.has_organiser_role):
            c.invoice.void = "Administration Change"
            meta.Session.commit()
            h.flash("Invoice was voided.")
            return redirect_to(action='view', id=c.invoice.id)
        else:
            c.invoice.void = "User cancellation"
            c.person = c.invoice.person
            meta.Session.commit()
            email(Config.get('contact_email'), render('/invoice/user_voided.mako'))
            h.flash("Previous invoice was voided.")
            return redirect_to(controller='registration', action='pay', id=c.person.registration.id)
开发者ID:n6151h,项目名称:pyconau2016,代码行数:27,代码来源:invoice.py

示例6: void

    def void(self, id):
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_attendee(id), h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        c.invoice = Invoice.find_by_id(id, True)
        if c.invoice.is_void():
            h.flash("Invoice was already voided.")
            return redirect_to(action='view', id=c.invoice.id)

        if h.auth.authorized(h.auth.has_organiser_role):
            c.invoice.void = "Administration Change"
            meta.Session.commit()
            h.flash("Invoice was voided.")
            return redirect_to(action='view', id=c.invoice.id)
        else:
            if c.invoice.paid():
                h.flash("Cannot void a paid invoice.")
                return redirect_to(action='view', id=c.invoice.id)
            c.invoice.void = "User cancellation"
            c.person = c.invoice.person
            meta.Session.commit()
            email(lca_info['contact_email'], render('/invoice/user_voided.mako'))
            h.flash("Previous invoice was voided.")
            return redirect_to(controller='registration', action='pay', id=c.person.registration.id)
开发者ID:PaulWay,项目名称:zookeepr,代码行数:25,代码来源:invoice.py

示例7: _new

    def _new(self):
        person_results = self.form_result['person']
        proposal_results = self.form_result['proposal']
        attachment_results = self.form_result['attachment']

        proposal_results['status'] = ProposalStatus.find_by_name('Pending')

        c.proposal = Proposal(**proposal_results)
        meta.Session.add(c.proposal)

        if not h.signed_in_person():
            c.person = model.Person(**person_results)
            meta.Session.add(c.person)
            email(c.person.email_address, render('/person/new_person_email.mako'))
        else:
            c.person = h.signed_in_person()
            for key in person_results:
                setattr(c.person, key, self.form_result['person'][key])

        c.person.proposals.append(c.proposal)

        if attachment_results is not None:
            c.attachment = Attachment(**attachment_results)
            c.proposal.attachments.append(c.attachment)
            meta.Session.add(c.attachment)

        meta.Session.commit()
        email(c.person.email_address, render('proposal/thankyou_mini_email.mako'))

        h.flash("Proposal submitted!")
        return redirect_to(controller='proposal', action="index", id=None)
开发者ID:Secko,项目名称:zookeepr,代码行数:31,代码来源:miniconf_proposal.py

示例8: _remind

 def _remind(self):
     results = self.form_result
     for i in results['invoices']:
         c.invoice = i
         c.recipient = i.person
         email(c.recipient.email_address, render('invoice/remind_email.mako'))
         h.flash('Email sent to ' + c.recipient.fullname + ' <' + c.recipient.email_address + '>')
     redirect_to(action='remind')
开发者ID:n6151h,项目名称:pyconau2016,代码行数:8,代码来源:invoice.py

示例9: reject

 def reject(self, id):
     volunteer = Volunteer.find_by_id(id)
     volunteer.accepted = False
     volunteer.ticket_type = None
     meta.Session.commit()
     c.volunteer = volunteer
     c.person = volunteer.person
     email(c.person.email_address, render('volunteer/response.mako'))
     h.flash('Status Updated and Rejection Email Sent')
     redirect_to(action='index', id=None)
开发者ID:PaulWay,项目名称:zookeepr,代码行数:10,代码来源:volunteer.py

示例10: _accept

 def _accept(self, id):
     results = self.form_result
     volunteer = Volunteer.find_by_id(id)
     volunteer.ticket_type = results['ticket_type']
     volunteer.accepted = True
     meta.Session.commit()
     c.volunteer = volunteer
     c.person = volunteer.person
     email(c.person.email_address, render('volunteer/response.mako'))
     h.flash('Status Updated and Acceptance Email Sent')
     redirect_to(action='index', id=None)
开发者ID:PaulWay,项目名称:zookeepr,代码行数:11,代码来源:volunteer.py

示例11: _new

    def _new(self):
        results = self.form_result['volunteer']

        c.volunteer = Volunteer(**results)
        c.volunteer.person = h.signed_in_person()
        c.person = c.volunteer.person
        meta.Session.add(c.volunteer)
        meta.Session.commit()

        h.flash("Thank you for volunteering. We will contact you shortly regarding your application")
        email(c.person.email_address, render('volunteer/response.mako'))
        redirect_to(action='view', id=c.volunteer.id)
开发者ID:PaulWay,项目名称:zookeepr,代码行数:12,代码来源:volunteer.py

示例12: _remind

 def _remind(self):
     results = self.form_result
     for i in results["invoices"]:
         c.invoice = i
         c.recipient = i.person
         email(c.recipient.email_address, render("invoice/remind_email.mako"))
         h.flash(
             "Email sent to "
             + c.recipient.firstname
             + " "
             + c.recipient.lastname
             + " <"
             + c.recipient.email_address
             + ">"
         )
     redirect_to(action="remind")
开发者ID:gracz120,项目名称:zookeepr,代码行数:16,代码来源:invoice.py

示例13: _withdraw

    def _withdraw(self, id):
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_submitter(id), h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        c.proposal = Proposal.find_by_id(id)
        status = ProposalStatus.find_by_name('Withdrawn')
        c.proposal.status = status
        meta.Session.commit()

        c.person = h.signed_in_person()

        # Make sure the organisers are notified of this
        c.email_address = h.lca_info['emails'][c.proposal.type.name.lower()]
        email(c.email_address, render('/proposal/withdraw_email.mako'))

        h.flash("Proposal withdrawn. The organisers have been notified.")
        return redirect_to(controller='proposal', action="index", id=None)
开发者ID:PaulWay,项目名称:zookeepr,代码行数:18,代码来源:proposal.py

示例14: _withdraw

    def _withdraw(self, id):
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_funding_submitter(id), h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()

        c.funding = Funding.find_by_id(id)
        status = FundingStatus.find_by_name('Withdrawn')
        c.funding.status = status
        meta.Session.commit()

        c.person = h.signed_in_person()

        # Make sure the organisers are notified of this
        c.email_address = c.funding.type.notify_email
        email(c.email_address, render('/funding/withdraw_email.mako'))

        h.flash("Funding withdrawn. The organisers have been notified.")
        return redirect_to(controller='funding', action="index", id=None)
开发者ID:Ivoz,项目名称:zookeepr,代码行数:18,代码来源:funding.py

示例15: _offer

    def _offer(self,id):
        # We need to recheck auth in here so we can pass in the id
        if not h.auth.authorized(h.auth.Or(h.auth.is_same_zkpylons_user(id), h.auth.has_reviewer_role, h.auth.has_organiser_role)):
            # Raise a no_auth error
            h.auth.no_role()
        c.person = Person.find_by_id(id)
        c.offers = c.person.proposal_offers
        c.travel_assistance = reduce(lambda a, b: a or ('Travel' in b.status.name), c.offers, False) or False
        c.accommodation_assistance = reduce(lambda a, b: a or ('Accommodation' in b.status.name), c.offers, False) or False

        # What status are we moving all proposals to?
        if self.form_result['status'] == 'accept':
            c.status = ProposalStatus.find_by_name('Accepted')
        elif self.form_result['status'] == 'withdraw':
            c.status = ProposalStatus.find_by_name('Withdrawn')
        elif self.form_result['status'] == 'contact':
            c.status = ProposalStatus.find_by_name('Contact')
        else:
            c.status = None

        emails = [c.person.email_address]
        for offer in c.offers:
            offer.status = c.status
            if offer.type.notify_email and offer.type.notify_email not in emails:
                emails.append(offer.type.notify_email)

        if c.travel_assistance:
            if not c.person.travel:
                self.form_result['travel']['flight_details'] = ''
                travel = Travel(**self.form_result['travel'])
                meta.Session.add(travel)
                c.person.travel = travel
            else:
                for key in self.form_result['travel']:
                    setattr(c.person.travel, key, self.form_result['travel'][key])

        if c.status.name == 'Accepted':
            email(c.person.email_address, render('/person/offer_email.mako'))
        else:
            email(emails, render('/person/offer_email.mako'))

        # update the objects with the validated form data
        meta.Session.commit()
        return render('person/offer.mako')
开发者ID:iseppi,项目名称:zookeepr,代码行数:44,代码来源:person.py


注:本文中的zkpylons.lib.mail.email函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。