0

I have tried to form the email body of a singleemail message as below but it is giving Line break errors. Can someone help me here?

 String body = 'Dear ' + OneMap.get(mycontact.ID).Rep_abv__r.Name + ', ';
  body += '<br><br>What you need to know:';
  body += '<br>ABS Incident '+ OneMap.get(mycontact.ID).Name +' has been closed';
  body += '<br>To view your open incidents:<br>';
  body += '<ol type="1">
             <li>       Log into the IREP app on your iPad and select “Compliance Incidents”</li>
             <li>       Select the “Closed Incidents” View in the Compliance Incidents Home Page.</li>
             <li>       Click the Incident ID to view your incidents<br></li>
            </ol>';
  body += 'If you need assistance, please call the Field Help Desk at 1-800-344-6776.<br>';
  • how are you setting this body. – Tushar Sharma Oct 15 '15 at 4:56
  • What are the line break errors? – Nick Cook Oct 15 '15 at 5:40
  • @All, Thanks got it fine now but an unknown image comes in email body now. Can you guys let me know the reason? Please find the screenshot below. – Testing_SFDC Oct 15 '15 at 6:43
2

I think this is giving you error, as you are in fact breaking string

body += '<ol type="1">

     <li>       Log into the IREP app on your iPad and select...

Change it to:

body += '<ol type="1">';
body += '<li>       Log into the IREP app on your iPad and select ';
...

also please consider using workflow and/or email template for sending email (if possible)

| improve this answer | |
0

I got it resolved but getting an image stuff , can't figure out why. Can someone please look into this?

enter image description here

String body = 'Dear ' + OneMap.get(mycontact.ID).Rep_abv__r.Name + ', ';
  body += '<br><br>What you need to know: ';
  body += '<br>New ABS Incidents have been generated in iREP. Please review these incidents with your DM or Applicable Manager. There is no other action for you to complete in iREP.';
  body += '<br>To view your open incidents:<br>';
  body += '<ol type="1"><br><li>       Log into the iREP app on your iPad and select Compliance Incidents</li><br><li>       Select the Open Incidents. </li><br><li> View in the Compliance Incidents Home Page.</li><br><li>       Click the Incident ID to view your incidents.</li></ol> <br>If you need assistance, please call the Field Help Desk at 1-800-344-6776.<br>';
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.