skip to Main Content

I have created a variable inside a controller whereby I want to put a href link inside the variable. everything works well but I want to add a download link for the to be able to view the link in the message sent to them.I have tried this but the URL isn’t being rendered in the message.I haven’t understood where am doing it wrong.

 $downloadurl="'downloadpaymentreceipt/$payment->id/$payment->date_paid'";

        // Set your message
$message = "hello there your payment has been received.Click <a href=$downloadurl>Here</a> to downoad your receipt.";

2

Answers


  1. use the back cotes (“)

    $message = "hello there your payment has been received.Click `<a href=$downloadurl>Here</a>` to downoad your receipt.";
    Login or Signup to reply.
  2. Try this

    $message = 'hello there your payment has been received.Click <a 
         href="' . $downloadurl . '">Here</a> to downoad your receipt.";
    

    Or like this

    $message = "<p>hello there your payment has been received.Click <a 
       href='{$downloadurl}'>Here</a> to downoad your receipt.</p>";
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search