40 Commits

Author SHA1 Message Date
6a11c1fe86 Update API routing, OpenAPI docs, and mailing grid columns
- Add API prefix route convention and custom OpenAPI transformer in Program.cs
- Change "Active" column header to "Sent" in mailing grids
- Improve schedule date sorting logic in ScheduledMailings.tsx
2026-01-30 18:35:03 -06:00
9f6b1ae74c Add unsubscribe link validation and related enhancements
- Introduced `ValidateUnsubscribeLink` endpoint in `MailingsController`.
- Refactored `UnsubscribeListsController` to inherit from `BaseController`.
- Added `Url` property to `UnsubscribeList` and updated related mappings.
- Enhanced `IMailingService` and `MailingService` for unsubscribe link handling.
- Implemented validation logic in `MailingEdit.tsx` with confirmation dialogs.
- Updated `TemplateEdit.tsx` for inserting unsubscribe links in templates.
- Improved sorting functionality in `CompletedMailings` and `ScheduledMailings`.
- Added `UnsubscribeValidationResult` interface for validation results.
2025-08-31 06:48:25 -05:00
651b33171b Reintroduce MailingEmailMap and enhance template handling
- Added `MailingEmailMap` back to `EntityMapperConfiguration.cs`.
- Improved error handling in `MailingRepository.cs` by adding a check for `MailingTemplate` mapping.
- Updated template retrieval logic to fetch by ID when `TemplateId` is greater than 0.
- Modified `GetAllAsync` to include an additional parameter for mapping `MailingTemplate`.
- Enhanced `MailingEdit.tsx` to pre-fill form fields with existing template data for existing mailings.
- Updated template selection logic to ensure form data reflects the current state of the selected template.
2025-08-24 09:17:20 -05:00
5a6c57bade Add unsubscribe list management functionality
This commit introduces comprehensive functionality for managing unsubscribe lists within the application. Key changes include:

- Creation of new DTOs, services, repositories, and controllers for unsubscribe list operations.
- Updates to `MailingsController.cs` and `TestEmailListsController.cs` to include necessary using directives.
- Registration of `IUnsubscribeListService` and `IUnsubscribeListRepository` in `Program.cs`.
- Implementation of the `UnsubscribeListsController` with API endpoints for CRUD operations.
- Introduction of the `UnsubscribeList` entity and its mapping to database columns.
- Modifications to existing classes, including `Mailing` and `Target`, to reference unsubscribe lists.
- Frontend updates to TypeScript interfaces and components for displaying and selecting unsubscribe lists.

These enhancements provide a more robust email management system.
2025-08-24 08:04:53 -05:00
0208536f67 Remove AdminAuth and update AllowedHosts settings
This commit removes the `AdminAuth` section from the
`appsettings.Development.json`, `appsettings.Uat.json`,
and `appsettings.json` files, eliminating the URL for
the admin authentication service. Additionally, the
`AllowedHosts` setting in `appsettings.json` has been
updated to restrict allowed hosts to specific domains
(`*.surge365.com;*.travmanity.com`). The `ConnectionStrings`
section has also been removed from the development and UAT
configuration files.
2025-07-01 17:56:54 -05:00
bc0c7d3197 Refactor configuration and error logging in Program.cs
Removed custom configuration source and AdminContext creation.
Added default service registration and SendGrid HTTP client.
Updated error logging to use SurgeLoggerProvider for improved
error handling during application startup.
2025-07-01 16:21:31 -05:00
29e1f2fd62 Refactor configuration setup and error handling
- Added custom configuration sources to the builder.
- Removed Azure Key Vault integration for secret management.
2025-06-29 09:18:59 -05:00
ba01cfcaf7 Refactor authentication and restructure project architecture
This commit removes the `AuthenticationController.cs` and related DTOs, indicating a shift in authentication handling. The `BaseController.cs` has been updated to remove the authorization attribute, affecting access control. Multiple controllers have been restructured to reference `Surge365.Core.Controllers`.

Significant changes in `Program.cs` enhance security and service management with new middleware and JWT configurations. The project file now includes references to `Surge365.Core`, and the `IAuthService` interface has been updated accordingly.

React components have been modified to support the new authentication flow, including token refresh handling. The `customFetch.ts` utility has been improved for better session management. Mapping classes have been introduced or updated for improved entity mapping.

