const generateInputSelectContent = (contentType, contentAttributes) => { const { submitted_values: submittedValues = [] } = contentAttributes; const [selectedOption] = submittedValues; if (selectedOption && selectedOption.title) { return `${selectedOption.title}`; } return ''; }; const generateInputEmailContent = (contentType, contentAttributes) => { const { submitted_email: submittedEmail = '' } = contentAttributes; if (submittedEmail) { return `${submittedEmail}`; } return ''; }; const generateFormContent = ( contentType, contentAttributes, noResponseText ) => { const { items, submitted_values: submittedValues = [] } = contentAttributes; if (submittedValues.length) { const submittedObject = submittedValues.reduce((acc, keyValuePair) => { acc[keyValuePair.name] = keyValuePair.value; return acc; }, {}); let formMessageContent = ''; items.forEach(item => { formMessageContent += `