Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: How to Disable Un-used System Fields From Showing in Email

How to Disable Un-used System Fields From Showing in Email 14 years 6 months ago #8192

  • compass9
  • compass9's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
In my country, we do not use "State" and "City". So I disable these fields from being displayed in the front-end registration form, thus these 2 blank fields are expected in the back-end.

However, when I setup my "Thank You" email to display [CONTACT_DETAILS], DT Register will send out the email with these fields for these un-used fields (state, city) as empty, so the output email looks odd - like this:

Address
, , Postal Code
Country
Phone
Email


If both State and City were used (as in the U.S.), it will look fine - like this:

Address
City, State, Zip
Country
Phone
Email


So my question is - what do I need to do to display in my own custom format - like this:

Address,
Country, Postal Code


I noticed there are no tags for system fields like [ADDRESS] or [ZIPCODE] or [COUNTRY] available for me to custom built my contact details display. It only allows [CONTACT_DETAILS] as a block of contact-related fields. Also, there are no field labels for this block tag.

Could someone help to explain what can be done for displaying of system fields in building a custom thank you email? Thanks.

Please Log in or Create an account to join the conversation.

How to Disable Un-used System Fields From Showing in Email 14 years 6 months ago #8195

  • dthadmin
  • dthadmin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Posts: 5470
  • Thank you received: 3
Hello. You can modify this file:

/components/com_dtregister/common.php

Search for this:

$contactDetails

You'll find it 3 times where it is constructing the CONTACT_DETAILS tag for various messages. You will also find in this file the layout for other emails... like the one the administrator receives. Thanks.

Please Log in or Create an account to join the conversation.

How to Disable Un-used System Fields From Showing in Email 14 years 6 months ago #8204

  • compass9
  • compass9's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 4
  • Thank you received: 0
In common.php, I can find the 3 instances for "$contactDetails".
$contactDetails = $address.'<br />'.$address2_display.' '.$city.', '.$state.' '.$zip.'<br />'.$phone.'<br />'.$email;
$contactDetails = $dt_user->userAddress.'<br />'.$address2_display.' '.$dt_user->userCity.', '.$dt_user->userState.' '.$dt_user->userZip.'<br />'.$dt_user->userPhone.'<br />'.$dt_user->userEmail;
$contactDetails = $member->address.'<br />'.$address2_display.' '.$member->city.', '.$member->state.' '.$member->zip.'<br />'.$member->phone.'<br />'.$member->email;

When I try to modify any of these, nothing seems to change at the email output. I did a simple test like adding html tags like <hr/> or <br/> into the codes to identify which one of the three is responsible for constructing the tag CONTACT_DETAILS.

I noticed that the string $country is not even in the codes, this should appear between the $zip and $phone strings. Any advice as to what I should do to these codes? I just need to have something like this in my thank you email:

Address,
Country, Postal Code
Phone
Email


The City and State fields should not appear.

Many thanks!

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.109 seconds