Overall, these changes enhance the application's architecture, security, and data handling processes.
2025-06-28 09:26:41 -05:00
7faac8b448 Enhance mailing functionality and update UI titles
- Added `@bounced_email_key` output parameter in `BouncedEmailRepository.cs`.
- Updated dialog title in `BouncedEmailEdit.tsx` from "Add Bounced Email" to "Add Blocked Email".
- Refactored validation schema in `MailingEdit.tsx`, removing old code and adding new validation rules.
- Introduced `nameIsAvailable` and `getNextAvailableName` functions in `MailingEdit.tsx`.
- Integrated `setupData` context in `ActiveMailings.tsx`, `CancelledMailings.tsx`, `NewMailings.tsx`, and `ScheduledMailings.tsx` to refresh setup data during mailing operations.
2025-05-29 15:16:39 -05:00
0e099bfd07 Enhance authentication and logging mechanisms
Updated authentication handling in controllers, added JWT support, and improved error logging. Introduced centralized API calls with customFetch for better token management. Added Grafana's Faro SDK for monitoring and tracing. Refactored project files for improved structure and maintainability.
2025-05-19 17:26:37 -05:00
3bd334f239 Integrate Azure Key Vault and refactor authentication
Updated the application to use Azure Key Vault for managing secrets, including the addition of a new `SurgeKeyVaultSecretManager` class. Modified configuration files to include `KeyVaultName` and removed sensitive `Jwt` sections for enhanced security.

Refactored `IAuthService` and `IUserRepository` to utilize DTOs instead of the `User` entity. Removed the `UserMap` class and updated the `UserRepository` to focus on DTOs for user management.

