lib.sqlalchemy.get_admin_emails - python examples

Here are the examples of the python api lib.sqlalchemy.get_admin_emails taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

0 View Complete Implementation : smtp.py
Copyright GNU General Public License v3.0
Author : lavalamp-
@websight_app.task(bind=True, base=DatabaseTask)
def send_emails_for_placed_order(self, order_uuid=None, receipt_description=None):
    """
    Handle the sending of emails as a result of the given order being placed.
    :param order_uuid: The UUID of the order that was placed.
    :param receipt_description: A description of the receipt for the order.
    :return: None
    """
    logger.info(
        "Now handling sending emails for placement of order %s."
        % (order_uuid,)
    )
    user_name, user_email = get_user_name_and_email_from_order(order_uuid=order_uuid, db_session=self.db_session)
    if not user_name:
        user_name = "Web Sight User"
    admin_emails = get_admin_emails(self.db_session)
    smtp_helper = SmtpEmailHelper.instance()
    smtp_helper.send_emails_for_placed_order(
        user_name=user_name,
        user_email=user_email,
        admin_emails=admin_emails,
        order_receipt_description=receipt_description,
    )
    logger.info(
        "All emails sent for placed order %s."
        % (order_uuid,)
    )

0 View Complete Implementation : smtp.py
Copyright GNU General Public License v3.0
Author : lavalamp-
@websight_app.task(bind=True, base=DatabaseTask)
def send_emails_for_user_signup(self, user_uuid=None):
    """
    Handle the sending of emails as a result of the given user signing up.
    :param user_uuid: The UUID of the user that signed up.
    :return: None
    """
    logger.info(
        "Now handling sending emails for user %s signing up."
        % (user_uuid,)
    )
    user_name, user_email, verification_token = get_name_email_and_verification_token_for_user(
        user_uuid=user_uuid,
        db_session=self.db_session,
    )
    if not user_name:
        user_name = "Web Sight User"
    admin_emails = get_admin_emails(self.db_session)
    smtp_helper = SmtpEmailHelper.instance()
    smtp_helper.send_emails_for_user_signup(
        user_email=user_email,
        verification_token=verification_token,
        user_name=user_name,
        user_uuid=user_uuid,
        admin_emails=admin_emails,
    )
    logger.info(
        "All emails sent for user %s signing up."
        % (user_uuid,)
    )