User Registration Email with lookup fields

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
kenyanprince
User
Posts: 1

User Registration Email with lookup fields

Post by kenyanprince »

Hi,
Users register on my site and one of the requirements is selecting the city.
The city name is in a separate table linked by the ID, when the user registers on the website I would like instead of them getting an email with the value they get the name of the city from the lookup table.
Please explain how this would be possible as I have tried understanding from other posts but not been able to understand it and get it working.
In the user table the field is an INT and the lookup table this is the townID, on the form it displays townName from the selections and not the value 1,2,...
Which is what gets emailed but on the view users page it displays the town name instead of the value, would like it to do the same when emailing i.e. email town name and not value.


arbei
User
Posts: 9396

Post by arbei »

You may try:

  • Enable User Level Security and make sure the lookup table for the city field is allowed for the Anonymous User Level (so that data can be viewed before login)
  • Set up lookup table for the city field as usual
    (Assume you use the latest version v2019.0.9.)

mobhar
User
Posts: 11741

Post by mobhar »

kenyanprince wrote:
would like it to do the same when emailing i.e. email town name and not value.

You may simply use "Email_Sending" server event under "Server Events" -> "Other" -> "Registration Page" in order to replace the value with the name. But, before you do that, you need to check from the generated "users.php" file (assume your users table name is "users") that located inside "classes" sub-folder; see the code inside "prepareRegisterEmail" function, and see the tag, such as <!--City--> (assume the field name is "City"). So, back again to "Email_Sending" server event, you may simply use $email param to replace the value with the name of CIty that you can get by using ExecuteScalar global function.


Post Reply