# HTML Email Failing To Send

**URL:** <https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447>\
**Category:** IIQ Discussion and Questions\
**Tags:** identityiq\
**Created:** [September 16, 2024, 6:48pm UTC](https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447 "2024-09-16T18:48:04Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jsgentry1](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jsgentry1](https://developer.sailpoint.com/discuss/u/jsgentry1)\
**Post date:** [September 16, 2024, 6:48pm UTC](https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447/1 "2024-09-16T18:48:04Z")

</div>

## Which IIQ version are you inquiring about?

8.3

## Please share any other relevant files that may be required (for example, logs).

[EmailTemplate-LcmUserNotification.xml](https://developer.sailpoint.com/discuss/uploads/short-url/A48tBEfPIcWslH63CZXGqKztK7d.xml) (5.2 KB)

## Share all details about your problem, including any error messages you may have received.

We are getting the error below when trying to send email with the attached template:

> 2024-09-16 14:27:36,149 INFO [stdout] (Thread-260) 2024-09-16T14:27:36,149 WARN Thread-260 sailpoint.request.RequestHandler:209 - sailpoint.request.RequestPermanentException: Unable to send email notification, a to address was not specified  
> 2024-09-16 14:27:36,149 INFO [stdout] (Thread-260) at deployment.identityiq.war//sailpoint.request.EmailRequestExecutor.execute(EmailRequestExecutor.java:87)

---

<div class="post-metadata">

**Author:** ![enistriminsait](https://avatars.discourse-cdn.com/v4/letter/e/58f4c7/32.png) [@enistriminsait](https://developer.sailpoint.com/discuss/u/enistriminsait)\
**Post date:** [September 16, 2024, 10:09pm UTC](https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447/2 "2024-09-16T22:09:32Z")

</div>

> [@jsgentry1](#):
>
> Unable to send email notification, a to address was not specified

Hi @jsgentry1,

in your WF are setting `to` argument? Like this:

```auto
<Step action="call:sendEmail" condition="script:Util.csvToList(notificationScheme).contains(&quot;user&quot;)" icon="Email" name="Notify User" posX="98" posY="10">
    <Arg name="template" value="ref:userEmailTemplate"/>
    <Arg name="to" value="script:getUserEmail(identityName, plan)"/>
    <Arg name="approvalSet" value="call:prepareApprovalSetForNotification"/>
    <Transition to="Notify Requester"/>
  </Step>

```

---

<div class="post-metadata">

**Author:** ![Arun-Kumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/arun-kumar/32/15128_2.png) [@Arun-Kumar](https://developer.sailpoint.com/discuss/u/Arun-Kumar)\
**Post date:** [September 17, 2024, 5:50am UTC](https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447/3 "2024-09-17T05:50:56Z")

</div>

Hi @jsgentry1,

Add **to** arg in workflow sendEmail step. You can write a script tp send an email to requester or requester manager. Please refer the below script.

```auto
  <Arg name="to">
      <Script>
        <Source>
          <![CDATA[
     import sailpoint.object.Identity;
          
      Identity requesterIdentity = context.getObjectByName(Identity.class, identityName);	  
	  Identity manageridentity = requesterIdentity.getManager();
      if(null != requesterIdentity)
				return requesterIdentity.getStringAttribute("email"); // send email to requester

/*
if(null != manageridentity)
				return manageridentity.getStringAttribute("email"); //send email to requester manager
*/				
      else
         return "test@test.com"; //default email 
         ]]></Source>
      </Script>
    </Arg>

```

Regards,  
Arun

---

<div class="post-metadata">

**Author:** ![jsgentry1](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jsgentry1](https://developer.sailpoint.com/discuss/u/jsgentry1)\
**Post date:** [September 17, 2024, 12:20pm UTC](https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447/4 "2024-09-17T12:20:07Z")

</div>

I don’t believe the Workflow is the problem. The default e-mail message comes across fine; it’s only when I try to use HTML that the problem occurs.

---

<div class="post-metadata">

**Author:** ![jsgentry1](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jsgentry1](https://developer.sailpoint.com/discuss/u/jsgentry1)\
**Post date:** [September 19, 2024, 2:50pm UTC](https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447/5 "2024-09-19T14:50:44Z")

</div>

As you can see from the filename of the template I attached, we are trying to add HTML to the LCM User Notification message. Could you tell me if the template is wrong? If so, how?

---

<div class="post-metadata">

**Author:** ![Arun-Kumar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/arun-kumar/32/15128_2.png) [@Arun-Kumar](https://developer.sailpoint.com/discuss/u/Arun-Kumar)\
**Post date:** [September 20, 2024, 4:06am UTC](https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447/6 "2024-09-20T04:06:11Z")

</div>

In CDATA sections, you can use `&&` instead of `&amp;&amp;` to represent the ampersand character (`&`).

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/4/2/4255f04587f7e9969b5c39dcf6cb6283dc5a2263.png)

Also, you can test the EmailTemplate using rule. Please test the emailTemplate and post, if you get any error message.

---

<div class="post-metadata">

**Author:** ![jsgentry1](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jsgentry1](https://developer.sailpoint.com/discuss/u/jsgentry1)\
**Post date:** [September 20, 2024, 1:26pm UTC](https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447/7 "2024-09-20T13:26:25Z")

</div>

Replacing the &amp;s did the trick! Thank you so much!

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [November 19, 2024, 1:27pm UTC](https://developer.sailpoint.com/discuss/t/html-email-failing-to-send/81447/8 "2024-11-19T13:27:03Z")

</div>

Closed on November 19, 2024, 1:27pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
