Is there a good design pattern for this messaging class?

Posted by salonMonsters on Programmers See other posts from Programmers or by salonMonsters
Published on 2012-12-11T02:39:39Z Indexed on 2012/12/11 5:18 UTC
Read the original article Hit count: 293

Is there a good design pattern for this?

I want to create a messaging class.

The class will be passed:

the type of message (eg. signup, signup confirmation, password reminder etc) the client's id The class needs to then look up the client's messaging preferences in the db (whether they want communication by email, sms or both)

Then depending on the client's preference it will format the message for the medium (short version for sms, long form for email) and send it through our mail or sms provider's API.

Because the fact that we want to be able to change out email and sms providers if need be I wondered if the Command Pattern would be a good choice.

© Programmers or respective owner

Related posts about php

Related posts about design-patterns