The `AuthService` class now communicates with an external API for authentication, and new classes for API requests and responses have been added. Updated project dependencies to support Azure Key Vault integration.
2025-04-24 16:32:26 -05:00
712dbb5046 Add TotalRows to TargetSample and update related components
- Updated `TargetSample` class to include `TotalRows` property.
- Set `TotalRows` in `TargetRepository` based on database query.
- Added state management for `targetSample` and loading in `MailingEdit.tsx`.
- Modified rendering logic in `MailingEdit.tsx` to display total rows.
- Updated `TargetSampleModal` to accept `targetSample` as a prop.
- Created new `targetSample.ts` file defining the `TargetSample` interface.
2025-04-17 08:15:19 -05:00
51c267e48f Add API endpoints for emails and templates retrieval
- Introduced new endpoints in `MailingsController.cs` for fetching emails and templates by mailing ID.
- Updated `MailingUpdateDto` to include `MailingTemplateUpdateDto`.
- Extended `IMailingRepository` and `IMailingService` with methods for emails, templates, and targets.
- Modified `Mailing` class to include a `MailingTemplate` property; removed `SessionActivityId`.
- Implemented new methods in `MailingRepository` with adjusted SQL queries.
- Created new entity classes: `MailingEmail`, `MailingTarget`, and `MailingTemplate`.
- Added mapping configurations for new entities in Dapper maps.
- Updated `MailingEdit.tsx` and `MailingView.tsx` components for new structures and improved UI handling.
- Adjusted `Mailing` interface and created TypeScript interfaces for new entities.
2025-04-14 16:09:07 -05:00
9703517974 Update configuration and mailing service functionality
- Added HTTP client configuration for SendGrid in Program.cs.
- Cleaned up appsettings files for development and production environments.
- Modified MailingService to use IHttpClientFactory for SendGrid.
- Enhanced NewMailings component with cancel functionality and confirmation dialog.
- Updated project dependencies in .csproj and created package-lock.json.
2025-04-09 11:57:32 -05:00
d977b3701b Filter active items in MailingEdit and TemplateEdit
Updated Autocomplete options to use filtered lists of active targets, templates, and email domains. This change ensures that only active items are displayed in the dropdowns for selection.
2025-04-09 10:20:51 -05:00
ac1cdfb115 Format dates in UTC for RecentMailingStatsChart
Updated the `dateStr` variable in the `RecentMailingStatsChart` function to use `dayjs.utc(currentDate).format('YYYY-MM-DD')` instead of the previous method. This change ensures consistent date formatting across different time zones when aggregating statistics.
2025-04-08 07:48:36 -05:00
c14b33c77b Enhance date handling in RecentMailingStatsChart
- Import additional Dayjs plugins for UTC and timezone support.
- Update start and end dates to reflect the start and end of the day.
- Fetch mailing statistics using formatted date strings in the correct timezone.
- Modify statistics aggregation to include all dates in the range.
- Change aggregation method from `reduce` to `forEach`.
- Update x-axis value formatter to use UTC date formatting.
2025-04-07 21:09:14 -05:00
5e85b9e596 Refactor authentication and layout structure
- Updated `AuthenticationController` to handle refresh tokens and store them in the database.
- Modified `IAuthService` and `IUserRepository` to support new authentication logic using refresh tokens.
- Removed `GenerateTokens` method and added `SaveRefreshToken` method.
- Adjusted database mappings in `UserMap`.
- Enhanced `AuthService` to implement new authentication flow.
- Removed `LayoutAdminLTE.tsx`, simplifying the layout structure.
- Improved theme initialization in `App.tsx` for persistent settings.
- Cleaned up component files (`Home`, `Login`, `Targets`, `Templates`) by removing boilerplate code.
- Added `eslint.config.js` for ESLint configuration.
- Introduced `ThemeWrapper.tsx` for managing theme settings (implementation commented out).
2025-04-07 20:28:52 -05:00
f5b1fe6397 Update mailing and target management features
- Added new methods for creating mailings and testing targets.
- Updated configuration files for JWT settings and connection strings.
- Introduced new DTOs for target column updates and test targets.
- Enhanced MailingStatistic with a new SentDate property.
- Created new components for handling cancelled mailings and target samples.
- Refactored authentication in Login.tsx to use fetch API.
- Updated various services and repositories to support new functionalities.
2025-04-07 12:13:44 -05:00
26abe9e028 Add mailing features and update notification system
- Updated `MailingsController` with new endpoints for name availability and next available name.
- Modified existing methods to accept optional date parameters.
- Introduced `TestMailingDto` for testing mailings with email addresses.
- Updated `IMailingRepository` and `IMailingService` interfaces for new methods.
- Enhanced `MailingRepository` and `MailingService` to support new logic for testing and sending emails.
- Updated `appsettings.json` with new SendGrid settings and default unsubscribe URL.
- Modified `MailingEdit` component to fetch next available name and handle test mailings.
- Added search filters for start and end dates in `CompletedMailings` component.
- Included `react-toastify` for notifications in `package.json` and `package-lock.json`.
- Updated `App` component to include `ToastContainer` for displaying notifications.
2025-03-30 08:32:57 -05:00
035a2e1dae Add mailing statistics endpoints and frontend components
Updated `MailingsController` to include endpoints for retrieving mailing statistics by status and ID. Modified `IMailingRepository` and `IMailingService` to support new methods for fetching statistics and canceling mailings. Introduced `MailingStatistic` class and corresponding Dapper mappings.

