Jump to content

Recommended Posts

I'm trying to make my HTML email a bit smarter and not include the ship to info if it is not filled out.  How do I make the code within the $message variable interpret the code:

 

Here's what I've coded:

 

if (empty($del_addr1)) {
    echo '<br>';
}else {
echo '
Ship To:<br>
$del_name<br>
$del_addr1<br>
$del_addr2<br>
$del_state<br>
$del_zip<br>
$del_country'<br><br>
}

 

Here's what displayed (the good news is that I fixed the error), obviously the variables are interpreted:

 

if (empty()) { echo '

'; }else { echo ' Ship To:

 

 

 

 

 

'

 

}

 

tried a couple of other things, but the results are worse.  Any suggestions...

well, actually you dont even need that, u could just do this...

 

<?php

$message = "This is my message to you";

if(!empty($ADDRESS_VAR)){

$message .= "Ship to: etc";

}

$message .= "Your friend Ben";

?>

 

 

Please excuse my absent-mindedness. I have been up too long, as usual.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.