I have done some searching but still am having an issue getting this to function.
When I run this code, the mail company API errors out with no message body. Which is the $contact_form_template variable in the sendMailAPI function.
If I place a line of code right after cms:php like:
$contact_email_template = 'This is the email body';
To give couch the variable it needs, it works. At the top of the page, I have an include for the global file (contents functions, other settings used throughout site outside of couch, including the contact template) then an include for couch cms.
<cms:pages masterpage= recipients.php'>
<cms:show_repeatable 'contact-form'>
<cms:php>
sendMailAPI('<cms:show email />', 'contact@domain.com', 'From Name', 'Contact Form Subject', $contact_email_template);
</cms:php>
</cms:show_repeatable>
</cms:pages>
When I run this code, the mail company API errors out with no message body. Which is the $contact_form_template variable in the sendMailAPI function.
If I place a line of code right after cms:php like:
$contact_email_template = 'This is the email body';
To give couch the variable it needs, it works. At the top of the page, I have an include for the global file (contents functions, other settings used throughout site outside of couch, including the contact template) then an include for couch cms.
<cms:pages masterpage= recipients.php'>
<cms:show_repeatable 'contact-form'>
<cms:php>
sendMailAPI('<cms:show email />', 'contact@domain.com', 'From Name', 'Contact Form Subject', $contact_email_template);
</cms:php>
</cms:show_repeatable>
</cms:pages>