Registration attribute (Split the address attribute)

Permalink
Hello everyone,

I am facing a problem on the email page when the user registered an email sends to Admin.

The issue with the address attribute, an "attribute" variable calling where we can see all registration page attributes and their values.

In the address attribute contain "Street, City, state, zip code, country"

but I have to show them separately how I can split them.

Following the registration page controller.

$process = $this->app->make('user/registration')->createFromPublicRegistration($data);
        $attribs = UserAttributeKey::getRegistrationList();
        $attribValues = [];
         foreach ($attribs as $ak) {
         $attribValues[] = $ak->getAttributeKeyDisplayName('text') . ': ' . $process->getAttribute($ak->getAttributeKeyHandle(), 'display');
                    }
       $mh->addParameter('attribs', $attribValues);

 
jero replied on at Permalink Reply
jero
You're going to need to copy concrete/mail/user_register.php into application/mail. Clear the cache so that the file is detected.

Then you will need to modify it so that it tests each attribute and figures out if it's an address object. is_object and/or instanceof should help with that.

If it is an daddress object, you will need to add some logic that picks out the address components:

$address->address1
$address->address2
$address->city
$address->postal_code

and adds those to the mail individually.