Hi Ray
Looking at this again, I can see that because Universal Email has updated the way it works too, this is now set up differently. Previously I included the above line in the email script but now the body of the email is contained in a separate file, so the script looks like this:
$Email->BodyFile = "webassist/email/email-confirmation.php";
However if I try to include a PowerCMS area in the email-confirmation.php file it throws up errors. I tried including the full line from the developer notes:
<?php echo(require_once("/var/www/vhosts/mydomain.co.uk/httpdocs/WA_CMS/WA_CMS.php")); ?>
<?php echo(WA_getCMSContent($database_PowerCMSConnection, $PowerCMSConnection, 'Shared Email Text', 'Text', false)); ?>
Also tried including the full path to the db connection file: <?php require_once('/var/www/vhosts/mydomain.co.uk/httpdocs/Connections/PowerCMSConnection_i.php'); ?>
Example of errors below:
Deprecated: filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated in /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/email/phpmailer/src/PHPMailer.php on line 3632
Deprecated: filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated in /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/email/phpmailer/src/PHPMailer.php on line 3632
Deprecated: filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated in /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/email/phpmailer/src/PHPMailer.php on line 3632
Deprecated: filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated in /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/email/phpmailer/src/PHPMailer.php on line 3632
Deprecated: filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated in /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/email/phpmailer/src/PHPMailer.php on line 3632
Deprecated: filter_var(): explicit use of FILTER_FLAG_SCHEME_REQUIRED and FILTER_FLAG_HOST_REQUIRED is deprecated in /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/email/phpmailer/src/PHPMailer.php on line 3632
Notice: Undefined variable: PowerCMSConnection in /var/www/vhosts/mydomain.co.uk/httpdocs/WA_Globals/WA_Globals.php on line 42
Fatal error: Uncaught Error: Call to a member function query() on null in /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/mysqli/rsobj.php:213 Stack trace: #0 /var/www/vhosts/mydomain.co.uk/httpdocs/WA_Globals/WA_Globals.php(44): WA_MySQLi_RS->execute() #1 /var/www/vhosts/mydomain.co.uk/httpdocs/WA_CMS/WA_CMS.php(5): require_once('/var/www/vhosts...') #2 /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/email/email-confirmation.php(7): require_once('/var/www/vhosts...') #3 /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/email/WA_Email.php(315): require('/var/www/vhosts...') #4 /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/email/WA_Email.php(476): WA_Email->getFromPage('webassist/email...') #5 /var/www/vhosts/mydomain.co.uk/httpdocs/shared/email-script.php(97): WA_Email->send(0) #6 /var/www/vhosts/mydomain.co.uk/httpdocs/counselling.php(11): include('/var/www/vhosts...') #7 {main} thrown in /var/www/vhosts/mydomain.co.uk/httpdocs/webassist/mysqli/rsobj.php on line 213
I've attached the current email script and also the email content file. I've had to put everything back the way it was on the site because it's a live site, but let me know if you still need access, or I'm hoping there might be something obvious in the above or the attached files that I've missed!