Questions and discussion about developing processes and programming in PHP, JavaScript, web services & REST API.

Moderator: amosbatto

Forum rules: Please search to see if a question has already asked before creating a new topic. Please don't post the same question in multiple forums.
#815562
Hi,

I create a template like this:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
</head>
<body>
<p dir="rtl">This is your data: </p>
<p dir="rtl"> @@your_number</p>
</body>
</html>
Then I want to send this data with PMFSendMessage function:
Code: Select all
<p dir="rtl" style="text-align: right;">test1</p> <p dir="rtl" style="text-align: right;">test2</p>
But this data not show correctly in email content.
How can I use html data with this function correctly?

Thanks
#815577
Programerboy, Let's say that you have this template file:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
</head>
<body>
<p dir="rtl">This is your data: </p>
@#data
</body>
Use @#data to insert the variable without quotation marks around it.

Then you can use this trigger code to send it as an email:
Code: Select all
$aVars = array(
    'data' => '<p dir="rtl" style="text-align: right;">test1</p> <p dir="rtl" style="text-align: right;">test2</p>'
);
//make sure that sending from the email account configured under Admin > Email Settings or many 
//email servers will consider it spam:
PMFSendMessage(@@APPLICATION, '[email protected]', '[email protected]', '', '', 
     'My test message', 'mytemplate.html', $aVars);
By the way, if @@data is already saved as a case variable in a previous trigger or Dynaform, then it isn't necessary to pass it in the variables parameter to PMFSendMessage().
#815587
Hi,
Thanks for your answer,

I do it but the program convert it to it when send email:
Code: Select all
<p align="right" dir="rtl">"<p dir=\"rtl\" style=\"text-align: right;\">test1</p>\r\n<p dir=\"rtl\" style=\"text-align: right;\">test2</p>"</p>
Therefore it not show correctly in mail content.
Thanks
#815591
@#data shouldn't escape quotation marks. What happens if you use @=data in the template?

Buen día, a todos Hace un par de día[…]

Perfecto amigo muchas gracias.

hello to all, please your help to resolve this dou[…]

The reason most likely is that the setOnchange eve[…]