# DVC Listings Notifier Plugin

## Overview
The **DVC Listings Notifier** is a custom WordPress plugin designed to automate and manage daily email notifications for new, bonus, and reduced DVC resale listings. It integrates with the DVC Resale Market website to ensure subscribers and interested parties are promptly informed about the latest listings and special offers.

## Features
- **Automated Daily Emails:** Sends daily emails to subscribers with new, bonus, and reduced DVC listings.
- **Red Hot Deals Promotions:** Highlights special promotional offers and Red Hot Deals in email notifications.
- **Customizable Email Content:** Dynamically generates email content based on current listings and promotions.
- **Efficient Data Handling:** Utilizes MySQL and Redis for fast and reliable data retrieval and caching.
- **Error Handling & Logging:** Tracks errors and performance metrics for ongoing reliability.

## Email Template Management
This repository includes the `sparkpost-template.html` file which contains the email template used for daily notifications. **Important notes:**

- **Manual Upload Process:** The template is uploaded manually to SparkPost and is not automatically deployed by the plugin
- **No Plugin Integration:** The template file has no direct tie-in to the plugin functionality - it's managed separately
- **Version Tracking:** The template should be kept in sync with `class-notifier-v3.php` to ensure consistent tracking and easier maintenance
- **Template Updates:** When making changes to promotional content (like Red Hot Deals), both the template and the PHP class should be updated together

## New Relic Integration
This plugin is instrumented with [New Relic](https://newrelic.com/) for application performance monitoring. Key metrics tracked include:
- **Transaction Response Times:** Monitors average, median, and percentile response times for the main notifier transaction (`WebTransaction/Custom/DVCNotifier/NotifierV3/start`).
- **Database and External API Calls:** Tracks the number and duration of MySQL and Redis queries, as well as external API calls (e.g., SparkPost for email delivery).
- **Error Rates & Apdex Score:** Measures error rates and user satisfaction (Apdex) to ensure high reliability and performance.
- **Memory Usage:** Monitors memory consumption throughout the transaction lifecycle.

Performance data and alerts from New Relic help the development team proactively identify and resolve bottlenecks, ensuring timely delivery of listing notifications and a smooth user experience.

## More Information
For detailed documentation, workflows, and troubleshooting, please refer to the [DVCRM - Daily Listings Email Atlassian Wiki](https://worldofdvc.atlassian.net/wiki/spaces/WOD/pages/45613058/DVCRM+-+Daily+Listings+Email).
