Email code not working.
I am using DM CS6 on Mac and Data Bridge 1.0.9
I am updating an existing website created with previous Webassist extensions.
I have used Universal email in the past on previous versions
Am having a major problem with a simple email setup to email an order to the client.
I have set up a template in the cart folder to use for the Create Email extension.
On checkout, I have a new page (checkout - pay by bank deposit) selected from the "Confirm" page to enable the customer to simply send the order through by email. (Payment will be by bank transfer separately.)
The "Confirm" page has already written the order to the database, so the following page (checkout - pay by bank deposit) sources the order information from the database.
(unusual I know, but client likes this step as the customer information is stored prior to payment)
I have set up Create Email (Universal Email) on this page checkout - "pay by bank deposit" - page link is "checkoutBtf.php".
The page works fine on load, all data is there, but as above, sourced from the database rather than the previous pages "eCart" sessions.
When adding "Create Email (Universal Email)" behaviour to this page, as a template I used the page "BtfPrint_UE_Template.php" that I created for this purpose.
This page tests OK when tested separately on the server.
The email behaviour writes a new folder "webassist" to the site with the webassist email PHP pages and a copy of the email template (cart_2.php) which must be the one used derive the email content.
After upload to the server, the attempt to send the order by email results in a blank page and the following error in the log file in "webassist/email/templates".
[25-Oct-2012 15:28:40] PHP Warning: require_once(../Connections/CatalogConn.php) [<a href='plugins/function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in /home/eggdec/public_html/webassist/email/templates/cart_2.php on line 1
[25-Oct-2012 15:28:40] PHP Fatal error: require_once() [<a href='plugins/function.require'>function.require</a>]: Failed opening required '../Connections/CatalogConn.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/eggdec/public_html/webassist/email/templates/cart_2.php on line 1
The cart_2.php page incorrectly references the database connection file, the create email behaviour did not extend the link, so had to add ../../ to the existing <?php require_once('../Connections/CatalogConn.php'); ?>
After adding this correction, I tested the webassist/email/templates/cart_2.php page by linking directly from the browser, and the page works fine, displays the order and the customer details.
However, when trying again to send the order, a blank page results and the above error has disappeared, but a new error appears in the log:
[25-Oct-2012 15:50:28] PHP Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /home/eggdec/public_html/webassist/email/templates/cart_2.php on line 41
[25-Oct-2012 15:50:29] PHP Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /home/eggdec/public_html/webassist/email/templates/cart_2.php on line 43
To Sum up, the Webassist Email code does not appear to read the recordset correctly for some reason.
Perhaps there is another link error I am missing.
I have attached the relevant pages.
So far a 30 minute job as become a six hour trial and I am at a loss.
I hope I have explained my problem clearly enough.
Incidentally, I see one of the webassist email scripts references the file database_management/wa_appbuider_php.php
This folder and file is not present in the webassist folder.