Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > Registration Form Email Template with custom fields View modes: 
User avatar
Member
Member
jonas-asenmarketing - 2/28/2012 2:25:16 PM
   
Registration Form Email Template with custom fields
Hello,
I am trying to display data from one of my custom registration fields in my email template with no luck. This is what I am trying:

{%Concept%}

{%CMS_User.Concept%}

Any ideas?

Thanks,
Jonas

User avatar
Kentico Support
Kentico Support
kentico_janh - 2/29/2012 6:32:48 AM
   
RE:Registration Form Email Template with custom fields
Hello,

If you want to use macros in your email template, you need to define them frist. You can do that in the ~\CMSWebParts\Membership\Registration\CustomRegistrationForm.ascx.cs file (or ~\CMSWebParts\Membership\Registration\RegistrationForm.ascx.cs -> depends on web part you are using) and there is following code around the line 757:

replacements = new string[4, 2];
replacements[0, 0] = "firstname";
replacements[0, 1] = ui.FirstName;
replacements[1, 0] = "lastname";
replacements[1, 1] = ui.LastName;
replacements[2, 0] = "email";
replacements[2, 1] = ui.Email;
replacements[3, 0] = "username";
replacements[3, 1] = userName;


And here you can define your custom macro, which will be used in your template and where the first field is a name of a macro and the second is its value.

Best regards,
Jan Hermann