JavaScript in Email Notification HTML Body field

Hello,

Is there a way to use javascript, in Email Notification Body HTML field? So that, multiple item details can be rendered and populated in the email.

Thanks in Advance

  • Hi,

    Script in Email? Do you want to hack somebody? :) . Javascript in Email is not supported in modern Email readers.

    But I assume that was not your question. I assume you want to render a custom email Body? Not at your client PC, but inside your Innovator at the moment the email is send?

    Look at this community project: https://github.com/ArasLabs/email-related-files

    It shows how to send emails via Method with custom body. Note that the project is a little bit dated, the code doesn´t use the latest functions to send email. But you should be able to google them easily. As far as I remember, even the Innovator Method editor recommends you the correct replacement

  • Hello, this website is bugged so I can't ask  a new Question (I have a white page when I click Ask, tried with both Firefox and Chromium), so I will ask here because that's kinda related.

    I guess what   wanted to achieve is conditional rendering in the email template.

    Something like `<p>You can access it by clicking the ${Item[@type='Part']/name/text() === "Old" ? "blue" : "red"} button.</p>` for example.

    I tried to add a ternary like this but it didn't work, so my question is, what is the template engine used by Aras? Where can I read about it, and does it have a syntax to do conditional rendering?

    cc  

  • Hi Antoine,

    I see what you're seeing when you try and ask a question using the widget at the top of the Forum list.

    If you scroll to the bottom of the list, you see a different form to create a new thread, which seems to work. I'll reach out and try and get that fixed ASAP. Thank you for bringing it to our attention. 

    If you wouldn't mind, could you create a new thread for this question for some more visibility?

    Thanks,

    AJ

    Update: The broken ask button has been removed.

  • Thanks AJ for fixing the button! But what if the button successfully tricked the spam bots? I hope you haven´t removed an important forum feature.Smile

    Some additional feedback, but it´s only a trivial issue: With the homepage update Aras now links the forum to "Latest posts" page. This page is very useful and honors the fact that many people for an unknown reason are overwhelmed by the task of selecting the right category.

    But once you are inside the forum, you cannot get back to the "Latest posts" page. The homepage currently mix up these two links which lead to different start pages of the forum.

     https://www.aras.com/community  vs. https://www.aras.com/community/f

    This might be confusing for people not familiar with the forum. But it´s really only a trivial issue.

     From my experience, anything even remotely close to "automation" in emails is unfortunately not possible. We cannot even use CSS classes.

    But for your example maybe a trick could work. Try using a fake property to pass the "red/blue" value. You can call the email template from a Method which allows you to pass extra context properties on demand.