.env file. sendMail() function demonstrates how to automate email attachments based on transaction data.
- Retrieves customer_details from the current stripe session data object such as:
- customer email
- customer name
- Retrieves the line_items collection from the current stripe session data object and processes purchase data such as:
- id (line_item)
- quantity
- description
- price object
- id (product)
- unit_amount
Sample Stripe Webhook Log File Name: log_26-Sep-2023.log
26-Sep-2023 Stripe Log
02:22:20pm - Starting execution.
02:22:20pm - Response OK
02:22:20pm - processing: payment_intent.succeeded event.
02:22:25pm - Email: [email protected]
02:22:25pm - Name: john doe
02:22:25pm - Line Item Id: li_1Nuc8fA2CUhNBxyOeqZMYDSd
02:22:25pm - Product Id: prod_N8dEoQ10mY8Bkk
02:22:25pm - Qty: 1
02:22:25pm - Desc: Maintenance Checklists in Excel
02:22:25pm - Price: 149
02:22:26pm - Product delivered automatically via Email or Link. Metadata product_email_filename: maint-checklists.zip
02:22:26pm - Product delivered via Link
02:22:26pm - Email accepted by server.
02:22:26pm - Webhook completed OK
Thank you for viewing our product. Please Contact Us with product questions or feedback.