Exemplo n.º 1
0
    def sendRetailerMail(self, parameters={}):

        buyerPtr = self.buyer

        if buyerPtr.email == None or buyerPtr.email == "":
            return

        from_email = "Wholdus Info <*****@*****.**>"
        mail_template_file = "buyer_store/buyer_store_lead.html"
        subject = "New purchase request on your online store on Wholdus"
        to_email = [buyerPtr.email]

        from users.serializers.buyer import serialize_buyer_store_lead

        mail_dict = serialize_buyer_store_lead(self, parameters)

        bcc = ["*****@*****.**", "*****@*****.**"]
        #bcc = []

        create_email(mail_template_file,
                     mail_dict,
                     subject,
                     from_email,
                     to_email,
                     bcc=bcc)
Exemplo n.º 2
0
    def send_registration_mail(self):
        mail_template_file = "seller/registration_success.html"
        mail_dict = {"email": self.email, "password": self.password}
        subject = "{} congratulations on your successful registration as a seller".format(
            self.name)
        to = [self.email]
        from_email = "Wholdus Info <*****@*****.**>"
        attachment = settings.MEDIA_ROOT + "/files/SellerTNC.pdf"

        create_email(mail_template_file, mail_dict, subject, from_email, to,
                     attachment)
Exemplo n.º 3
0
def sendSubOrderMail(SubOrderPtr, seller_mail_dict):
    from_email = "Wholdus Info <*****@*****.**>"
    seller_mail_template_file = "seller/new_suborder.html"
    seller_subject = "New order received with order ID " + SubOrderPtr.display_number
    seller_to = [SubOrderPtr.seller.email]
    seller_bcc = ["*****@*****.**"]
    create_email(seller_mail_template_file,
                 seller_mail_dict,
                 seller_subject,
                 from_email,
                 seller_to,
                 bcc=seller_bcc)
Exemplo n.º 4
0
def sendOrderMail(OrderPtr, buyer_subject = ""):
	from_email = "Wholdus Info <*****@*****.**>"
	buyerPtr = OrderPtr.buyer

	if buyerPtr.email != None and buyerPtr.email != "":
		buyer_mail_template_file = "buyer/new_order.html"
		if buyer_subject == "":
			buyer_subject = "New order placed with order ID " + OrderPtr.display_number
		buyer_to = [buyerPtr.email]
		buyer_bcc = ["*****@*****.**", "*****@*****.**"]
		buyer_mail_dict = populateBuyerMailDict(OrderPtr, buyerPtr)

		create_email(buyer_mail_template_file,buyer_mail_dict,buyer_subject,from_email,buyer_to,bcc=buyer_bcc)
Exemplo n.º 5
0
def sendSubOrderCancellationMail(SubOrderPtr, seller_mail_dict):
    if SubOrderPtr.suborder_status == 0:
        return
    from_email = "Wholdus Info <*****@*****.**>"
    seller_mail_template_file = "seller/suborder_cancelled.html"
    seller_subject = "Cancellation of order with order ID " + SubOrderPtr.display_number
    seller_to = [SubOrderPtr.seller.email]
    seller_bcc = ["*****@*****.**"]
    create_email(seller_mail_template_file,
                 seller_mail_dict,
                 seller_subject,
                 from_email,
                 seller_to,
                 bcc=seller_bcc)
Exemplo n.º 6
0
def sendMarketingEmails(marketingEmailPtr):
    from_email = "Wholdus <*****@*****.**>"
    mail_template_file = "marketing/app_marketing.html"

    for marketingEmail in marketingEmailPtr:
        mail_dict = {}
        time.sleep(0.1)
        to = [marketingEmail.email]
        subject = "{}, Buy Ladies Apparel At Manufacturer Prices!".format(
            marketingEmail.contact_name)
        mail_dict[
            "unsubscribe_link"] = "{}/general/marketingemail/unsubscribe/?marketingemailID={}".format(
                settings.API_BASE_URL, marketingEmail.id)
        create_email(mail_template_file, mail_dict, subject, from_email, to)
        marketingEmail.message_sent_count += 1
        marketingEmail.message_sent_time = timezone.now()
        marketingEmail.save()
Exemplo n.º 7
0
    def sendCustomerMail(self, parameters={}):

        buyerPtr = self.buyer

        if self.email == None or self.email == "":
            return

        from_email = "Wholdus Info <*****@*****.**>"
        mail_template_file = "buyer_store/customer_store_lead.html"

        if len(buyerPtr.company_name) > 0:
            subject = buyerPtr.company_name
        else:
            subject = buyerPtr.name

        subject += " has received you request"
        to_email = [self.email]

        from users.serializers.buyer import serialize_buyer, serialize_buyer_store_lead, serialize_buyer_address

        mail_dict = {}
        mail_dict["buyer"] = serialize_buyer(buyerPtr)
        buyerAddressHistory = buyerPtr.latest_buyer_address_history()
        if buyerAddressHistory != None:
            mail_dict["buyer_address"] = serialize_buyer_address(
                buyerAddressHistory)

        productParameters = {}
        productParameters["product_image_details"] = 1
        mail_dict["buyer_store_lead"] = serialize_buyer_store_lead(
            self, productParameters)

        bcc = ["*****@*****.**", "*****@*****.**"]
        #bcc = []

        create_email(mail_template_file,
                     mail_dict,
                     subject,
                     from_email,
                     to_email,
                     bcc=bcc)