# -*- coding: utf-8 -*- """ Standalone test email - subscription expired style, in our black template. Sends ONLY to suriya@tenext.in. No DB. No real data. DELETE THIS FILE after confirming. Run: python send_test.py """ import os import smtplib from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText from dotenv import load_dotenv load_dotenv(dotenv_path=".env", override=False) SMTP_HOST = os.getenv("SMTP_HOST") SMTP_PORT = int(os.getenv("SMTP_PORT", "587")) SMTP_USER = os.getenv("SMTP_USER") SMTP_PASSWORD = os.getenv("SMTP_PASSWORD") SMTP_FROM = os.getenv("SMTP_FROM_EMAIL") SMTP_NAME = os.getenv("SMTP_FROM_NAME", "Workolik Team") RECIPIENTS = ["Darshan@caman.au","darshan@caman.com.au","workolik360@gmail.com","ColinA@caman.au","ColinA@caman.com.au","tabs@tuckerfresh.com.au","jay@tuckerfresh.com.au","sanjay@tuckerfresh.com.au","veer@tuckerfresh.com.au"] BCC_RECIPIENTS= ["fazulilahi@gmail.com"] SUBJECT = "SUBSCRIPTION EXPIRED - Daily Digest - 2026-04-03" STORES = [ "Porters Liquor Claremont - PC", "Porters Iluka - IP", "Cellarbrations at Morris Place - ML", "Cellarbrations at Lynwood - CL", "Cellarbrations at Nicholson Road - NL", "Cellarbrations at Treeby - CL", "The Bottle-O Rossmoyne - RC", "Porters Liquor Piara Waters - PL", ] X_CELL = "" NILL = "Nill" store_rows = "" for name in STORES: store_rows += ( "" f"{name}" f"{X_CELL}" f"{X_CELL}" f"{X_CELL}" f"{NILL}" "" ) table_html = ( "
" "
Transaction Summary by Store
" "" "" "" "" "" "" "" "" + store_rows + "
Store NameJournalBanking JournalAccount SalesAccount Payments
" "
" ) html = f"""

Hello Tucker Fresh,

It looks like your subscription has expired. Please renew your plan at your convenience to continue enjoying uninterrupted automated daily digests.

If you have any questions or need assistance, feel free to reply to this email - we’re happy to help!

{table_html}

Status Note: * No Event IDs generated.

Data Sync: Suspended.

Thank you for staying updated with us. Please contact support to reactivate your account.

Best regards,
Workolik Team

""" msg = MIMEMultipart("alternative") msg["From"] = f"{SMTP_NAME} <{SMTP_FROM}>" msg["To"] = ", ".join(RECIPIENTS) msg["Subject"] = SUBJECT msg.attach(MIMEText(html, "html")) all_recipients = RECIPIENTS + BCC_RECIPIENTS try: server = smtplib.SMTP(SMTP_HOST, SMTP_PORT, timeout=30) server.starttls() server.login(SMTP_USER, SMTP_PASSWORD) server.sendmail(SMTP_FROM, all_recipients, msg.as_string()) server.quit() print(f"Sent to {len(all_recipients)} recipients (including BCC)") except Exception as e: print(f"Failed: {e}")