Closed donrestarone closed 2 years ago
See the seeds file on how to programmatically send emails and things like that from the External API Connection.
See here for an example of a test for a Violet Rails plugin
library of plugins: https://github.com/restarone/violet_rails/blob/master/test/fixtures/external_api_clients.yml
This plugin will ingest user provides emails to send them the information they submitted information to the system.
Namespace
config:
name
: compliance/customer/requestproperties:
name
: Sally Anneslug
: compliance__customer_requestemail
: email_addresscompliance_message_sent
: booleanexclude_api_namespaces
: array ofslug
's of namespaces to exclude from lookupscan_all_namespaces
: boolean -- not required ifexclude_api_namespaces
is provided, but ifexclude_api_namespaces
is not provided the plugin will not work unless you acknowledge that lookup is allowed on all API namespaces by settingscan_all_namespaces
: true message: 'This is your data request, please see it below'Algorithm
When the plugin runs on a 1 minute cron schedule:
api_resources
compliance_message_sent
: falseapi_resource
look up all the namespaces allowed for look up based onexclude_api_namespaces
/scan_all_namespaces
-- list the api_resources that have the same propertyemail
and put them into its own CSV (by namespace)Parameters
Email message should be sent via the email system by creating a thread named: "#{email} compliance: customer submitted data request" and inserting the message there.
The email message should contain the message defined in the message parameter along with a CSV for each of the API Namespaces that they have submitted data to (each API Namespace CSV will contain the resources that the user has submitted).