Hi Experts ,
I am writing a custom form action in AEM. My action sends email as per a predefined template. Here is the code
MailTemplate mailTemplate = MailTemplate.create("/apps/custom_submit_action/store_and_email/temp.html", resolver.adaptTo(Session.class));
MultiPartEmail email = mailTemplate.getEmail(StrLookup.mapLookup(parameters), HtmlEmail.class);
This works fine.
Now I have an another template /apps/custom_submit_action/store_and_email/temp.xml, I want to send the data in this template as well. I dont want to send two separate emails. So basically, I have to send data in two formats. HTML and XML. Here are my two templates
temp.html
Dear ${admin};
A new ${user} has purchased ${product1},${product2} at ${city},${storeid}.
temp.xml
<purchase>
<customer>${customer}</customer><city>${city}</city><store>${storeid}</store></purchase>
I am looking for all possible suggestions.
Thanks