示例#1
0
def send_shipment_mail_confirmation(order):
    send_mail_task.apply_async(
        args=[{
                'order_id' : order.pk,
                'template_name' : commons.SHIPMENT_CONFIRMATION_MAIL_TEMPLATE,
                'title': commons.SHIPMENT_CONFIRMATION_MAIL_TITLE,
                'recipient_email': order.user.email
            }],
        queue=settings.CELERY_OUTGOING_MAIL_EXCHANGE,
        routing_key=settings.CELERY_OUTGOING_MAIL_ROUTING_KEY
    )
示例#2
0
def send_welcome_mail(sender, instance, created, **kwargs):

    if created:
        logger.debug("sending welcome mail ...")
        logger.debug("new user created, sending welcome mail ...")
        email_context = {
            'template_name': settings.DJANGO_WELCOME_EMAIL_TEMPLATE,
            'title': 'Bienvenu chez LYSHOP',
            'recipient_email': instance.email,
            'context': {
                'SITE_NAME': settings.SITE_NAME,
                'SITE_HOST': settings.SITE_HOST,
                'FULL_NAME': instance.get_full_name()
            }
        }
        send_mail_task.apply_async(
            args=[email_context],
            queue=settings.CELERY_OUTGOING_MAIL_QUEUE,
            routing_key=settings.CELERY_OUTGOING_MAIL_ROUTING_KEY)
示例#3
0
def send_validation_mail(sender, instance, created, **kwargs):

    if created:
        logger.debug("sending validation mail ...")
        logger.debug("new user created, sending validation mail ...")
        email_context = {
            'template_name': settings.DJANGO_VALIDATION_EMAIL_TEMPLATE,
            'title': 'Validation de votre adresse mail',
            'recipient_email': instance.user.email,
            'context': {
                'SITE_NAME':
                settings.SITE_NAME,
                'SITE_HOST':
                settings.SITE_HOST,
                'FULL_NAME':
                instance.user.get_full_name(),
                'validation_url':
                settings.SITE_HOST + instance.get_validation_url()
            }
        }
        send_mail_task.apply_async(
            args=[email_context],
            queue=settings.CELERY_OUTGOING_MAIL_QUEUE,
            routing_key=settings.CELERY_OUTGOING_MAIL_ROUTING_KEY)