Post by JDECLEMENTI » Wed Jul 12, 2017 1:44 am

So I have created a custom form page that accepts applications from potential employees.

It worked fine before I added an ssl certificate but now is not sending any of the data along with the email.

It will send the Template email but not the data but I know that the data is making it to the controller.php as the sender in the Email is correct.

I bring the info into the controller as follows.

Code: Select all

    if (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate()) {
    if (isset($this->error['fullname'])) {
    $data['error_fullname'] = $this->error['fullname'];
    } else {
    $data['error_fullname'] = '';
    }
Then send the data to my employment template where I believe the issue is

Code: Select all

    $html = $this->load->view('default/template/mail/employment.tpl',$data);
    // This right here no Longer works after adding SSL 
Then send the mail after attaching the HTML

Code: Select all

   $mail->setSender(html_entity_decode($this->request->post['fullname'], ENT_QUOTES, 'UTF-8')); 
    $mail->setHtml($html);
    $mail->send();
This is located out side of the POST if statement to makesure the action on the form is using SQL

Code: Select all

   $data['action'] = $this->url->link('information/Employment', '', 'SSL');
Then in employment.tpl my email Template I will reference fullname

Code: Select all

 <?php echo $fullname ?>
I always receive the email but it is only the template never any of the data. I have tried using the full link with https:// on the `$this->load->view` but that does not work either.

Any help at all is greatly appreciated and will be glad to provide any additional information if needed.

Newbie

Posts

Joined
Fri Jan 20, 2017 11:51 pm

Post by JDECLEMENTI » Thu Jul 13, 2017 3:47 am

Update:
I have also tried to use this and other solutions I feel like I'm missing something in the php where it's refusing to send the data with SSL

Code: Select all

$template = $this->url->link('default/template/mail/employment.tpl', '', 'SSL');
$html = $this->load->view($template,$data);
Still no luck

Newbie

Posts

Joined
Fri Jan 20, 2017 11:51 pm

Post by JDECLEMENTI » Thu Jul 20, 2017 2:55 am

I have tried everything I can think of there has to be a way of doing this... Please someone help!

Newbie

Posts

Joined
Fri Jan 20, 2017 11:51 pm

Post by artcore » Thu Jul 20, 2017 4:46 am

It looks like you are using 2.0.x? the template is just the route without .tpl in 2.2+ I believe.
And I see you're referencing a validate method while having validation in the POST condition, also on Linux routes are case sensitive.
Did you debug the incoming data from the POST array?
You're probably not using ajax but this can be troublesome too if anything doesn't match or there's a missing asset even(404)

Attn: I no longer provide OpenCart extensions, nor future support - this includes forum posts.
Reason: OpenCart version 3+ ;D

Thanks!


User avatar
Active Member

Posts

Joined
Tue Jul 09, 2013 4:13 am
Location - The Netherlands
Who is online

Users browsing this forum: No registered users and 426 guests