DeeMcCart / CI_PP5_Jeweller

Jewellery website for CI Project 5
0 stars 2 forks source link

User Story: FTU_21 Emailed confirmation of order # #23

Closed DeeMcCart closed 5 months ago

DeeMcCart commented 7 months ago

IEPIC: #48

FTU_21: As a first-Time User I want to receive email/text notifying me of my order number and lead time so I can know when to expect it

Assumptions or Pre-Requisites:

Acceptance Criteria: (Must be completed before task is moved to 'Done')

Tasks

DeeMcCart commented 6 months ago

from django.core.mail import send_mail from django.template.loader import render_to_string from django.conf import settings

def _send_confirmation_email(self, order): """Send the user a confirmation email""" cust_email = order.email subject = render_to_string( 'checkout/confirmation_emails/confirmation_email_subject.txt', {'order': order}) body = render_to_string( 'checkout/confirmation_emails/confirmation_email_body.txt', {'order': order, 'contact_email': settings.DEFAULT_FROM_EMAIL})

    send_mail(
        subject,
        body,
        settings.DEFAULT_FROM_EMAIL,
        [cust_email]
    )        
DeeMcCart commented 6 months ago

07/02/24: Email confirmation of order - terminal view:

Image