Skip to content

Commit

Permalink
Merge pull request #9 from polarityio/develop
Browse files Browse the repository at this point in the history
Add cc option
  • Loading branch information
sarus authored Sep 23, 2024
2 parents e407784 + 14ad137 commit 06c2038
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 1 deletion.
10 changes: 10 additions & 0 deletions config/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,16 @@ module.exports = {
userCanEdit: false,
adminOnly: true
},
{
key: 'cc',
name: 'Default CC Email Address',
description:
'The default email address to CC form submissions to if a form configuration does not specify a CC. If left blank, no CC will be sent.',
default: '',
type: 'text',
userCanEdit: false,
adminOnly: true
},
{
key: 'forms',
name: 'Enabled Forms',
Expand Down
9 changes: 9 additions & 0 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,15 @@
"userCanEdit": false,
"adminOnly": true
},
{
"key": "cc",
"name": "Default CC Email Address",
"description": "The default email address to CC form submissions to if a form configuration does not specify a CC. If left blank, no CC will be sent.",
"default": "",
"type": "text",
"userCanEdit": false,
"adminOnly": true
},
{
"key": "forms",
"name": "Enabled Forms",
Expand Down
4 changes: 3 additions & 1 deletion integration.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,13 @@ function getRecipient(fileName, recipient, options) {
}
}

function getCc(fileName, cc) {
function getCc(fileName, cc, options) {
if (cc) {
return cc;
} else if (formsByFileName[fileName] && formsByFileName[fileName].cc) {
return formsByFileName[fileName].cc;
} else if (options.cc.trim().length > 0) {
return options.cc.trim();
} else {
return '';
}
Expand Down

0 comments on commit 06c2038

Please sign in to comment.