-2

i have this code:

if($this->helix3->getParam('contact_email')) $output .= '<li class="sp-contact-email"><i class="fa fa-envelope"></i> ' . $this->helix3->getParam('contact_email') . '</li>';

        $output .= '<ul>';

        return $output;

I would like that click in the frontpage will send an email to the result of the getParam('contact_email')

1 Answers1

0

If I understand you correctly you need to use an anchor tag with mailto: in the href:

if($this->helix3->getParam('contact_email')){
  $email=$this->helix3->getParam('contact_email');
  $output .= '<li class="sp-contact-email"><i class="fa fa-envelope"></i> <a href="mailto:'.$email.'">' . $email . '</a></li>';
}

        $output .= '<ul>';

        return $output;
Trey
  • 5,480
  • 4
  • 23
  • 30
  • yes...in the frontend of the website i can just see the mail xxx@123.com, but can't click on it to send an email – Matteo De Luca Feb 26 '15 at 17:06
  • This should work, I've already tested it.... `send mail` that is basically the result of the above – Trey Feb 26 '15 at 17:08
  • thx trey...i feel so stupid and tired. you gave me light if($this->helix3->getParam('enable_contactinfo')) { $output = '
      '; if($this->helix3->getParam('contact_email')) $output .= '
    • xxx@xxx.it
    • ' . $output .= '
        '; return $output;
    – Matteo De Luca Feb 26 '15 at 17:27