In the React frontend, added `ActiveMailings` and `CompletedMailings` components to display statistics, along with a `ConfirmationDialog` for canceling mailings. Updated authentication management in `AuthCheck` and `AuthContext`. Created `mailingStatistic.ts` for TypeScript interface definition.
2025-03-25 14:02:02 -05:00
f4ac033c70 Refactor mailing and target sample management features
- Updated `UpdateMailing` to convert dates from UTC to local time.
- Renamed `GetTargetSample` to `TestTargetAsync` in `TargetsController`.
- Added `ConnectionStringTemplate` to `appsettings.Development.json`.
- Introduced `TestTargetSql` in `appsettings.json` for SQL queries.
- Created a new `TargetSample` class for target sample data structure.
- Updated `ITargetRepository` and `ITargetService` interfaces for new method signatures.
- Implemented `TestTargetAsync` in `TargetRepository` for sample data retrieval.
- Enhanced `MailingEdit.tsx` with new imports and validation for date fields.
- Added `MailingView` component for displaying mailing details.
- Introduced `ScheduleMailings` component for managing scheduled mailings.
- Updated `TargetSampleViewer` to accommodate new data structure.
- Modified routing in `App.tsx` to include scheduled mailings.
- Adjusted `NewMailings` component to manage mailing updates and removals.
2025-03-23 19:15:17 -05:00
525a9b808c Update MailingEdit to handle templates and save logic
- Added `setupData.templates` to the useEffect dependencies.
2025-03-21 19:31:33 -05:00
12bfdf57ce Add target sample data retrieval and viewer components
- Implemented `GetTargetSample` in `TargetsController` for fetching target sample data.
- Updated `ITargetRepository` and `ITargetService` with `GetSampleData` method.
- Created `TargetSample` class to structure sample data.
- Added `GetSampleData` method in `TargetRepository` with hardcoded sample data.
- Enhanced `MailingEdit.tsx` to manage target sample visibility and validation.
- Introduced `TargetSampleViewer` and `TemplateViewer` components for displaying data in dialogs.
- Made minor adjustments in `Servers.tsx` for better row handling.
2025-03-21 19:30:41 -05:00
a5fd034a31 Add mailing functionality and improve authentication
- Implemented Logout and RefreshToken methods in AuthenticationController.
- Added IMailingService and IMailingRepository to Program.cs.
- Updated project structure in Surge365.MassEmailReact.API.csproj.
- Modified API host address and endpoints in Server.http.
- Introduced AuthAppCode in appsettings.json for context distinction.
- Changed GenerateTokens method to async in IAuthService.
- Initialized string properties in User.cs to avoid null values.
- Added new Mailing mapping in DapperConfiguration.cs.
- Created MailingsController for handling mailing operations.
- Developed Mailing, MailingUpdateDto, IMailingService, and IMailingRepository classes.
- Updated frontend with MailingEdit and NewMailings components.
- Enhanced authentication handling in AuthCheck.tsx and AuthContext.tsx.
- Introduced ProtectedPageWrapper for route protection based on roles.
- Added EmailList component for email input validation.
- Updated utils.ts for token and cookie management functions.
- Modified vite.config.ts for new HTTPS certificate name.
- Updated CHANGELOG.md to reflect recent changes.
2025-03-21 07:38:46 -05:00
ef75bdb779 Refactor API structure and update UI components
- Changed namespaces for controllers to better organize API components.
- Updated base class for controllers to `BaseController` with standard routing.
- Simplified method signatures by removing `id` parameters in entity creation methods.
- Introduced new `CreateAsync` methods in service and repository layers.
- Removed dependencies on `font-awesome` and `ionicons` from package files.
- Migrated UI components to Material-UI, enhancing consistency and design.
- Refactored `ForgotPasswordModal` to use Material-UI's `Dialog`.
- Implemented `yup` validation in form components for stricter checks.
- Cleaned up unused styles in CSS files for a cleaner codebase.
- Updated interfaces to require `id` property for stricter type checks.
- Improved error handling and user feedback in the `Login` component.
- Added action buttons for adding and refreshing data in various components.
2025-03-05 12:10:43 -06:00
d7b00cf335 Enhance email domain management and switch to Monaco Editor
Updated EmailDomainsController to support password retrieval.
Modified repository and service interfaces to include a new
optional `returnPassword` parameter. Transitioned from Tiptap
to Monaco Editor for rich text editing. Improved UI for
EmailDomainEdit and TemplateEdit components, added password
visibility toggle in EmailDomains, and refined data grid
layout in Templates.
2025-03-04 18:54:57 -06:00
2bdb1a8de6 Implement RESTful APIs for email management features
Created controllers for managing bounced emails, email domains, templates, test email lists, and unsubscribe URLs. Modified the ServersController for improved routing. Added DTOs and repository interfaces for new functionalities. Updated SetupDataContext for state management and adjusted frontend components for user interaction. Updated package dependencies for new features.
2025-03-03 19:15:16 -06:00
6f00235702 Add target and server management features
- Implemented CreateTarget and updated UpdateTarget methods in TargetsController.
- Introduced IServerService and IServerRepository for server operations.
- Created ServersController for handling server-related API requests.
- Added ServerUpdateDto for server updates and enhanced Target/Server classes with default values.
- Updated TargetRepository and TargetService for target creation and updates.
- Modified DapperConfiguration for server mappings.
- Updated package dependencies for form validation and state management.
- Enhanced Layout.tsx for improved responsiveness and user experience.
- Added TitleContext for managing page titles.
- Updated Servers.tsx and ServerEdit.tsx for server data handling.
- Improved error handling and loading states across components.
2025-02-28 09:33:38 -06:00
4180e50c9c Refactor authentication and implement target management
- Updated `AuthenticationController` to return user data instead of token.
- Added `ITargetService` and `ITargetRepository` to `Program.cs`.
- Enhanced `appsettings.json` with connection timeout and security notes.
- Modified `IAuthService` to reflect new authentication response structure.
- Implemented connection retry mechanism in `DataAccess.cs`.
- Refactored UI components to use MUI styling in `Layout.tsx`, `App.tsx`, and others.
- Created new files for target management, including `TargetsController`, `TargetUpdateDto`, and related services.
- Added `TargetEdit` modal for editing target details and `LineChartSample` for data visualization.
- Updated package dependencies in `package-lock.json` and project file.
2025-02-26 17:42:40 -06:00
b3f266f9a8 Enhance authentication features and refactor codebase
Updated `AuthenticationController` with new methods for authentication, token refresh, and password recovery. Improved error handling and response structure.

