symfony1 - Symfony framework: Common method for multiple modules -


I have several modules in my project:

1. Become a sponsor. 2. Become a demonstrator.
3. Call for papers 4. Etc. In these modules I have a form of data filling and depositing for users. It's like a registration form. If the registration is successful, then I send the "Welcome Message" to the user's email. This email template is normal for all situations!

Therefore, I need a normal function to call to send that email, method I do not want to write it in every action. Therefore, in that method I can get an example of mailer, user culture etc., such as the action of the original module.

Please help, brothers!

You can create a new category in your lib directory.

The file will automatically be included in your action files.

Then in your action:

  $ obj = new YourNewClass (); $ Obj- & gt; Send Mail ($ p1, $ p2, ...);    

Comments