示例#1
0
    def _on_processed_status(self, instance):
        customer = Customer.read(instance.customer_id)

        # TODO: create a factory or static wrapper that chooses test or control
        # based on the parameters passed to instantiate it (ex: customer).
        if customer.control_group:
            status_message = ControlProcessedInstanceMessage(
                customer, instance)
        else:
            status_message = TestProcessedInstanceMessage(customer, instance)

        redflag.send_email_to_customer(customer, status_message.subject,
                                       status_message.body_text)
示例#2
0
    def _on_registered_status(self, customer):
        # send email to customer

        # TODO: create a factory or static wrapper that chooses test or control
        # based on the parameters passed to instantiate it (ex: customer).
        if customer.control_group:
            status_message = ControlCreatedCustomerMessage(customer)
        else:
            status_message = TestCreatedCustomerMessage(customer)

        redflag.send_email_to_customer(customer, status_message.subject,
                                       status_message.body_text)

        # send notification email to us
        # TODO: Pull subject and body_test from a StatusMesage
        redflag.send_email_to_notification_account(
            unicode("Customer Created"), customer.email,
            unicode("Somebody just signed up and sent us a task. Body "
                    "text required."))
示例#3
0
    def _on_registered_status(self, customer):
        # send email to customer

        # TODO: create a factory or static wrapper that chooses test or control
        # based on the parameters passed to instantiate it (ex: customer).
        if customer.control_group:
            status_message = ControlCreatedCustomerMessage(customer)
        else:
            status_message = TestCreatedCustomerMessage(customer)

        redflag.send_email_to_customer(
                customer,
                status_message.subject,
                status_message.body_text)

        # send notification email to us
        # TODO: Pull subject and body_test from a StatusMesage
        redflag.send_email_to_notification_account(
                unicode("Customer Created"),
                customer.email,
                unicode("Somebody just signed up and sent us a task. Body "
                        "text required."))
示例#4
0
 def _on_completed_status(self, instance):
     customer = Customer.read(instance.customer_id)
     status_message = CompletedInstanceMessage(customer, instance)
     redflag.send_email_to_customer(customer, status_message.subject,
                                    status_message.body_text)