Refactored dependency injection in `Program.cs` and added JWT settings in `appsettings.json`. Removed unused `Class1.cs` files.

Introduced new DTOs for authentication requests and updated `IAuthService` and `IUserRepository` interfaces. Enhanced `User` class and added `AuthResult` enum for standardized responses.

Expanded `DataAccess` for better database operations and updated `UserRepository` and `AuthService` to implement new authentication logic.

Front-end changes include renaming variables for consistency and updating the `ForgotPasswordModal` and `Login.tsx` components to use usernames instead of email addresses.

Updated API proxy path in `vite.config.ts` and ensured proper typing for `API_BASE_URL` in global TypeScript definitions.
2025-02-22 18:45:37 -06:00
88bcac382c Refactor project structure and update dependencies
- Updated project setup to use Vite for React application.
- Removed unnecessary files and simplified configurations.
- Enhanced authentication and routing in the application.
- Improved code quality with ESLint and updated styles.
- Added new components for better user experience, including a password recovery modal.
- Updated documentation for clearer setup instructions.
2025-02-20 09:55:56 -06:00
dfb721c2f8 Update project dependencies and structure
Revised the dependency order in the project structure.
The `Surge365.MassEmailReact.API` now depends on both
`Application` and `Infrastructure`. Removed the reference
to `Infrastructure` in `Surge365.MassEmailReact.Application.csproj`.
Updated `Surge365.MassEmailReact.Infrastructure.csproj` to
include references to both `Application` and `Domain`.
Modified `Surge365.MassEmailReact.API.csproj` to include
a reference to `Surge365.MassEmailReact.Infrastructure`.
2025-02-20 09:21:22 -06:00
f8df86f1b4 Refactor project structure and remove deprecated features
- Updated README.md to include "Project Structure" section.
- Removed WeatherForecastController.cs and WeatherForecast.cs.
- Simplified Surge365.MassEmailReact.Server.csproj.
- Updated solution file to reflect new project references.
- Refactored jquery.ss.dbmanager-1.0.js and jquery.usahaulers.global.js.
- Modified logging functionalities in jquery.usahaulers.logging-1.0.js.
- Set up constants from environment variables in constants.js and constants.ts.
- Introduced new classes in Surge365.MassEmailReact.Application, Domain, and Infrastructure.
- Added UnitTest1.cs for basic unit testing structure.
- Enhanced Surge365.MassEmailReact.Web.esproj with new configurations.
- Expanded utility functions in ytb-massemail-.global.ts and ytb-massemail-utilities-1.0.ts.
2025-02-20 08:09:21 -06:00
2fa7b500b9 Signed-off-by: David Headrick <david@headrickconsulting.com> 2025-02-19 18:58:12 -06:00
45c8eb4095 Update README with setup and cloning instructions
Added detailed instructions for cloning the project and setting up the development environment, including commands for Git, Node.js installation via nvm for Windows, and verification steps for Node.js and npm versions.
2025-02-19 18:46:01 -06:00
cf9c98c18c added launch.json 2025-02-19 18:06:09 -06:00
488d7cbf90 Signed-off-by: David Headrick <david@headrickconsulting.com> 2025-02-19 16:40:46 -06:00
fe1af7df2b Initial Commit
Signed-off-by: David Headrick <david@headrickconsulting.com>
2025-02-17 12:00:42 -06:00
3f88e8f60a Initial commit 2025-02-17 10:41:28 -06:00