Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds back an email field to be used as the sender address #107

Merged
merged 2 commits into from
Dec 17, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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