0

I have created an email template in Ax, using the %varname% as a placeholder for items added to the map when you send the email with this:

emailParameterMap.insert("modifiedBy", userFullName);
emailParameterMap.insert("vendorName", vendorName);

SysEmailTable::sendMail("VendChanges", "en-us", "user@domain.com", emailParameterMap);

But, I want to have a list of an unknown number of items in the email result that is sent.

How can I do that?

Jan B. Kjeldsen
  • 17,817
  • 5
  • 32
  • 50
CaffGeek
  • 21,856
  • 17
  • 100
  • 184

2 Answers2

0

I can't help thinking you will be better off using System.Net.Mail for this. Check out this blog article: http://hiyajac.blogspot.com/2010/06/sending-emails-from-dynamics-ax.html

Skaue
  • 763
  • 4
  • 13
  • how does that help me get a repeating placeholder in the template? – CaffGeek Jan 24 '11 at 19:50
  • You would probably need to load the template in your own custom method and set the mail content to the template result. If the repeating part is to be represented as a table, you would need to generate the HTML for a TABLE yourself. – Skaue Jan 27 '11 at 15:09
0

You can define your e-mail template with XSLT layout rather than HTML, to render a list of data.

But you will have to write your own code to generate for the XML you pass to SendMail as the _xmlData parameter. And you will of course also have to define the XSLT itself, for transforming the XML.

Palle Agermark
  • 346
  • 1
  • 3
  • 5