Send email as text but the HTML tags shows .

anissa mekki January 14, 2018

Hello,

I have a problem  when I use email template jjupin 3.1.5 ,the tags html are display in email,more details in screenshot.any help please

 email.PNG

4 answers

0 votes
Jonathan Muse {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2018

In the template use a custom replacement variable like $cDate$.

Then, before calling the sendEmail() function create your formatted custom date variable for cDate. See example below where I am formatting the created date into the cDate variable.

string format = "d/MMM/yyyy";
string cDate = formatDate(created, format);

sendEmail(from, to, cc, "Your issue:" + key, "testTemplate.tpl", "", key);
anissa mekki January 17, 2018

Thank you very much@Jonathan Muse {Appfire}

have a nice day :)

0 votes
Jonathan Muse {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2018

Can I see the code you are using for your template?

anissa mekki January 16, 2018

yes of course.

<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<p>hello</p>
</body>
</html>

anissa mekki January 16, 2018

In another instance with same version 3.1.5 of JJUPIN and Jira Core 7.0.10. it works but in my instance don't work.

 

thank you in advance

Jonathan Muse {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2018

I installed JIRA 7.0.10 and installed PS version 3.1.5 and I was able to receive emails without seeing the HTML. The fact that your template works on another version means there probably isn't an issue with the template. We have checked the only place I know of (user profile) that controls HTML/Text emails. You have tried using the sendHtmlEmail() function... I don't know what else to try.

Do you see anything in the logs that indicates there was a problem with sending the email?

Can you try removing the DOCTYPE tag and the <meta> tag completely?

Thanks

anissa mekki January 17, 2018

Thank you very much @Jonathan Muse {Appfire},it works,I try just with <html>,<body> tags and with sendHtmlEmail().
I have another question please,I want to remove hour from template email
what I have 2018-01-29 00:00:00,what I want 2018-01-29

0 votes
anissa mekki January 15, 2018


our comapny force us to use 3.1.5
I try with simple tags like <! DOCTYPE ...><html> it's same problem
in screenshot all my configurations.

email3.PNGemail4.PNG

0 votes
Jonathan Muse {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2018

Hi @anissa mekki, you are using version 3.1.5? How are you calling the email in your script?

Thanks, Jon

anissa mekki January 15, 2018

Hi Jon,

Yes I use version 3.1.5, in the post function like this

string to =userEmailAddress(customfield_11262);

string subject="Le véhicule de "+customfield_11201+" "+customfield_11200+" sera livré";

sendEmail(to,subject, "template.tpl");

 

this template.tpl file is in  C:\Atlassian-Jira\Application Data\JIRA\kepler\emails\template.tpl

and in sil configuration in Email Templates Directory I put emails.

thank you in advance.

Jonathan Muse {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2018

In 3.1.5 there were two functions to sendEmail() and sendHtmlEmail(). There is only one function since 4.0. Try the sendHtmlEmail() function. Also, in your user profile you can specify if you want to receive html or text emails. Make sure you have selected html.

Let me know if those help.

Thanks, Jon

anissa mekki January 15, 2018

I used send Html Email() function and in user profile I choosed html but the same problem.

email2.PNG

Jonathan Muse {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2018

Ok, I am going to see if I can get you some help from the developers. Any reason you are still on 3.1.5?

Jonathan Muse {Appfire}
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2018

The developers are suggesting that you try replacing <html xmlns...> with just <html>. And, replace <!DOCTYPE...> with just <!DOCTYPE html>.

Can you give that a try?

Also, they would like to know what you are using to read the emails.

Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events