This a difficult subject to summarise succinctly- as it is a huge subject in Spain- and every Town Hall and every Archbishops Office in Spain is autonomous. i.e. they take the main Spanish/Church legalities but can add any, or change rules and regs. at any time- and often do.
The main types of legal marriages here are CIVIL or CATHOLIC
For both there is a fair amount of paperwork- which can be quite costly for 'foreigners' as they have to have every non Spanish document translated officially by a notarised signatory, and also individually stamped with an Apostille Hague Seal of their own Country.
(Apostille- The Hague Convention Abolishing the Requirement for Legalisation for Foreign Public Documents is an international treaty drafted by the Hague Conference on Private International Law. It specifies the modalities through which a document issued in one of the signatory countries can be certified for legal purposes in all the other signatory states.
It is an international certification comparable to a notarisation in domestic law.
Not all countries are party to this convention and have their own methods of legalisation.)
In most areas of Spain at least one of the couple must be registered as living in this country for a minimum of 2 years
and latterly in the Town in which they wish to be married.
For non EEC persons they may require visas and other different documents, depending on their Country of origin.
In cities in Spain the time frame for 'foreigners' to present paperwork to be married is less than rural areas- in general approx 2/3 months. In total about 5 months to complete
Catholic weddings paperwork takes more time - often 6- 9 months to complete, then send to the Archbishops here,get processed and be approved.If the couple live here they maybe called to their Archbishops for an interview.
CIVIL marriages- Every couple may have different circumstances and their Town Hall should advise what documents they require and give them an application form. Their own countries Embassy/Consul here may have to be visited for some of the documents and to publish the 'banns'(announcement of marriage.)
CATHOLIC- Their local church will advise- or the Archbishops of the area.Everyone needs a pre marriage course.
There is also a combined Religious marriage ceremony
( not Catholic) and legal Civil wedding,but you need a Reverend or Church person who is approved and certificated to do this.
For 'foreigners' not registered in Spain ( maybe they have a holiday home here or come here for holidays) the best and least expensive way for them to have a wedding here is -
Get married in your own Country ( quick Civil wedding) then come here and have a 'symbolic wedding.' which is like a 'real wedding'-but not legal- exchange vows, rings and sign a certificate. (Religious or non Religous)
In their hearts and minds it is the actual wedding day for them, their family and guests.
A good Wedding Planner can assist with all aspects and is well worth the cost, as they will generally save you more money than you pay them.