close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Formatting options for Universal Email

Thread began 7/22/2013 2:00 pm by sandy170299 | Last modified 7/25/2013 2:29 pm by sandy170299 | 884 views | 16 replies |

sandy170299

Formatting options for Universal Email

Universal Email puts everything in this format:

<table cellpadding="0" cellspacing="0" border="0">
<?php
foreach( $_POST as $pkey => $pval ){
if (!RemoveValue($pkey,$remove,$removeBegins,$removeEnds,$removeIncludes)) {
if (get_magic_quotes_gpc()) $pval = stripslashes((is_array($pval)?implode(", ",$pval):$pval));
?>
<tr valign="top">
<th style="font-size: 12px; width: 134px; text-align: right; padding: 3px 10px 3px 3px; font-weight: bold;"><?php echo(str_replace("_"," ",$pkey)); ?>:</th>
<td style="font-size: 12px; padding: 3px;"><?php echo(str_replace("\n","<BR />",(is_array($pval)?implode(", ",$pval):$pval))); ?></td>
</tr>
<?php
}
}
?>
</table>

is there a way of having it be columns instead, with column headers, and the data displayed below? The data is coming from a form that is using the insert multiple records server behavior, and there are 25 possible combinations on the form. Thanks!

Sign in to reply to this post

Jason ByrnesWebAssist

add the loop twice:

php:
<table cellpadding="0" cellspacing="0" border="0">

<?php
foreach( $_POST as $pkey => $pval ){
if (!
RemoveValue($pkey,$remove,$removeBegins,$removeEnds,$removeIncludes)) {
if (
get_magic_quotes_gpc()) $pval stripslashes((is_array($pval)?implode(", ",$pval):$pval));
?>
<tr valign="top">
<th style="font-size: 12px; width: 134px; text-align: right; padding: 3px 10px 3px 3px; font-weight: bold;"><?php echo(str_replace("_"," ",$pkey)); ?>:</th>
</tr>
<?php
}
}
?>
<?php
foreach( $_POST as $pkey => $pval ){
if (!
RemoveValue($pkey,$remove,$removeBegins,$removeEnds,$removeIncludes)) {
if (
get_magic_quotes_gpc()) $pval stripslashes((is_array($pval)?implode(", ",$pval):$pval));
?>
<tr valign="top">
<td style="font-size: 12px; padding: 3px;"><?php echo(str_replace("\n","<BR />",(is_array($pval)?implode(", ",$pval):$pval))); ?></td>
</tr>
<?php
}
}
?>
</table>
Sign in to reply to this post

sandy170299

Sorry - this didn't work. It still put all of the column identifiers/names in a left column, vertically, and all of the content below the 25 options, also in a vertical format.

Sign in to reply to this post

Jason ByrnesWebAssist

You may need to adjust the width of the table cells and the table itself to fit the other elements on the page.

Sign in to reply to this post

sandy170299

I have played around with the table width and cell width, but this is what I'm getting:

See private message.

Sign in to reply to this post

Jason ByrnesWebAssist

Originally Said By: sandy170299
  I have played around with the table width and cell width, but this is what I'm getting:

See private message.  
Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the timesheetTable.php file and the webassist/email folder

Sign in to reply to this post

sandy170299

see attached.

Sign in to reply to this post

sandy170299

One more thing ... the date field is not inserting into the database correctly. The field week_ending is a date field in the database, and in the insert multiple records script, it's bound to the <?php echo ((isset($_POST["pick-date"]))?$_POST["pick-date"]:""); ?> date picker field, and it is getting submitted as a date. In the database, it's being entered as 0000-00-00.

Sign in to reply to this post

Jason ByrnesWebAssist

the file that generates the email is the webassist/email/templates/Blank_6.php file.

in that file, you still have the original code for formating the email body:

php:
<table width="600" border="0" cellpadding="0" cellspacing="0">

<?php
foreach( $_POST as $pkey => $pval ){
  if (!
RemoveValue($pkey,$remove,$removeBegins,$removeEnds,$removeIncludes))  {
      if (
get_magic_quotes_gpc()) $pval stripslashes((is_array($pval)?implode(", ",$pval):$pval));
?>
                    <tr valign="top">
                        <th style="font-size: 12px; width: 200px; text-align: right; padding: 3px 10px 3px 3px; font-weight: bold;"><?php echo(str_replace("_"," ",$pkey)); ?>:</th>
                        <td style="font-size: 12px; padding: 3px;"><?php echo(str_replace("\n","<BR />",(is_array($pval)?implode(", ",$pval):$pval))); ?></td>
                    </tr>
<?php
  
}
}
?>
                </table>




the change that i suggested:

php:
<table width="600" border="0" cellpadding="0" cellspacing="0">

                    <tr valign="top">
<?php
foreach( $_POST as $pkey => $pval ){
  if (!
RemoveValue($pkey,$remove,$removeBegins,$removeEnds,$removeIncludes))  {
      if (
get_magic_quotes_gpc()) $pval stripslashes((is_array($pval)?implode(", ",$pval):$pval));
?>
                        <th style="font-size: 12px; width: 200px; text-align: right; padding: 3px 10px 3px 3px; font-weight: bold;"><?php echo(str_replace("_"," ",$pkey)); ?>:</th>
<?php
  
}
}
?>
</tr>
<tr>
<?php
foreach( $_POST as $pkey => $pval ){
  if (!
RemoveValue($pkey,$remove,$removeBegins,$removeEnds,$removeIncludes))  {
      if (
get_magic_quotes_gpc()) $pval stripslashes((is_array($pval)?implode(", ",$pval):$pval));
?>
                        <td style="font-size: 12px; padding: 3px;"><?php echo(str_replace("\n","<BR />",(is_array($pval)?implode(", ",$pval):$pval))); ?></td>
<?php
  
}
}
?>
                    </tr>
                </table>



has not been made to that file.

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...