Apologies for any confusion as I'm completely out of my depth here:
I've been trying to write a plugin which will send form data as XML to a CRM using SOAP. The basic plugin works fine, but I would like to make it more modular, allowing different users to add their own credentials to the sent data.
I've followed all the instructions to create an Admin settings page, the data is written into the WP database, now I would like to pass those variables into my message.
I've tried using:
$options = get_option($this->option_name);
at the top of the page, then inside the message, inserting this:
$xmlInputData='<?xml version="1.0" encoding="utf-8" ?><data><settings><origin="'.echo $my_options['origin'];.'" username="'.echo $my_options['user'];.'" password="'.echo $my_options['password'];.'" /></settings><enquiries><lead productName="Appointment Booking"><customer><name>'.$_REQUEST['first-name'].' '.$_REQUEST['last-name'].'</name><email>'.$_REQUEST['email'].'</email><postcode>'.$_REQUEST['postal'].'</postcode><houseNumber></houseNumber><address></address><city></city><region></region><tel>'.$_REQUEST['phone-number'].'</tel><mobile></mobile><notes></notes></customer></lead></enquiries></data>';
but the code is flagged as having syntax errors. I'm trying to escape the XML to insert the PHP but I don't have enough experience of this.
Can anyone help me to understand where I'm going wrong?
I've been tinkering with this for a while now but desperately need this to work soon.
Thanks in advance.