Skip to:

messages_new_messages not working with HTML content

  • rgipp1


    I’m trying to send a message to a user with HTML button that has a link.

    I’m making content (message body) from reading a file with html code that is working standalone as far as displaying my button.

    My php code and the content from the file are shown below.

    It seems to get hung up on everything in the style section not recognizing it.

    $Recipient = $the_user->ID;
    $Sender = 1;
    $subject = ‘Welcome to’;
    //Content is in file messageBodyForClientLogin.txt
    $multilinecomments = fread($file,filesize($filename));
    $content = $multilinecomments;
    $args = array(‘sender_id’ => $Sender, ‘subject’ => $subject, ‘content’ => $content , ‘recipients’ => $Recipient );
    messages_new_message( $args ) ;

    file messageBodyForClientLogin.txt
    .button {
    background-color: #4CAF50; /* Green */
    border: none;
    color: white;
    padding: 15px 32px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    margin: 4px 2px;
    cursor: pointer;
    .button1 {border-radius: 2px;}
    .button2 {border-radius: 4px;}
    .button3 {border-radius: 8px;}
    .button4 {border-radius: 12px;}
    .button5 {border-radius: 50%;}
    <p>Welcome to your virtual personal trainer website!!! <br>
    Youve taken the first step in joining a virtual personal training site as a trainee. </p>
    Request Training Advice</button>

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar