Cool the Liquid Ingredients
Melt-and-mix cakes (those that are simply made by combining heated, melted ingredients with the dry ingredients) are one of the easiest types of cakes to bake, but there is one main thing that you need to keep in mind when making them – you need to cool the liquid ingredients to room temperature before adding the self-raising flour!
The main reason for this is because the baking powder, a chemical leavener contained in the self-raising flour, can be prematurely activated by the heat of the liquid ingredients as soon as they come into contact with each other. This also applies if the recipe contains extra bicarbonate of soda or baking powder added separately to the flour.
If triggered by the heat of the melted ingredients before the cake goes into the oven, the chemical leavener can ‘run out’ of leavening ability before the structure of the cake is set, causing the cake to sink in the centre before it has finished baking.
This is often the reason for melt-and-mix cakes to sink badly, especially if the recipe doesn't specify to cool the mixture to room temperature before combining it will the dry ingredients containing the chemical leavener.