diff --git a/custom-recipes/send-mails-from-contacts-dataset/recipe.json b/custom-recipes/send-mails-from-contacts-dataset/recipe.json index 91534aa..c4ff6ce 100644 --- a/custom-recipes/send-mails-from-contacts-dataset/recipe.json +++ b/custom-recipes/send-mails-from-contacts-dataset/recipe.json @@ -205,11 +205,12 @@ }, { - "name": "encryption_password_excel", - "label" : "Encryption password", - "type": "PASSWORD", - "description" : "(Optional) Password to encrypt excel files, requires DSS 13.0 or above", - "visibilityCondition" : "model.attachment_type == 'excel_can_ac'" + "name": "encryption_password_excel_params", + "label": "Encryption password", + "type": "PRESET", + "parameterSetId": "file-encryption", + "description" : "(Optional) Password to encrypt excel files, requires DSS 13.2 or above.", + "visibilityCondition" : "model.attachment_type == 'excel_can_ac'" }, { diff --git a/custom-recipes/send-mails-from-contacts-dataset/recipe.py b/custom-recipes/send-mails-from-contacts-dataset/recipe.py index eaceb9d..34b188e 100644 --- a/custom-recipes/send-mails-from-contacts-dataset/recipe.py +++ b/custom-recipes/send-mails-from-contacts-dataset/recipe.py @@ -73,7 +73,10 @@ def does_channel_have_sender(channel_id): channel_has_sender = does_channel_have_sender(mail_channel) attachment_type = config.get('attachment_type', "send_no_attachments") -encryption_password_excel = config.get('encryption_password_excel', None) +encryption_password_excel_params = config.get('encryption_password_excel_params', None) +encryption_password_excel = None +if encryption_password_excel_params: + encryption_password_excel = encryption_password_excel_params.get("password", None) # Validation part 1 - Check some kind of value/column exists for body, subject, sender and recipient diff --git a/parameter-sets/file-encryption/parameter-set.json b/parameter-sets/file-encryption/parameter-set.json new file mode 100644 index 0000000..a351568 --- /dev/null +++ b/parameter-sets/file-encryption/parameter-set.json @@ -0,0 +1,17 @@ +{ + "meta" : { + "label": "Encryption password", + "description": "Encryption password for attachment files", + "icon": "icon-pi-system icon-cogs" + }, + "defaultDefinableInline": false, + "defaultDefinableAtProjectLevel": false, + "params": [ + { + "name": "password", + "label": "File encryption password", + "type": "PASSWORD", + "description": "Password to encrypt attachment files. CAUTION: the password entered here is only stored encrypted when defined in a preset." + } + ] +}