From ca82375bca13c719b1f101efedcb0944e358ee82 Mon Sep 17 00:00:00 2001 From: John Cardinal Date: Mon, 8 May 2023 22:54:18 +0000 Subject: [PATCH] case 4173 --- .vscode/launch.json | 12 +- docs/8.0/ayanova/docs/ay-ex-direct-smtp.md | 21 + docs/8.0/ayanova/docs/changelog.md | 3 +- docs/8.0/ayanova/mkdocs.yml | 419 +++++++++--------- .../Controllers/JobOperationsController.cs | 59 +++ server/AyaNova/biz/JobType.cs | 3 +- .../models/dto/BatchDirectSMTPParams.cs | 17 + server/AyaNova/util/AySchema.cs | 38 +- 8 files changed, 354 insertions(+), 218 deletions(-) create mode 100644 docs/8.0/ayanova/docs/ay-ex-direct-smtp.md create mode 100644 server/AyaNova/models/dto/BatchDirectSMTPParams.cs diff --git a/.vscode/launch.json b/.vscode/launch.json index 6f3fd776..1a4bbd25 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -63,7 +63,7 @@ "AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=300;", "AYANOVA_DATA_PATH": "c:\\temp\\ravendata", "AYANOVA_USE_URLS": "http://*:7575;", - //"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true", + "AYANOVA_PERMANENTLY_ERASE_DATABASE":"true", //"AYANOVA_REMOVE_LICENSE_FROM_DB":"true", //"AYANOVA_REPORT_RENDERING_TIMEOUT":"1", //"AYANOVA_REPORT_RENDER_API_URL_OVERRIDE": "http://localhost:7575", @@ -102,10 +102,10 @@ // Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser //this needs to be tweaked probably //https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md#starting-a-web-browser - "serverReadyAction": { - "action": "openExternally", - "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" - }, + // "serverReadyAction": { + // "action": "openExternally", + // "pattern": "^\\s*Now listening on:\\s+(https?://\\S+)" + // }, "env": { //############ SUBSCRIPTION MODE BLOCK ###################### @@ -119,7 +119,7 @@ "AYANOVA_DB_CONNECTION": "Server=localhost;Username=postgres;Password=raven;Database=AyaNova;CommandTimeout=300;", "AYANOVA_DATA_PATH": "c:\\temp\\ravendata", "AYANOVA_USE_URLS": "http://*:7575;", - //"AYANOVA_PERMANENTLY_ERASE_DATABASE":"true", + "AYANOVA_PERMANENTLY_ERASE_DATABASE":"true", //"AYANOVA_REMOVE_LICENSE_FROM_DB":"true", //"AYANOVA_SET_SUPERUSER_PW": "abraxis", "AYANOVA_BACKUP_PG_DUMP_PATH": "C:\\data\\code\\postgres_14\\bin" diff --git a/docs/8.0/ayanova/docs/ay-ex-direct-smtp.md b/docs/8.0/ayanova/docs/ay-ex-direct-smtp.md new file mode 100644 index 00000000..072bd0b0 --- /dev/null +++ b/docs/8.0/ayanova/docs/ay-ex-direct-smtp.md @@ -0,0 +1,21 @@ +# Send email extension + +![send email extension](img/ay-ex-direct-smtp.png) + +The Send email extension can be used to send an email to the selected objects email address. + +## Authorization Roles required + +This extension is available to User's with read / write editing rights to the business object. + +## Supported types + +This extension is available for data tables containing the following object types: [Customer](customers.md),[Head office](head-offices.md), [Vendor](vendors.md) and [Users](adm-users.md). + +## How to access + +The Send email extension is accessed from the [extensions](ay-extensions.md) menu item in business object data tables. + +## How the Send email extension works + +Compose a message and start the job. At the server each object that is selected will be emailed with a small delay between each one. Objects without an email address will be ignored. diff --git a/docs/8.0/ayanova/docs/changelog.md b/docs/8.0/ayanova/docs/changelog.md index 2b3d53b2..7b779a48 100644 --- a/docs/8.0/ayanova/docs/changelog.md +++ b/docs/8.0/ayanova/docs/changelog.md @@ -10,7 +10,7 @@ See the [upgrade instructions](ops-upgrade.md) section of this manual for detail ### AyaNova 8.0.43 -Released 2023-05-02 +Released 2023-05-08 #### Fixed @@ -19,6 +19,7 @@ Released 2023-05-02 **Added** - App: Now indicates if an AyaNova server update is available on login ("Perpetual" licensed build only) +- App: Trial period remaining days display added on login **Changed** diff --git a/docs/8.0/ayanova/mkdocs.yml b/docs/8.0/ayanova/mkdocs.yml index 02d464fe..4eeb60b2 100644 --- a/docs/8.0/ayanova/mkdocs.yml +++ b/docs/8.0/ayanova/mkdocs.yml @@ -2,221 +2,222 @@ theme: name: material palette: scheme: default - favicon: 'img/favicon.ico' - logo: 'img/logo.svg' + favicon: "img/favicon.ico" + logo: "img/logo.svg" site_name: AyaNova manual -site_dir: '../../../server/AyaNova/wwwroot/docs' -strict: true -copyright: Copyright © 2023 Ground Zero Tech-Works Inc. REV-2023-05-02 -extra: +site_dir: "../../../server/AyaNova/wwwroot/docs" +strict: true +copyright: Copyright © 2023 Ground Zero Tech-Works Inc. REV-2023-05-08 +extra: generator: false # Extensions -markdown_extensions: +markdown_extensions: - pymdownx.highlight: anchor_linenums: true - pymdownx.superfences - toc: - permalink: true + permalink: true nav: -- Home: 'index.md' -- User guide: - - 'Try AyaNova now': 'ay-evaluate.md' - - Guided tours: - - 'Introduction': 'tour-intro.md' - - Start here: - - 'Steps to production use': 'tour-bootstrap-intro.md' - - 'Evaluation': 'tour-bootstrap-evaluate.md' - - 'Acquisition': 'tour-bootstrap-acquire.md' - - 'Configuration and going live': 'tour-bootstrap-configure.md' - - 'Advanced features': 'tour-bootstrap-advanced.md' - - Business admin: - - 'Hide form fields': 'tour-bizadmin-form-remove-fields.md' - - 'Require field entry': 'tour-bizadmin-form-require-fields.md' - - 'Customize text': 'tour-bizadmin-form-custom-translation.md' - - 'Custom fields': 'tour-bizadmin-form-custom-fields.md' - - Service: - - 'Create a Customer': 'tour-service-create-customer.md' - - 'Create a work order': 'tour-service-wo.md' - - 'Changes from AyaNova 7': 'ay-start-changes-from-v7.md' - - User interface: - - Introduction: - - 'Forms': 'ay-start-form-overview.md' - - 'Login': 'ay-start-login.md' - - 'Edit forms': 'ay-start-edit-forms.md' - - 'Form controls': 'ay-start-common-controls.md' - - 'Data tables': 'ay-start-form-data-tables.md' - - 'Autocomplete lists': 'ay-start-form-autocomplete.md' - - 'Tags': 'ay-start-form-tags.md' - - 'Wiki': 'ay-start-form-wiki.md' - - 'Custom fields': 'ay-customize.md' - - 'Attachments': 'ay-start-form-attachments.md' - - Home: - - 'Dashboard': 'home-dashboard.md' - - 'Search': 'home-search.md' - - 'Schedule': 'home-schedule.md' - - 'Memos': 'home-memos.md' - - 'Reminders': 'home-reminders.md' - - 'Reviews': 'home-reviews.md' - - 'User settings': 'home-user-settings.md' - - 'Set password': 'home-password.md' - - 'Two factor authentication': 'home-tfa.md' - - 'Notification subscriptions': 'home-notify-subscriptions.md' - - 'Notifications list': 'home-notifications.md' - - 'Direct notification': 'home-notify-direct.md' - - 'History': 'ay-history.md' - - Customers: - - 'Customers': 'customers.md' - - 'Customer contacts': 'cust-contacts.md' - - 'Customer notes': 'customer-notes.md' - - 'Head offices': 'head-offices.md' - - 'Customer notifications': 'customer-notify-subscriptions.md' - - Service: - - 'Schedule': 'svc-schedule.md' - - 'Work orders': 'svc-workorders.md' - - 'Work order task group': 'svc-task-groups.md' - - 'Work order status': 'svc-work-order-status.md' - - 'Work order item status': 'svc-work-order-item-status.md' - - 'Work order item priority': 'svc-work-order-item-priority.md' - - 'Quotes': 'svc-quotes.md' - - 'Quote status': 'svc-quote-status.md' - - 'Preventive maintenance': 'svc-pms.md' - - 'Customer units': 'svc-units.md' - - 'Unit models': 'svc-unit-models.md' - - 'Loan items': 'svc-loaners.md' - - 'Contracts': 'svc-contracts.md' - - 'Projects': 'svc-projects.md' - - 'Customer service requests': 'svc-csr.md' - - 'Meter readings': 'svc-meter-readings.md' - - Inventory: - - 'Parts': 'inv-parts.md' - - 'Part warehouses': 'inv-part-warehouses.md' - - 'Part serial numbers': 'inv-part-serials.md' - - 'Part stock levels': 'inv-part-stock-levels.md' - - 'Part assemblies': 'inv-part-assemblies.md' - - 'Part inventory': 'inv-part-inventory.md' - - 'Part requests': 'inv-part-requests.md' - - 'Purchase orders': 'inv-purchase-orders.md' - - 'Adjustments / transactions': 'inv-part-inventory-transactions.md' - - Accounting: - - 'Service rates': 'acc-service-rates.md' - - 'Travel rates': 'acc-travel-rates.md' - - 'Tax codes': 'acc-tax-codes.md' - - Administration: - - 'Getting started guided tour': 'tour-bootstrap-configure.md' - - 'Global settings': 'adm-global-settings.md' - - 'Seed numbers': 'adm-global-seeds.md' - - 'License': 'adm-license.md' - - 'Users': 'adm-users.md' - - 'Translations': 'adm-translations.md' - - 'Localization': 'ay-start-localization.md' - - 'Report templates': 'adm-report-templates.md' - - 'adm-attachments.md' - - 'Global history': 'adm-history.md' - - 'Import': 'adm-import.md' - - 'Import Customers': 'adm-import-customer.md' - - 'Import Head offices': 'adm-import-headoffice.md' - - 'Import Inventory': 'adm-import-inventory.md' - - 'Import Part assemblies': 'adm-import-part-assembly.md' - - 'Import Parts': 'adm-import-part.md' - - 'Import Projects': 'adm-import-project.md' - - 'Import Service rates': 'adm-import-service-rate.md' - - 'Import Task groups': 'adm-import-task-group.md' - - 'Import Travel rates': 'adm-import-travel-rate.md' - - 'Import Unit models': 'adm-import-unit-model.md' - - 'Import Units': 'adm-import-unit.md' - - 'Import Vendors': 'adm-import-vendor.md' - - 'Import Warehouses': 'adm-import-warehouse.md' - - 'Integrated applications': 'adm-integrations.md' - - 'Vendors': 'vendors.md' - - Extensions: - - 'Extensions': 'ay-extensions.md' - - 'Tags extension': 'ay-ex-tags.md' - - 'Export extension': 'ay-ex-export.md' - - 'Delete extension': 'ay-ex-delete.md' - - Misc: - - 'About': 'ay-about.md' - - 'Authorization roles': 'ay-biz-admin-roles.md' - - 'Business logos': 'adm-global-logo.md' - - 'Customize': 'ay-customize.md' - - 'Migrating from v7': 'ay-biz-admin-migrate-v7.md' - - 'Report editor': 'ay-report-edit.md' - - 'Report picker': 'ay-report.md' - - 'Report timeout warning': 'ay-report-timeout.md' - - 'Autocomplete list templates': 'adm-global-autocomplete-templates.md' - - 'Web app diagnostic log': 'ay-log.md' -- Integrations: - - 'QuickBooks desktop': 'integration-qbd.md' -- Server operations guide: - - 'Introduction': 'ops-intro.md' - - Installation: - - 'Start': 'ops-install.md' - - 'Windows': 'ops-install-windows.md' - - 'Windows single user': 'ops-install-windows-single.md' - - 'Windows local network': 'ops-install-windows-lan.md' - - 'Windows IIS': 'ops-install-windows-iis.md' - - 'Linux': 'ops-install-linux.md' - - 'Linux desktop': 'ops-install-linux-desktop.md' - - 'Linux server': 'ops-install-linux-server.md' - - Upgrade: - - 'Start': 'ops-upgrade.md' - - 'Windows single user': 'ops-upgrade-windows-single.md' - - 'Windows local network': 'ops-upgrade-windows-lan.md' - - 'Windows IIS': 'ops-upgrade-windows-iis.md' - - 'Linux desktop': 'ops-upgrade-linux-desktop.md' - - 'Linux server': 'ops-upgrade-linux-server.md' - - Migration: - - 'Migrating from AyaNova 7': 'ops-import-v7.md' - - Backup & Restore: - - 'Backup': 'ops-form-backup.md' - - 'Restore': 'ops-restore.md' - - Operations interface: - - 'Server state': 'ops-server-state.md' - - 'Backup': 'ops-form-backup.md' - - 'Job queue': 'ops-jobs.md' - - 'Server log': 'ops-log.md' - - 'Server metrics': 'ops-metrics.md' - - 'Notification settings': 'ops-notification-system.md' - - 'Customer notification log': 'ops-customer-notify-log.md' - - 'User notification log': 'ops-notify-log.md' - - 'Backup': 'ops-form-backup.md' - - Technical: - - 'Maintenance': 'ops-maintenance.md' - - 'Logging': 'ops-log.md' - - 'View server settings': 'ops-server-information.md' - - 'Server locale settings': 'ops-server-locale.md' - - 'Translation / Language': 'ops-config-default-translation.md' - - 'Data path': 'ops-config-data-path.md' - - 'Attachments folder': 'ops-config-folder-user-files.md' - - 'Server temporary files folder': 'ops-config-folder-temporary-files.md' - - 'Database configuration': 'ops-config-db.md' - - 'PORT and URL configuration': 'ops-config-use-urls.md' - - 'Reporting render API URL override': 'ops-config-report-rendering-api-url-override.md' - - 'Reporting render browser path': 'ops-config-report-render-browser-path.md' - - 'Reporting timeout configuration': 'ops-config-report-rendering-timeout.md' - - 'Environment variable reference': 'ops-config-environment-variables.md' - - 'Security and JWT web tokens': 'ops-config-jwt-secret.md' - - 'SuperUser password reset': 'ops-config-set-superuser-pw.md' - - 'Server error codes': 'ops-error-codes.md' - - 'Migrating from AyaNova 7': 'ops-import-v7.md' - - 'Metrics': 'ops-metrics.md' - - 'Notification system': 'ops-notification-system.md' - - 'Backup utility PGDUMP path': 'ops-config-backup-pgdump-path.md' - - 'Backup folder': 'ops-config-folder-backup-files.md' -- Subscription service guide: - - 'Introduction': 'sub-service-intro.md' -- Developer guide: - - 'Introduction': 'api-intro.md' - - 'API developers console': 'api-console.md' - - 'API request format': 'api-request-format.md' - - 'API response format': 'api-response-format.md' - - 'API error codes': 'api-error-codes.md' - - 'API upload routes': 'api-upload-routes.md' - - 'API Integrated applications': 'api-integrated-applications.md' - - 'API Data types': 'ay-start-data-types.md' -- Appendix: - - 'Change log / release notes': 'changelog.md' - - 'Data types': 'ay-start-data-types.md' - - 'Open source credits': 'appendix-os-credits.md' - - 'Perpetual License agreement': 'license.md' - - 'Subscription service agreement': 'ayanova-subscription-service-agreement.md' + - Home: "index.md" + - User guide: + - "Try AyaNova now": "ay-evaluate.md" + - Guided tours: + - "Introduction": "tour-intro.md" + - Start here: + - "Steps to production use": "tour-bootstrap-intro.md" + - "Evaluation": "tour-bootstrap-evaluate.md" + - "Acquisition": "tour-bootstrap-acquire.md" + - "Configuration and going live": "tour-bootstrap-configure.md" + - "Advanced features": "tour-bootstrap-advanced.md" + - Business admin: + - "Hide form fields": "tour-bizadmin-form-remove-fields.md" + - "Require field entry": "tour-bizadmin-form-require-fields.md" + - "Customize text": "tour-bizadmin-form-custom-translation.md" + - "Custom fields": "tour-bizadmin-form-custom-fields.md" + - Service: + - "Create a Customer": "tour-service-create-customer.md" + - "Create a work order": "tour-service-wo.md" + - "Changes from AyaNova 7": "ay-start-changes-from-v7.md" + - User interface: + - Introduction: + - "Forms": "ay-start-form-overview.md" + - "Login": "ay-start-login.md" + - "Edit forms": "ay-start-edit-forms.md" + - "Form controls": "ay-start-common-controls.md" + - "Data tables": "ay-start-form-data-tables.md" + - "Autocomplete lists": "ay-start-form-autocomplete.md" + - "Tags": "ay-start-form-tags.md" + - "Wiki": "ay-start-form-wiki.md" + - "Custom fields": "ay-customize.md" + - "Attachments": "ay-start-form-attachments.md" + - Home: + - "Dashboard": "home-dashboard.md" + - "Search": "home-search.md" + - "Schedule": "home-schedule.md" + - "Memos": "home-memos.md" + - "Reminders": "home-reminders.md" + - "Reviews": "home-reviews.md" + - "User settings": "home-user-settings.md" + - "Set password": "home-password.md" + - "Two factor authentication": "home-tfa.md" + - "Notification subscriptions": "home-notify-subscriptions.md" + - "Notifications list": "home-notifications.md" + - "Direct notification": "home-notify-direct.md" + - "History": "ay-history.md" + - Customers: + - "Customers": "customers.md" + - "Customer contacts": "cust-contacts.md" + - "Customer notes": "customer-notes.md" + - "Head offices": "head-offices.md" + - "Customer notifications": "customer-notify-subscriptions.md" + - Service: + - "Schedule": "svc-schedule.md" + - "Work orders": "svc-workorders.md" + - "Work order task group": "svc-task-groups.md" + - "Work order status": "svc-work-order-status.md" + - "Work order item status": "svc-work-order-item-status.md" + - "Work order item priority": "svc-work-order-item-priority.md" + - "Quotes": "svc-quotes.md" + - "Quote status": "svc-quote-status.md" + - "Preventive maintenance": "svc-pms.md" + - "Customer units": "svc-units.md" + - "Unit models": "svc-unit-models.md" + - "Loan items": "svc-loaners.md" + - "Contracts": "svc-contracts.md" + - "Projects": "svc-projects.md" + - "Customer service requests": "svc-csr.md" + - "Meter readings": "svc-meter-readings.md" + - Inventory: + - "Parts": "inv-parts.md" + - "Part warehouses": "inv-part-warehouses.md" + - "Part serial numbers": "inv-part-serials.md" + - "Part stock levels": "inv-part-stock-levels.md" + - "Part assemblies": "inv-part-assemblies.md" + - "Part inventory": "inv-part-inventory.md" + - "Part requests": "inv-part-requests.md" + - "Purchase orders": "inv-purchase-orders.md" + - "Adjustments / transactions": "inv-part-inventory-transactions.md" + - Accounting: + - "Service rates": "acc-service-rates.md" + - "Travel rates": "acc-travel-rates.md" + - "Tax codes": "acc-tax-codes.md" + - Administration: + - "Getting started guided tour": "tour-bootstrap-configure.md" + - "Global settings": "adm-global-settings.md" + - "Seed numbers": "adm-global-seeds.md" + - "License": "adm-license.md" + - "Users": "adm-users.md" + - "Translations": "adm-translations.md" + - "Localization": "ay-start-localization.md" + - "Report templates": "adm-report-templates.md" + - "adm-attachments.md" + - "Global history": "adm-history.md" + - "Import": "adm-import.md" + - "Import Customers": "adm-import-customer.md" + - "Import Head offices": "adm-import-headoffice.md" + - "Import Inventory": "adm-import-inventory.md" + - "Import Part assemblies": "adm-import-part-assembly.md" + - "Import Parts": "adm-import-part.md" + - "Import Projects": "adm-import-project.md" + - "Import Service rates": "adm-import-service-rate.md" + - "Import Task groups": "adm-import-task-group.md" + - "Import Travel rates": "adm-import-travel-rate.md" + - "Import Unit models": "adm-import-unit-model.md" + - "Import Units": "adm-import-unit.md" + - "Import Vendors": "adm-import-vendor.md" + - "Import Warehouses": "adm-import-warehouse.md" + - "Integrated applications": "adm-integrations.md" + - "Vendors": "vendors.md" + - Extensions: + - "Extensions": "ay-extensions.md" + - "Tags extension": "ay-ex-tags.md" + - "Export extension": "ay-ex-export.md" + - "Email extension": "ay-ex-direct-smtp.md" + - "Delete extension": "ay-ex-delete.md" + - Misc: + - "About": "ay-about.md" + - "Authorization roles": "ay-biz-admin-roles.md" + - "Business logos": "adm-global-logo.md" + - "Customize": "ay-customize.md" + - "Migrating from v7": "ay-biz-admin-migrate-v7.md" + - "Report editor": "ay-report-edit.md" + - "Report picker": "ay-report.md" + - "Report timeout warning": "ay-report-timeout.md" + - "Autocomplete list templates": "adm-global-autocomplete-templates.md" + - "Web app diagnostic log": "ay-log.md" + - Integrations: + - "QuickBooks desktop": "integration-qbd.md" + - Server operations guide: + - "Introduction": "ops-intro.md" + - Installation: + - "Start": "ops-install.md" + - "Windows": "ops-install-windows.md" + - "Windows single user": "ops-install-windows-single.md" + - "Windows local network": "ops-install-windows-lan.md" + - "Windows IIS": "ops-install-windows-iis.md" + - "Linux": "ops-install-linux.md" + - "Linux desktop": "ops-install-linux-desktop.md" + - "Linux server": "ops-install-linux-server.md" + - Upgrade: + - "Start": "ops-upgrade.md" + - "Windows single user": "ops-upgrade-windows-single.md" + - "Windows local network": "ops-upgrade-windows-lan.md" + - "Windows IIS": "ops-upgrade-windows-iis.md" + - "Linux desktop": "ops-upgrade-linux-desktop.md" + - "Linux server": "ops-upgrade-linux-server.md" + - Migration: + - "Migrating from AyaNova 7": "ops-import-v7.md" + - Backup & Restore: + - "Backup": "ops-form-backup.md" + - "Restore": "ops-restore.md" + - Operations interface: + - "Server state": "ops-server-state.md" + - "Backup": "ops-form-backup.md" + - "Job queue": "ops-jobs.md" + - "Server log": "ops-log.md" + - "Server metrics": "ops-metrics.md" + - "Notification settings": "ops-notification-system.md" + - "Customer notification log": "ops-customer-notify-log.md" + - "User notification log": "ops-notify-log.md" + - "Backup": "ops-form-backup.md" + - Technical: + - "Maintenance": "ops-maintenance.md" + - "Logging": "ops-log.md" + - "View server settings": "ops-server-information.md" + - "Server locale settings": "ops-server-locale.md" + - "Translation / Language": "ops-config-default-translation.md" + - "Data path": "ops-config-data-path.md" + - "Attachments folder": "ops-config-folder-user-files.md" + - "Server temporary files folder": "ops-config-folder-temporary-files.md" + - "Database configuration": "ops-config-db.md" + - "PORT and URL configuration": "ops-config-use-urls.md" + - "Reporting render API URL override": "ops-config-report-rendering-api-url-override.md" + - "Reporting render browser path": "ops-config-report-render-browser-path.md" + - "Reporting timeout configuration": "ops-config-report-rendering-timeout.md" + - "Environment variable reference": "ops-config-environment-variables.md" + - "Security and JWT web tokens": "ops-config-jwt-secret.md" + - "SuperUser password reset": "ops-config-set-superuser-pw.md" + - "Server error codes": "ops-error-codes.md" + - "Migrating from AyaNova 7": "ops-import-v7.md" + - "Metrics": "ops-metrics.md" + - "Notification system": "ops-notification-system.md" + - "Backup utility PGDUMP path": "ops-config-backup-pgdump-path.md" + - "Backup folder": "ops-config-folder-backup-files.md" + - Subscription service guide: + - "Introduction": "sub-service-intro.md" + - Developer guide: + - "Introduction": "api-intro.md" + - "API developers console": "api-console.md" + - "API request format": "api-request-format.md" + - "API response format": "api-response-format.md" + - "API error codes": "api-error-codes.md" + - "API upload routes": "api-upload-routes.md" + - "API Integrated applications": "api-integrated-applications.md" + - "API Data types": "ay-start-data-types.md" + - Appendix: + - "Change log / release notes": "changelog.md" + - "Data types": "ay-start-data-types.md" + - "Open source credits": "appendix-os-credits.md" + - "Perpetual License agreement": "license.md" + - "Subscription service agreement": "ayanova-subscription-service-agreement.md" diff --git a/server/AyaNova/Controllers/JobOperationsController.cs b/server/AyaNova/Controllers/JobOperationsController.cs index 1ffc4926..efceb9aa 100644 --- a/server/AyaNova/Controllers/JobOperationsController.cs +++ b/server/AyaNova/Controllers/JobOperationsController.cs @@ -252,7 +252,66 @@ namespace AyaNova.Api.Controllers return Accepted(new { JobId = j.GId }); } + /// + /// Batch Send direct SMTP message notification to selected objects + /// Server notification settings must be set and active + /// User must have MODIFY role for the object type in question to be allowed to bulk message + /// this typically means full manager type roles only + /// Currently supported types are Customer, HeadOffice, Vendor, User + /// WARNING: be careful using this method; high volume emailing or spam-like behavior + /// could result in a ban or block of your mail account or mail server or domain + /// Use of this method is logged to AyaNova event log on successful attempted delivery + /// + /// + /// Job Id + [HttpPost("batch-direct-smtp")] + public async Task BatchDirectSMTPObjects([FromBody] BatchDirectSMTPParams batchDirectSMTPParams) + { + if (!serverState.IsOpen) + return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason)); + if (!ModelState.IsValid) + return BadRequest(new ApiErrorResponse(ModelState)); + if (!Util.ServerGlobalOpsSettingsCache.Notify.SmtpDeliveryActive) + return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_MISSING_PROPERTY, null, "Email notifications are set to OFF at server, unable to send 'on request' type SMTP notification")); + + if (batchDirectSMTPParams == null) + return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, null, "batchDirectSMTPParams is required")); + + if (batchDirectSMTPParams.SelectedRequest == null) + return BadRequest(new ApiErrorResponse(ApiErrorCode.VALIDATION_REQUIRED, null, "batchDirectSMTPParams.DataListSelectedRequest is required")); + + + if (!Authorized.HasModifyRole(HttpContext.Items, batchDirectSMTPParams.SelectedRequest.AType)) + return StatusCode(403, new ApiNotAuthorizedResponse()); + + //Rehydrate id list if necessary + if (batchDirectSMTPParams.SelectedRequest.SelectedRowIds.Length == 0) + batchDirectSMTPParams.SelectedRequest.SelectedRowIds = await DataListSelectedProcessingOptions.RehydrateIdList( + batchDirectSMTPParams.SelectedRequest, + ct, + UserRolesFromContext.Roles(HttpContext.Items), + log, + UserIdFromContext.Id(HttpContext.Items), + UserTranslationIdFromContext.Id(HttpContext.Items)); + + var JobName = $"LT:BatchDirectSMTP - LT:{batchDirectSMTPParams.SelectedRequest.AType} ({batchDirectSMTPParams.SelectedRequest.SelectedRowIds.LongLength}) LT:User {UserNameFromContext.Name(HttpContext.Items)}"; + JObject o = JObject.FromObject(new + { + idList = batchDirectSMTPParams.SelectedRequest.SelectedRowIds + }); + + OpsJob j = new OpsJob(); + j.Name = JobName; + j.AType = batchDirectSMTPParams.SelectedRequest.AType; + j.JobType = JobType.BatchCoreObjectOperation; + j.SubType = JobSubType.DirectSMTP; + j.Exclusive = false; + j.JobInfo = o.ToString(); + await JobsBiz.AddJobAsync(j); + await EventLogProcessor.LogEventToDatabaseAsync(new Event(UserIdFromContext.Id(HttpContext.Items), 0, AyaType.ServerJob, AyaEvent.Created, JobName), ct); + return Accepted(new { JobId = j.GId }); + } /// /// Request cancellation of Job. Not all jobs can be cancelled. diff --git a/server/AyaNova/biz/JobType.cs b/server/AyaNova/biz/JobType.cs index 7d286b07..76bfebf0 100644 --- a/server/AyaNova/biz/JobType.cs +++ b/server/AyaNova/biz/JobType.cs @@ -31,7 +31,8 @@ namespace AyaNova.Biz TagRemoveAny = 4, TagReplace = 5, TagReplaceAny = 6, - Delete = 7 + Delete = 7, + DirectSMTP = 8 } }//eons \ No newline at end of file diff --git a/server/AyaNova/models/dto/BatchDirectSMTPParams.cs b/server/AyaNova/models/dto/BatchDirectSMTPParams.cs new file mode 100644 index 00000000..c8264337 --- /dev/null +++ b/server/AyaNova/models/dto/BatchDirectSMTPParams.cs @@ -0,0 +1,17 @@ +using AyaNova.Biz; + +namespace AyaNova.Models +{ + /// + /// Parameters for bulk operation batch-direct-smtp + /// + public class BatchDirectSMTPParams + { + + public DataListSelectedRequest SelectedRequest { get; set; } + public string Subject { get; set; } + public string TextBody { get; set; } + public string HTMLBody { get; set; } + } + +} diff --git a/server/AyaNova/util/AySchema.cs b/server/AyaNova/util/AySchema.cs index abd0edd0..af210bed 100644 --- a/server/AyaNova/util/AySchema.cs +++ b/server/AyaNova/util/AySchema.cs @@ -20,7 +20,7 @@ namespace AyaNova.Util /////////// CHANGE THIS ON NEW SCHEMA UPDATE //////////////////// //!!!!WARNING: BE SURE TO UPDATE THE DbUtil::EmptyBizDataFromDatabaseForSeedingOrImportingAsync WHEN NEW TABLES ADDED!!!! - private const int DESIRED_SCHEMA_LEVEL = 18; + private const int DESIRED_SCHEMA_LEVEL = 19; internal const long EXPECTED_COLUMN_COUNT = 1389; internal const long EXPECTED_INDEX_COUNT = 160; @@ -1850,6 +1850,42 @@ CREATE OR REPLACE VIEW public.viewpartinventorylist } + ////////////////////////////////////////////////// + // + // case 4173 + // + if (currentSchema < 19) + { + LogUpdateMessage(log); + + //english translations + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'BatchDirectSMTP', 'Batch email job' FROM atranslation t where t.baselanguage = 'en'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SendEmail', 'Send email' FROM atranslation t where t.baselanguage = 'en'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'EmailMultipleObjectsWarning', 'Warning: you are about to send an email to multiple objects.\r\nAre you sure?' FROM atranslation t where t.baselanguage = 'en'"); + + + + //spanish translations + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'BatchDirectSMTP', 'Trabajo de correo electrónico por lotes' FROM atranslation t where t.baselanguage = 'es'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SendEmail', 'Enviar correo electrónico' FROM atranslation t where t.baselanguage = 'es'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'EmailMultipleObjectsWarning', 'Advertencia: está a punto de enviar un correo electrónico a varios objetos.\r\n¿Está seguro?' FROM atranslation t where t.baselanguage = 'es'"); + + //french translations + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'BatchDirectSMTP', 'Tâche d''e-mail par lots' FROM atranslation t where t.baselanguage = 'fr'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SendEmail', 'Envoyer un e-mail' FROM atranslation t where t.baselanguage = 'fr'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'EmailMultipleObjectsWarning', 'Avertissement : vous êtes sur le point d''envoyer un e-mail à plusieurs objets.\r\nÊtes-vous sûr?' FROM atranslation t where t.baselanguage = 'fr'"); + + //german translations + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'BatchDirectSMTP', 'Batch-E-Mail-Job' FROM atranslation t where t.baselanguage = 'de'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'SendEmail', 'E-Mail senden' FROM atranslation t where t.baselanguage = 'de'"); + await ExecQueryAsync("INSERT INTO atranslationitem(translationid,key,display) SELECT t.id, 'EmailMultipleObjectsWarning', 'Warnung: Sie sind im Begriff, eine E-Mail an mehrere Objekte zu senden.\r\nSind Sie sicher?' FROM atranslation t where t.baselanguage = 'de'"); + + await SetSchemaLevelAsync(++currentSchema); + + } + + + //#########################################