Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Email is coming to mail without HTML format

Avatar

Avatar
Validate 10
Level 3
sunitac2231600
Level 3

Likes

4 likes

Total Posts

90 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile

Avatar
Validate 10
Level 3
sunitac2231600
Level 3

Likes

4 likes

Total Posts

90 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile
sunitac2231600
Level 3

27-10-2016

Dear All,

I have written one email functionality in AEM.

For this I have setup one custom scheduler and it will check if somebody used the japan page then it will send to me mail.

I have created my email template under /etc/notification/email/html/testapp/notifications/page_access.txt

Below is the content of page_access.txt.

I am successfully getting mail but Issue is that I am not getting mail in HTML format. Whatever in page_access.txt is there same thing I am getting in email ,as shown in below screenshot.

My email content should be look like below.

Issue - Whenever I am getting mail my all HTML format is lost and I am getting same contents which are in the page_access.txt

Thanks,

Sunita

**********************************CONTENT OF page_access.txt *************************************

<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>

</head>

<body>
<pre style="white-space:normal;">
        <table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
      <tbody>
        <tr>
          <td align="center" valign="top">

                <table width="600" border="0" cellpadding="0" cellspacing="0" align="center" style="border:1px solid #000000">
              <tbody>
                <tr><td align="left" valign="top"></td></tr>
                <tr>
                  <td align="left" valign="top">

                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tbody>
                        <tr>
                          <td width="20" valign="top" align="left"></td>
                          <td>

                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                              <tbody>
                                
                                <tr>
                                 <td height="10" valign="top" align="center"></td>
                                </tr>
                                <tr>
                                        <td>
                                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                <tr>
                                                <td valign="top" align="left">
                                                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                        <tr>
                                                         <td align="left" valign="top" style="font-family:Arial, sans-serif;font-size:14px;color:#000000;line-height:1;">Dear Content Approver,</td>
                                                         </tr>
                                                          <tr><td height="25" align="left" valign="top"></td></tr>
                                                            <tr>
                                                             <td align="left" valign="top" style="font-family:Arial, sans-serif;font-size:14px;color:#000000;line-height:1.5;">
                                                             This is a notification email to inform you that below page has been changed.
                                                             </td>
                                                             </tr>
                                                            
                                                            <br/><br/>
                                                            <tr><td> 
                                                            <b><ul><li>
                                                            <a href='http://localhost:4502/content/geometrixx/ja/events.html'>test</a>
                                                            </li></ul></b> 
                                                            </td></tr> 
                                                                                
                                                        <tr><td height="20" align="left" valign="top"></td></tr>
                                                        <tr>
                                                         <td align="left" valign="top" style="font-family:Arial, sans-serif;font-size:14px;color:#000000;line-height:1;">Best Regards,</td>
                                                        </tr>
                                                        <tr><td height="20" align="left" valign="top"></td></tr>

                                                        <tr>
                                                        <td align="left" valign="top" style="font-family:Arial, sans-serif;font-size:14px;color:#000000;line-height:1.5;">Sunita
                                                        </tr>
                                                       
                                                    </table>
                                                </td>
                                                <td width="80" valign="top" align="left"></td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>

                              </tbody>
                            </table>

                          </td>
                          <td width="20" valign="top" align="left"></td>
                        </tr>
                      </tbody>
                    </table>

                  </td>
                </tr>
                <tr><td height="20" align="left" valign="top"></td></tr>
              </tbody>
            </table>

          </td>
        </tr>
      </tbody>
    </table>
</pre>
</body>
</html>

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 7
Jitendra_S_Toma
Level 7

Likes

74 likes

Total Posts

615 posts

Correct Reply

84 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Validate 1
Level 7
Jitendra_S_Toma
Level 7

Likes

74 likes

Total Posts

615 posts

Correct Reply

84 solutions
Top badges earned
Validate 1
Give Back 50
Give Back 5
Give Back 3
Give Back 25
View profile
Jitendra_S_Toma
Level 7

27-10-2016

Hi,

I think issue is with your code which sends an email. You might be using SimpleEmail rather than HTMLEmail.  

FYI

AEM Email Service provides simple text email & Html Email. Check the code snippet which sends email and construct Email Object.

Regards,

Jitendra

Answers (4)

Answers (4)

Avatar

Avatar
Boost 5
Level 6
JK_Kendall
Level 6

Likes

36 likes

Total Posts

379 posts

Correct Reply

105 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile

Avatar
Boost 5
Level 6
JK_Kendall
Level 6

Likes

36 likes

Total Posts

379 posts

Correct Reply

105 solutions
Top badges earned
Boost 5
Boost 3
Boost 25
Boost 10
Boost 1
View profile
JK_Kendall
Level 6

28-10-2016

Check the Content-Type in your message header.  For HTML email it should be set as "text/html;charset=utf-8".

- JK

Avatar

Avatar
Validate 1
Level 2
Anton_Smulskiy
Level 2

Likes

3 likes

Total Posts

35 posts

Correct Reply

4 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
Affirm 3
View profile

Avatar
Validate 1
Level 2
Anton_Smulskiy
Level 2

Likes

3 likes

Total Posts

35 posts

Correct Reply

4 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
Affirm 3
View profile
Anton_Smulskiy
Level 2

27-10-2016

Hi,

Try to change the extension of your template from .txt to .html

Avatar

Avatar
Validate 10
Level 3
sunitac2231600
Level 3

Likes

4 likes

Total Posts

90 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile

Avatar
Validate 10
Level 3
sunitac2231600
Level 3

Likes

4 likes

Total Posts

90 posts

Correct Reply

0 solutions
Top badges earned
Validate 10
Validate 1
Ignite 5
Ignite 3
Ignite 10
View profile
sunitac2231600
Level 3

27-10-2016

Dear All,

I am following the below online docs for this use case.

http://www.tothenew.com/blog/send-email-and-attach-filesimages-from-aem/

NOTE - Everything is working fine. I am getting mail also. But The format is not coming in HTML in email.

Avatar

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile

Avatar
Validate 25
Level 10
smacdonald2008
Level 10

Likes

1,408 likes

Total Posts

12,671 posts

Correct Reply

2,278 solutions
Top badges earned
Validate 25
Validate 10
Validate 1
Give back 900
Give back 600
View profile
smacdonald2008
Level 10

27-10-2016

Are you following online docs for this use case - can you please reference that so ppl can try and reproduce.