How to make a clickable link

Hello, can any body tell me how i can make a this code in to a clickable link:

    $message .= $this->url->link('account/login', '', 'SSL') . "\n\n";

Thank you.

It’s kind of hard to know how to answer this question when it is not in any context. Where is the rest of your code? Where is $this->url->link() defined? And could you show us the html code where you want $message to be displayed?

1 Like

Hello, at the moment thats hard to explain. But it is the account/login that is the page i want to go to.
Basicly i just need to know how to put <a href… around this code.

Where do you echo $message in your html code? In other words, where are you putting this link? Could you show us that code? Can you post here the code that defines $this->url->link() so that we know what that outputs? Right now we don’t have enough information to be able to help you.

<?php echo $message; ?>

in an email template file. These codeas are used by Opencart. also included in $message is:
        $message .= $this->language->get('text_services') . "\n\n";
        $message .= $this->language->get('text_login_info') . "\n\n";
        $message .= $this->language->get('text_user_name') . ' ' . $data['email'] . "\n";
        $message .= $this->language->get('text_password') . ' ' . $data['password'] . "\n\n";
        $message .= $this->language->get('text_warning_text'). "\n\n\n";
        $message .= $this->language->get('text_thanks') . "\n";
        $message .= $this->config->get('config_name'); 

$this->url->link('account/login', '', 'SSL')

What string does this return? From the name of it, I’d presume it returns a link, but then you wouldn’t be asking if it did. Without knowing what text is returned from that, it’s hard to know how much of the rest of the link is required.

There’s another quite long thread from a few days ago about embedding hyperlinks into emails that might be worth a look as well, if it still doesn’t work as you need it to.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.