What are tokens ?

0
I want to know more about it as I'm creating new email template and want to add tokens in it so as to send email to user.
asked
4 answers
5

Hi Jitesh,

Tokens are small pieces of information that will be put into the email at runtime.
A very basic example, lets say you have users in your app and you would personalize the emails you send to them so that the user name is used in the greeting of the email e.g. 

Dear Mr. Bhardwaj,

You can achieve this by defning a token:

Token object: Administration.Account

Token:
Token type - Attribute
Attribute name - FullName 
Token String - {%Name%}

Then in your email template you can put:

Dear Mr. {%Name%},

When the email is sent the placeholder text {%Name%} will be replaced with the actual user name.

-Andrej
Here is ascreenshot to help with the example

answered
2

Hi,

I guess I forgot to mention that Tokens are not replaced automatically but you need to make sure that they are replaced in a microflow, here is an example screenshot 

And here is the complete microflow in model share: https://modelshare.mendix.com/models/19fcc9e7-5cb7-4bf8-836f-0c36c0093fa2/create-and-send-email-with-token-replacement

You have a similar example under Use Me in the email module itself.

-Andrej

answered
0

Hi Anderj,

Thank You for the reply.

I tried to do exactly what you told me but its not working, when I send my mail with the token , my token is printed as it is{%Name%} in the received mail.

in the HTML text  I write:

Hello {%Name%} and send it but When I receive my mail it shows:

Hello {%Name%} , instead of Hello Jitesh (value of the token) I have set everything above as described by you

Can you help me with this??

Thanks

 

answered
0

Can you also help me with this problem??

I have downloaded Mx Model Reflection ,E-mail module with templates and Encryption modules from App Store

In security I have chosen prototype/demo and given Administrator name as mendix with my password

I have given all rights to the Administrator in the security for all the 3 modules I downloaded giving Administrator all the access

I created a page in MyFirstModule and added a button MxOverview in it and onclick of this button, it should open a page MxObjects_Overview from Mx Model Reflection

but when I run the app and click on this button an error pops up saying that :

"Executing action failed for security reasons: MxModelReflection.DSO_InheritsFromContainer" and the contents of the page are missing

but I have already checked security for Mx Model Reflection and have given the access to Administrator

In Console also these the warning when I click that button:

1)"User 'Mendix' attempted to execute the microflow with action name 'MxModelReflection.DSL_Modules', but does not have the required permissions"

2)"User 'Mendix' attempted to execute the microflow with action name 'MxModelReflection.DSO_InheritsFromContainer', but does not have the required permissions"

3)"User 'Mendix' attempted to execute the microflow with action name 'MxModelReflection.DSO_InheritsFromContainer', but does not have the required permissions"

In all these microflows I have given the administrator the rights (even by going to their properties and setting allowed user to be Administrator)

What am I doing wrong??

And what should I do so that my MxObjects_Overview page opens and shows it's contents(All the modules in my app).

 

 

answered