The black trim clicketh into place
So, have you attempted to push it back onto it's clips?
If you have and it is so damaged that it will not clicketh back onto it's retainers then you'll have to whip the glass out and have a look. To removed the glass you will need a screw driver or similar levering device with some padding wrapped to prevent damage slot the levering device under the glass from the bottom then be brave and lever the glass out. Having removed the glass you will now see the srews holding the black trim in place.
The dealership will advice you that you cannot buy the black trim and attempt to sell you the whole mirror, for which you will need to re-mortgage your home. So, it's off the the breakers/scrappers to find a replacment which may be slightly different to your one and need some gently butchering.
Voila job sorted.
Good luck