A Newsletter controller contains the following route:
Server.post('Subscribe', function (req,res,next){
var newsletterForm = server.forms.getForm('newsletter');var CustomObjectMgr = require('dw/object/CustomObjectMgr');
if(newsletterForm.valid){
try{
var CustomObject =
CustomObjectMgr.createCustomObejct('NewsletterSubscription', newsletterform.email.value);
CustomObject.custom.firstName = newsletterForm.fname.value;
CustomObject.custom.lastName = newsletterForm.lname.value;-
} catch(e){
//Catch error here
}
}
next();
});
Assuming the Custom Object metadata exists, why does this route fail to render the newsletter template
when the subscription form is correctly submitted?
Buddy
4 months agoDenny
4 months agoMalinda
4 months agoScarlet
4 months agoJennifer
4 months agoGail
5 months agoTwila
5 months agoBlythe
5 months agoSherell
5 months agoAntonio
5 months agoMirta
5 months ago