I am looking to find the message tokens in the message template what kind of expressions do they support and I cannot find the code that evaluates them and generates the email.
and anyway for message tokens you can find it in "MessageTokenProvider" And to use it in Email you can look for Service "WorkflowMessageService" - In this for ex look for "SendCustomerRegisteredNotificationMessage" method. In this they first select appropriate message template, than add tokens to it, and sends a mail.
I am looking to find the message tokens in the message template what kind of expressions do they support and I cannot find the code that evaluates them and generates the email.
Agree with bhautik.
Also, there are rise events of all token groups replaced. So you can use the event in plugin and add your new token.
I managed to add a new token into the MessageTokenProvider but what I am looking now is how to use these tokens. Apart from equal is there any way to use StartsWith or Contains for a string value token?
You add the Tokens in the message templates as you will have seen RE Conditions: I just found this but I cant see anything in documentation
%if (%Order.PaymentMethod%=="PaypalString") Insert text here endif%
Have a play and see if it works. Other than that you can modify the src\Libraries\Nop.Services\Messages\MessageTokenProvider.cs to do what ever you want
This is the code see src\Libraries\Nop.Services\Messages\Tokenizer.cs I dont really know how it works without running it up in the debugger but I think it only has the equals as shown above Maybe you can add the other conditions
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.