I'm trying to extend the Form block to enable the user to choose an email recipient.
It is partway there; the problem is that it doesn't actually send an email to the selected user. Secondly, I can't figure out how to limit the users to a group.
If anyone would be willing to help, I'd be most grateful. Here is the code that has been added:
I just did something like this. It is a bit cobbled together, but it works.
First, I edited the controller.php for the built-in form block to do two things:
Find the email address and send a user email at the same time it sends the administrator email. See my edits listed under comments 5/18/10 in the controller.php (attached).
Second, I created block_form_submission_user.php as a template for the email form I wanted to send the user. In my case, it is an auto-confirmation email to users who registered to exhibit at a show. Attached, also.
Third, I uploaded these to files to their proper places, so not to override any of the C5 core. My modified controller file goes in root/blocks/forms. My email template goes in root/mail.
Lastly, I went to the dashboard and refreshed the form block, and ... voila!
It would be great if someone (maybe me) I wrote a proper update, so one could indicate the email field without the cheesy little hack I have: look for the field with an @ symbol.
Hope that helps!
Code
Post Reply
Delete Post
You are allowed to delete your post for 5 minutes after it's posted.
This website stores cookies on your computer. These cookies are used to improve
your website experience and provide more personalized services to you, both on this website and through
other media. To find out more about the cookies we use, see our Privacy Policy.
First, I edited the controller.php for the built-in form block to do two things:
Find the email address and send a user email at the same time it sends the administrator email. See my edits listed under comments 5/18/10 in the controller.php (attached).
Second, I created block_form_submission_user.php as a template for the email form I wanted to send the user. In my case, it is an auto-confirmation email to users who registered to exhibit at a show. Attached, also.
Third, I uploaded these to files to their proper places, so not to override any of the C5 core. My modified controller file goes in root/blocks/forms. My email template goes in root/mail.
Lastly, I went to the dashboard and refreshed the form block, and ... voila!
It would be great if someone (maybe me) I wrote a proper update, so one could indicate the email field without the cheesy little hack I have: look for the field with an @ symbol.
Hope that helps!