Forums

Sending XML in email

PageMasterRWS 12 Jan, 2009
Hello,
I have an issue that I am hoping to get resolved. I have so far not found a way to handle this.

I have created a form...a template which contains XML. The template will be populated with the form information.

Form:
first name
last name
day phone
evening phone
email
comments

Email Template:

<?ADF VERSION "1.0"?>
<?XML VERSION β€œ1.0”?>
<adf>
<prospect>
<requestdate>2000-03-30T15:30:20-08:00</requestdate>
<vehicle>
<year>1999</year>
<make>Chevrolet</make>
<model>Blazer</model>
</vehicle>
<customer>
<contact>
<name part="full">{firstname} {lastname}</name>
<phone>{dayphone}</phone>
</contact>
</customer>
<vendor>
<contact>
<name part="full">Acura of Bellevue</name>
</contact>
</vendor>
</prospect>
</adf>


I did this much and haven't completed the form or the XML file but so far I couldn't get this much to work. I get an email that has the following error:
Parse error: syntax error, unexpected T_STRING in /home/shopn8/public_html/dev2/components/com_chronocontact/chronocontact.php(327) : eval()'d code on line 1

Any idea what I may be doing wrong? Can I not send XML files via this engine?

Thanks in advance for the help! πŸ™‚
GreyHead 12 Jan, 2009
Hi PageMasterRWS,

I've no idea what the answer is . . . but the problem is that the <? . . .?> tags are being interpreted as <?php ?> tags by the php interpreter when it processes the template. I suspect that you need to wrap the xml in some way to hide it from the php interpreter. Maybe the HEREDOC syntax will do the trick???
<?php
echo <<<END
<?ADF VERSION "1.0"?>
<?XML VERSION β€œ1.0”?>
  . . .
</adf>
END;
?>

Bob
PageMasterRWS 12 Jan, 2009
I tried it but now it won't even send the email. LOL!!!
Well...I'll play with it some more. If you think of something let me know.

Thanks for trying!πŸ™‚
Max_admin 13 Jan, 2009
Hi, try:

<?php
echo '<?ADF VERSION "1.0"?>
<?XML VERSION β€œ1.0”?>
<adf>
<prospect>
<requestdate>2000-03-30T15:30:20-08:00</requestdate>
<vehicle>
<year>1999</year>
<make>Chevrolet</make>
<model>Blazer</model>
</vehicle>
<customer>
<contact>
<name part="full">{firstname} {lastname}</name>
<phone>{dayphone}</phone>
</contact>
</customer>
<vendor>
<contact>
<name part="full">Acura of Bellevue</name>
</contact>
</vendor>
</prospect>
</adf>';
?>


Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
seb123 03 Mar, 2009
Try this:

Set "Use template editor" OFF
Go to the Emails Template.
Instead using <prospect>
use <prospect><br/>

It works for meπŸ˜€

Seb.
This topic is locked and no more replies can be posted.