Skip to content

Commit

Permalink
Merge pull request #107 from apostrophecms/hotfix/no-email
Browse files Browse the repository at this point in the history
Adds back an email field to be used as the sender address
  • Loading branch information
Alex Bea committed Dec 17, 2019
2 parents 0249ee4 + 5154916 commit c90d177
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ module.exports = {
name: 'apostrophe-forms',
label: 'Form',
extend: 'apostrophe-pieces',
seo: false,
openGraph: false,
moogBundle: {
directory: 'lib/modules',
modules: [
Expand Down Expand Up @@ -155,7 +157,7 @@ module.exports = {
{
name: 'conditions',
label: 'Set Conditions for this Notification',
help: 'e.g., only notify this email address if the "country" field is set to "Austria. All conditions must be met. Add the email again with another conditional set if needed."',
help: 'For example, if you only notify this email address if the "country" field is set to "Austria". All conditions must be met. Add the email again with another conditional set if needed."',
type: 'array',
titleField: 'value',
schema: [
Expand All @@ -175,6 +177,13 @@ module.exports = {
]
}
]
},
{
name: 'email',
label: 'Primary internal email address',
type: 'string',
required: true,
help: 'You may enter one from the previous list. This is the address that will be used as the "from" address on any generated email messages.'
}
] : []).concat(options.addFields || []);

Expand All @@ -183,7 +192,10 @@ module.exports = {
'thankYouBody',
'sendConfirmationEmail',
'emailConfirmationField'
].concat(options.emailSubmissions !== false ? ['emails'] : []);
].concat(options.emailSubmissions !== false ? [
'emails',
'email'
] : []);

options.arrangeFields = (options.arrangeFields || []).concat([
{
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apostrophe-forms",
"version": "1.4.0",
"version": "1.4.1",
"description": "Build forms for ApostropheCMS in a simple user interface.",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ describe('Forms module', function () {
it('should have a default collection for submissions', function (done) {
apos.db.collection('aposFormSubmissions', function (err, collection) {
assert(!err);
assert(collection.namespace === 'test.aposFormSubmissions');
assert(collection);
done();
});
});
Expand Down

0 comments on commit c90d177

Please sign in to comment.