Hello all,
On our development servers, when we work with forms and we test them, normally we use our own emails so that, when we test, we can receive those results and see if it’s all working.
When we change to production, we must change those emails to “production” emails.
Often, we tend to forget that, and not so uncommonly we are receiving data that we shouldn’t and, at the same time, our production beneficiaries aren’t receiving what they should.
How/where can we define our emails so that, when we are on the developing side, we have our dev email called and, when we are on production side we have our production emails called?
Please note:
I’m not that concerned with status messages, or emails that we use while stress testing something odd, no bug notifications, nothing like that.
I’m talking only about those emails that normally, we use to send form informations into.
I believe that application.ini is the right place to deal with this. Perhaps:
[production]
contact.email.address = "trueemail@email.com"
contact.email.name = "John Stuart"
joinus.email.address = "anotheremail@email.com"
joinus.email.name = "Patricia Bill"
[development : production]
contact.email.address = "my@email.com"
contact.email.name = "Devname"
joinus.email.address = "my@email.com"
joinus.email.name = "Devname"
But if we do such a thing I quickly have a problem and a question:
Problem:
If we have 10 forms on the application, I defeat the dry principle on the [development] environment, since I have to write 10 times the same address and name.
Question:
If this approach is still acceptable, and by knowing that I will probably use Zend_Form, how should I call those values when I have to program the form?
If this approach is NOT acceptable, what do you suggest ?
Thanks a lot,
Márcio