Email Submission Plugin - Carriage Return

Ericsson

New Member
Hi -

I am needing to output a textarea element (in a repeat) in a custom .php email template that will include the carriage returns as it is in the textarea. Currently, all of the text is on one single line.

Please see my code below.

Also - I found this link which is discussing this topic - but it was not clear to me what was done to accomplish this:
http://fabrikar.com/forums/index.ph...return-in-submission-plugin.11271/#post-61264

Thanks!

PHP:
<?php
//UPDATE SECTION
$repeats = $this->data['fabrik_repeat_group'][11] - 1;
for ($repeat = $repeats; $repeat >=0; $repeat--) {
 
?>
    <tr>
    <td class="left" style="border-bottom: 1px #69C;width: 195px;text-align: left;font-family: Verdana, sans-serif, Arial;font-weight: normal;font-size: 0.7em;color: #404040;background-color: #fafafa;padding-top: 4px;padding-bottom: 4px;padding-left: 8px;padding-right: 0"><b><?php
    echo $this->emailData['sdm_incident_notification_11_repeat___timestamp'][$repeat] . ":"; ?></b><br /><br /></td>
 
  <td class="contact" style="border-bottom: 1px #69C;width: 550px;text-align: left;font-family: Verdana, sans-serif, Arial;font-weight: normal;font-size: 0.7em;color: #404040;background-color: #fafafa;padding-top: 4px;padding-bottom: 4px;padding-left: 8px;padding-right: 0"><?php echo $this->emailData['sdm_incident_notification_11_repeat___update_raw'][$repeat]; ?><br /><br /></td>
</tr>
  <?php
}
//END OF UPDATE SECTION
 
The thread you are mentioning is very very old.
Is "update" your textarea?
You may try
echo $this->emailData['sdm_incident_notification_11_repeat___update'][$repeat];
 
Thanks troester..

I had tried removing "_raw" already - but for some reason - the output in the email only echos the very first letter from the text.

For example: text for the element (update) = "update 1"...the output in the email = "u"
 
Any other thoughts here on how to accomplish this? Also - can someone else please try the code above to see if you are getting only the first character of the output in the email as what I am getting? I am on the latest github update as of yesterday.
 
You are correct, without _raw there seems to be a bug, it's containing only the last textarea content (no array).
_raw seems to contain newlines,
with
nl2br($this->emailData['sdm_incident_notification_11_repeat___update_raw'][$repeat])
it should insert <br> and show your multiple lines.
 
Many thanks troester!

Your code has worked...once the bug fix get's committed - I will try the other way to see if that works, as well.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top